Commit cf4f8bd6 authored by Gilles-Philippe Leblanc's avatar Gilles-Philippe Leblanc
Browse files

Use SVG images and provide backward compatibility (Bug #1416890)

Change-Id: I724a844fc9e4fbae9e58834082279b4f3f21995c
parent f8050885
......@@ -23,7 +23,7 @@ if ($readone) {
$unread = $USER->add_unread(-1);
$data = array(
'newunreadcount' => $unread,
'newimage' => $THEME->get_url($unread ? 'images/newmail.png' : 'images/message.png'),
'newimage' => $THEME->get_image_url($unread ? 'newmail' : 'message'),
);
json_reply(false, array('data' => $data));
}
......@@ -98,7 +98,7 @@ $newhtml = activitylist_html($type, $limit, $offset);
if (isset($newunread)) {
$newhtml['newunreadcount'] = $newunread;
$newhtml['newimage'] = $THEME->get_url($newunread ? 'images/newmail.png' : 'images/message.png');
$newhtml['newimage'] = $THEME->get_image_url($newunread ? 'newmail' : 'message');
}
json_reply(false, (object) array('message' => $message, 'data' => $newhtml));
......@@ -59,8 +59,8 @@ if (!isset($options[$type])) {
require_once('activity.php');
$activitylist = activitylist_html($type);
$star = json_encode($THEME->get_url('images/star.png'));
$readicon = json_encode($THEME->get_url('images/readusermessage.png'));
$star = json_encode($THEME->get_image_url('star'));
$readicon = json_encode($THEME->get_image_url('readusermessage'));
$strread = json_encode(get_string('read', 'activity'));
$javascript = <<<JAVASCRIPT
......
......@@ -102,7 +102,7 @@ foreach ($iframesources as $url => $name) {
),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_url('images/btn_deleteremove.png'),
'src' => $THEME->get_image_url('btn_deleteremove'),
'alt' => get_string('deletespecific', 'mahara', $name),
'elementtitle' => get_string('delete'),
'confirm' => get_string('confirmdeletemenuitem', 'admin'),
......
......@@ -137,9 +137,9 @@ foreach (array_keys($plugins) as $plugin) {
}
global $THEME;
$loadingicon = $THEME->get_url('images/loading.gif');
$successicon = $THEME->get_url('images/success.png');
$failureicon = $THEME->get_url('images/failure.png');
$loadingicon = $THEME->get_image_url('loading');
$successicon = $THEME->get_image_url('success');
$failureicon = $THEME->get_image_url('failure');
$loadingstring = json_encode(get_string('upgradeloading', 'admin'));
$successstring = json_encode(get_string('upgradesuccesstoversion', 'admin'));
......
......@@ -85,9 +85,9 @@ if (empty($upgrades['core']->install)) {
}
}
$loadingicon = $THEME->get_url('images/loading.gif');
$successicon = $THEME->get_url('images/success.png');
$failureicon = $THEME->get_url('images/failure.png');
$loadingicon = $THEME->get_image_url('loading');
$successicon = $THEME->get_image_url('success');
$failureicon = $THEME->get_image_url('failure');
// Remove all files in the smarty and dwoo caches
// TODO post 1.2 remove the smarty part
......
......@@ -60,7 +60,7 @@ $calendar = array(
'tabindex' => false,
'type' => 'calendar',
'title' => get_string('date'),
'imagefile' => $THEME->get_url('images/btn_calendar.png'),
'imagefile' => $THEME->get_image_url('btn_calendar'),
'defaultvalue' => strtotime($search->loggedindate),
'caloptions' => array(
'showsTime' => true,
......
......@@ -235,7 +235,7 @@ class ArtefactTypeAnnotation extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/annotation.png', false, 'artefact/annotation');
return $THEME->get_image_url('annotation', 'artefact/annotation');
}
public static function get_links($id) {
......@@ -482,7 +482,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/annotation.png', false, 'artefact/annotation');
return $THEME->get_image_url('annotation', 'artefact/annotation');
}
public function delete() {
......@@ -1185,7 +1185,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
'blockid' => array('type' => 'hidden', 'value' => $blockid),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_url('images/btn_deleteremove.png'),
'src' => $THEME->get_image_url('btn_deleteremove'),
'value' => get_string('delete'),
'elementtitle' => get_string('delete'),
'confirm' => get_string('reallydeletethisannotationfeedback', 'artefact.annotation'),
......
......@@ -202,17 +202,17 @@ $smarty->assign('artefactpath', $artefactpath);
$smarty->assign('INLINEJAVASCRIPT', $inlinejavascript);
if (get_config('viewmicroheaders')) {
$smarty->assign('maharalogofilename', 'images/site-logo-small.png');
$smarty->assign('maharalogofilename', 'site-logo-small');
$smarty->assign('microheaders', true);
$smarty->assign('microheadertitle', $view->display_title(true, false));
// Support for normal, light, or dark small Mahara logo - to use with skins
if ($skin) {
if ($skindata['header_logo_image'] == 'light') {
$smarty->assign('maharalogofilename', 'images/site-logo-small-light.png');
$smarty->assign('maharalogofilename', 'site-logo-small-light');
}
else if ($skindata['header_logo_image'] == 'dark') {
$smarty->assign('maharalogofilename', 'images/site-logo-small-dark.png');
$smarty->assign('maharalogofilename', 'site-logo-small-dark');
}
}
}
......
......@@ -262,7 +262,7 @@ class ArtefactTypeBlog extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/journal.png', false);
return $THEME->get_image_url('journal');
}
public static function is_singular() {
......@@ -447,7 +447,7 @@ class ArtefactTypeBlog extends ArtefactType {
),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_url('images/btn_deleteremove.png'),
'src' => $THEME->get_image_url('btn_deleteremove'),
'alt' => get_string('deletespecific', 'mahara', $title),
'elementtitle' => get_string('delete'),
'confirm' => $confirm,
......@@ -706,7 +706,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/journal_entry.png', false);
return $THEME->get_image_url('journal_entry');
}
public static function is_singular() {
......@@ -989,7 +989,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_url('images/btn_deleteremove.png'),
'src' => $THEME->get_image_url('btn_deleteremove'),
'alt' => get_string('deletespecific', 'mahara', $title),
'elementtitle' => get_string('delete'),
'confirm' => get_string('deleteblogpost?', 'artefact.blog'),
......
......@@ -261,7 +261,7 @@ class ArtefactTypeComment extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/comment.png', false, 'artefact/comment');
return $THEME->get_image_url('comment', 'artefact/comment');
}
public function delete() {
......@@ -823,7 +823,7 @@ class ArtefactTypeComment extends ArtefactType {
'comment' => array('type' => 'hidden', 'value' => $id),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_url('images/btn_deleteremove.png'),
'src' => $THEME->get_image_url('btn_deleteremove'),
'value' => get_string('delete'),
'elementtitle' => get_string('delete'),
'confirm' => get_string('reallydeletethiscomment', 'artefact.comment'),
......
......@@ -1441,7 +1441,7 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/file.png');
return $THEME->get_image_url('file');
}
public static function get_config_options() {
......@@ -2041,7 +2041,7 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/folder.png');
return $THEME->get_image_url('folder');
}
public static function collapse_config() {
......@@ -2494,7 +2494,7 @@ class ArtefactTypeArchive extends ArtefactTypeFile {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/archive.png');
return $THEME->get_image_url('archive');
}
public function open_archive() {
......@@ -2796,7 +2796,7 @@ class ArtefactTypeVideo extends ArtefactTypeFile {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/video.png');
return $THEME->get_image_url('video');
}
public static function get_title_progressbar() {
......@@ -2850,7 +2850,7 @@ class ArtefactTypeAudio extends ArtefactTypeFile {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/audio.png');
return $THEME->get_image_url('audio');
}
public static function get_title_progressbar() {
......
......@@ -63,7 +63,7 @@ $uploadform = pieform(array(
$strnoimagesfound = json_encode(get_string('noimagesfound', 'artefact.file'));
$struploadingfile = json_encode(get_string('uploadingfile', 'artefact.file'));
$wwwroot = get_config('wwwroot');
$notfound = $THEME->get_url('images/no_userphoto.png');
$notfound = $THEME->get_image_url('no_userphoto');
if (!get_config('remoteavatars')) {
$ravatar = $notfound;
}
......
......@@ -851,7 +851,7 @@ class ArtefactTypeHtml extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/note.png', false, 'artefact/internal');
return $THEME->get_image_url('note', 'artefact/internal');
}
public static function is_singular() {
......
......@@ -217,7 +217,7 @@ function deletenote_form($id, $notedata) {
),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_url('images/btn_deleteremove.png'),
'src' => $THEME->get_image_url('btn_deleteremove'),
'alt' => get_string('deletespecific', 'mahara', $notedata->title),
'elementtitle' => get_string('delete'),
),
......
......@@ -75,8 +75,8 @@ require_once(get_config('docroot') . 'lib/activity.php');
// use the new function to show from - and to user
$activitylist = activitylistin_html($type);
$star = json_encode($THEME->get_url('images/star.png'));
$readicon = json_encode($THEME->get_url('images/readusermessage.png'));
$star = json_encode($THEME->get_image_url('star'));
$readicon = json_encode($THEME->get_image_url('readusermessage'));
$strread = json_encode(get_string('read', 'activity'));
$strnodelete = json_encode(get_string('nodelete', 'activity'));
$javascript = <<<JAVASCRIPT
......
......@@ -33,7 +33,7 @@ if ($readone) {
$unread = $USER->add_unread(-1);
$data = array(
'newunreadcount' => $unread,
'newimage' => $THEME->get_url($unread ? 'images/newmail.png' : 'images/message.png'),
'newimage' => $THEME->get_image_url($unread ? 'newmail' : 'message'),
);
json_reply(false, array('data' => $data));
}
......@@ -130,7 +130,7 @@ $newhtml = activitylistin_html($type, $limit, $offset);
if (isset($newunread)) {
$newhtml['newunreadcount'] = $newunread;
$newhtml['newimage'] = $THEME->get_url($newunread ? 'images/newmail.png' : 'images/message.png');
$newhtml['newimage'] = $THEME->get_image_url($newunread ? 'newmail' : 'message');
}
json_reply(false, (object) array('message' => $message, 'data' => $newhtml));
......@@ -27,7 +27,7 @@ if ($readone) {
$unread = $USER->add_unread(-1);
$data = array(
'newunreadcount' => $unread,
'newimage' => $THEME->get_url($unread ? 'images/newmail.png' : 'images/message.png'),
'newimage' => $THEME->get_image_url($unread ? 'newmail' : 'message'),
);
json_reply(false, array('data' => $data));
}
......@@ -90,7 +90,7 @@ $newhtml = activitylistout_html($type, $limit, $offset);
if (isset($newunread)) {
$newhtml['newunreadcount'] = $newunread;
$newhtml['newimage'] = $THEME->get_url($newunread ? 'images/newmail.png' : 'images/message.png');
$newhtml['newimage'] = $THEME->get_image_url($newunread ? 'newmail' : 'message');
}
json_reply(false, (object) array('message' => $message, 'data' => $newhtml));
......@@ -68,8 +68,8 @@ require_once(get_config('docroot') . 'lib/activity.php');
// use the new function to show from - and to user
$activitylist = activitylistout_html($type);
$star = json_encode($THEME->get_url('images/star.png'));
$readicon = json_encode($THEME->get_url('images/readusermessage.png'));
$star = json_encode($THEME->get_image_url('star'));
$readicon = json_encode($THEME->get_image_url('readusermessage'));
$strread = json_encode(get_string('read', 'activity'));
$strnodelete = json_encode(get_string('nodelete', 'activity'));
$javascript = <<<JAVASCRIPT
......
......@@ -81,7 +81,7 @@ class ArtefactTypePlan extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/plan.png', false, 'artefact/plans');
return $THEME->get_image_url('plan', 'artefact/plans');
}
public static function is_singular() {
......@@ -354,7 +354,7 @@ class ArtefactTypeTask extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_url('images/plantask.png', false, 'artefact/plans');
return $THEME->get_image_url('plantask', 'artefact/plans');
}
public static function is_singular() {
......
......@@ -1065,8 +1065,8 @@ EOF;
$editjsstr = json_encode(get_string('editspecific', 'mahara', '%s')) . ".replace('%s', {$titlestring})";
$deljsstr = json_encode(get_string('deletespecific', 'mahara', '%s')) . ".replace('%s', {$titlestring})";
$imagemoveblockup = json_encode($THEME->get_url('images/btn_moveup.png'));
$imagemoveblockdown = json_encode($THEME->get_url('images/btn_movedown.png'));
$imagemoveblockup = json_encode($THEME->get_image_url('btn_moveup'));
$imagemoveblockdown = json_encode($THEME->get_image_url('btn_movedown'));
$upstr = get_string('moveup', 'artefact.resume');
$downstr = get_string('movedown', 'artefact.resume');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment