From: tjhunt Date: Fri, 3 Jul 2009 04:23:05 +0000 (+0000) Subject: MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=666e84584c630c9f20d1fc7cf8ca79169f7c8dea;p=moodle.git MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url --- diff --git a/blocks/admin_tree/admintree.js b/blocks/admin_tree/admintree.js index 7acc422f7a..f266096782 100644 --- a/blocks/admin_tree/admintree.js +++ b/blocks/admin_tree/admintree.js @@ -6,12 +6,12 @@ admin_tree = { closedalt: null, openalt: null, - init: function(numdivs, expandnodes, pixpath, openalt, closedalt) { + init: function(numdivs, expandnodes, openimg, closedimg, openalt, closedalt) { // Store the information we were passed in. - admin_tree.closedimg = pixpath + '/i/closed.gif'; - admin_tree.openimg = pixpath + '/i/open.gif'; - admin_tree.closedalt = closedalt; + admin_tree.openimg = openimg; + admin_tree.closedimg = closedimg; admin_tree.openalt = openalt; + admin_tree.closedalt = closedalt; admin_tree.numdivs = numdivs; // Initialise the hiddennodes array. diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php index c6aee6266e..fe3ad37936 100644 --- a/blocks/admin_tree/block_admin_tree.php +++ b/blocks/admin_tree/block_admin_tree.php @@ -103,7 +103,7 @@ class block_admin_tree extends block_base { } function get_content() { - global $CFG; + global $CFG, $OUTPUT; if ($this->content !== NULL) { return $this->content; @@ -135,7 +135,8 @@ class block_admin_tree extends block_base { if ($this->tempcontent !== '') { $this->page->requires->js('blocks/admin_tree/admintree.js'); $this->page->requires->js_function_call('admin_tree.init', - array($this->divcounter - 1, $this->expandnodes, $CFG->pixpath, + array($this->divcounter - 1, $this->expandnodes, + $OUTPUT->old_icon_url('i/open'), $OUTPUT->old_icon_url('i/closed'), get_string('folderopened'), get_string('folderclosed'))); $this->content = new object(); diff --git a/blocks/mnet_hosts/block_mnet_hosts.php b/blocks/mnet_hosts/block_mnet_hosts.php index b6e7c03842..884e7a42e6 100644 --- a/blocks/mnet_hosts/block_mnet_hosts.php +++ b/blocks/mnet_hosts/block_mnet_hosts.php @@ -19,7 +19,7 @@ class block_mnet_hosts extends block_list { } function get_content() { - global $CFG, $USER, $DB; + global $CFG, $USER, $DB, $OUTPUT; // only for logged in users! if (!isloggedin() || isguest()) { @@ -82,7 +82,7 @@ class block_mnet_hosts extends block_list { if ($hosts) { foreach ($hosts as $host) { - $icon = 'old_icon_url('i/'.$host->application.'_host') . '"'. ' class="icon" alt="'.get_string('server', 'block_mnet_hosts').'" />'; $this->content->icons[]=$icon; diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 2eff44e135..1ab1eae8bc 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -437,20 +437,20 @@ class block_base { // RTL support - exchange right and left arrows if (right_to_left()) { - $rightarrow = 'left.gif'; - $leftarrow = 'right.gif'; + $rightarrow = 't/left'; + $leftarrow = 't/right'; } else { - $rightarrow = 'right.gif'; - $leftarrow = 'left.gif'; + $rightarrow = 't/right'; + $leftarrow = 't/left'; } $movebuttons = '
'; if ($this->instance->visible) { - $icon = '/t/hide.gif'; + $icon = 't/hide'; $title = $this->str->hide; } else { - $icon = '/t/show.gif'; + $icon = 't/show'; $title = $this->str->show; } @@ -463,7 +463,7 @@ class block_base { // TODO MDL-19010 fix and re-enable. if (false && $this->user_can_edit()) { $movebuttons .= '' . - ''.$title.''; + ''.$title.''; } if ($options & BLOCK_CONFIGURE && $this->user_can_edit()) { @@ -478,7 +478,7 @@ class block_base { if ($options & BLOCK_MOVE_LEFT) { $movebuttons .= '' . - ''. $this->str->moveleft .''; + ''. $this->str->moveleft .''; } if ($options & BLOCK_MOVE_UP) { $movebuttons .= '' . @@ -490,7 +490,7 @@ class block_base { } if ($options & BLOCK_MOVE_RIGHT) { $movebuttons .= '' . - ''. $this->str->moveright .''; + ''. $this->str->moveright .''; } $movebuttons .= '
'; diff --git a/blocks/rss_client/block_rss_client_action.php b/blocks/rss_client/block_rss_client_action.php index 3f727dc8f5..2f05664cd8 100644 --- a/blocks/rss_client/block_rss_client_action.php +++ b/blocks/rss_client/block_rss_client_action.php @@ -270,7 +270,7 @@ if ($act == 'updfeed') { /// MDL-9291, blog this feature needs further discussion/implementation /// temporarily disabling for now. - // print ''. get_string('blogthis', 'blog').''."\n"; + // print ''. get_string('blogthis', 'blog').''."\n"; //print ''. get_string('blogthis', 'blog') .''."\n"; } else { print ' '; diff --git a/blog/lib.php b/blog/lib.php index 0541d191b0..c9db0f630a 100755 --- a/blog/lib.php +++ b/blog/lib.php @@ -281,10 +281,10 @@ $filename = $file->get_filename(); $ffurl = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.SYSCONTEXTID.'/blog/'.$blogentry->id.'/'.$filename); $type = $file->get_mimetype(); - $icon = mimeinfo_from_type("icon", $type); + $icon = str_replace(array('.gif', '.png'), '', mimeinfo_from_type("icon", $type)); $type = mimeinfo_from_type("type", $type); - $image = "pixpath/f/$icon\" class=\"icon\" alt=\"\" />"; + $image = "old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"\" />"; if ($return == "html") { $output .= "$image "; diff --git a/course/lib.php b/course/lib.php index 98897e95bb..b26d04bb37 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1459,7 +1459,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, } } if ($completionicon) { - $imgsrc = $CFG->pixpath.'/i/completion-'.$completionicon.'.gif'; + $imgsrc = $OUTPUT->old_icon_url('i/completion-'.$completionicon); $imgalt = get_string('completion-alt-'.$completionicon,'completion'); if ($completion==COMPLETION_TRACKING_MANUAL && !$isediting) { $imgtitle = get_string('completion-title-'.$completionicon,'completion'); @@ -2080,7 +2080,7 @@ function print_courses($category) { * @param string $highlightterms (optional) some search terms that should be highlighted in the display. */ function print_course($course, $highlightterms = '') { - global $CFG, $USER, $DB; + global $CFG, $USER, $DB, $OUTPUT; if (isset($course->context)) { $context = $course->context; @@ -2125,7 +2125,7 @@ function print_course($course, $highlightterms = '') { if ($ra->hidden == 0 || $canseehidden) { $fullname = fullname($ra->user, $canviewfullnames); if ($ra->hidden == 1) { - $status = " pixpath}/t/show.gif\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>"; + $status = " old_icon_url('t/show') . "\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>"; } else { $status = ''; } @@ -2831,23 +2831,23 @@ function make_editing_buttons($mod, $absolute=false, $moveselect=true, $indent=- if (has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $mod->course))) { if (right_to_left()) { // Exchange arrows on RTL - $rightarrow = 'left.gif'; - $leftarrow = 'right.gif'; + $rightarrow = 't/left.gif'; + $leftarrow = 't/right.gif'; } else { - $rightarrow = 'right.gif'; - $leftarrow = 'left.gif'; + $rightarrow = 't/right.gif'; + $leftarrow = 't/left.gif'; } if ($indent > 0) { $leftright .= ''."\n"; } if ($indent >= 0) { $leftright .= ''."\n"; } } diff --git a/course/report/progress/index.php b/course/report/progress/index.php index cc592383f9..6bbb2b6e6f 100644 --- a/course/report/progress/index.php +++ b/course/report/progress/index.php @@ -182,7 +182,7 @@ foreach($activities as $activity) { print ''. ''. - ''.
+            '<img src=mod_icon_url('icon', $activity->modname).'/icon.gif" alt="'. get_string('modulename',$activity->modname).'" /> '. format_string($activity->name).''; if($activity->completionexpected) { @@ -251,8 +251,8 @@ foreach($progress->users as $user) { print $sep.csv_quote($describe).$sep.csv_quote($date); } else { print ''. - ''.$describe.''; + ''.$describe.''; } } diff --git a/course/search.php b/course/search.php index 10a2b05e91..76f14a0dfc 100644 --- a/course/search.php +++ b/course/search.php @@ -247,12 +247,11 @@ echo "\n"; echo "\n"; - $pixpath = $CFG->pixpath; // checks whether user can update course settings if (has_capability('moodle/course:update', $coursecontext)) { echo "wwwroot/course/edit.php?id=$course->id\">\n\n "; + " src=\"" . $OUTPUT->old_icon_url('t/edit') . "\" class=\"iconsmall\" alt=\"".get_string("settings")."\" />\n "; } // checks whether user can do role assignment @@ -264,30 +263,30 @@ // checks whether user can delete course if (has_capability('moodle/course:delete', $coursecontext)) { echo "id\">\n\n "; + " src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"".get_string("delete")."\" />\n "; } // checks whether user can change visibility if (has_capability('moodle/course:visibility', $coursecontext)) { if (!empty($course->visible)) { echo "id&sesskey=".sesskey()."\">\n\n "; + " src=\"" . $OUTPUT->old_icon_url('t/hide') . "\" class=\"iconsmall\" alt=\"".get_string("hide")."\" />\n "; } else { echo "id&sesskey=".sesskey()."\">\n\n "; + " src=\"" . $OUTPUT->old_icon_url('t/show') . "\" class=\"iconsmall\" alt=\"".get_string("show")."\" />\n "; } } // checks whether user can do site backup if (has_capability('moodle/site:backup', $coursecontext)) { echo "id\">\n\n "; + " src=\"" . $OUTPUT->old_icon_url('t/backup') . "\" class=\"iconsmall\" alt=\"".get_string("backup")."\" />\n "; } // checks whether user can do restore if (has_capability('moodle/site:restore', $coursecontext)) { echo "id&wdir=/backupdata\">\n\n "; + " src=\"" . $OUTPUT->old_icon_url('t/restore') . "\" class=\"iconsmall\" alt=\"".get_string("restore")."\" />\n "; } echo "\n\n"; diff --git a/files/draftfiles.php b/files/draftfiles.php index 5af4f66cf2..5e46e23dd6 100644 --- a/files/draftfiles.php +++ b/files/draftfiles.php @@ -156,10 +156,10 @@ foreach ($files as $file) { } } else { - $icon = mimeinfo_from_type('icon', $mimetype); + $icon = str_replace(array('.gif', '.png'), '', mimeinfo_from_type('icon', $mimetype)); $viewurl = file_encode_url("$CFG->wwwroot/draftfile.php", "/$contextid/user_draft/$itemid".$filepath.$filename, false, false); echo '
'; - echo "pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" /> ".s($filename)." ($filesize) "; + echo "old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"$strfile\" /> ".s($filename)." ($filesize) "; echo "old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"$strdelete\" />";; echo '
'; } diff --git a/files/index.php b/files/index.php index 0ebb046dfb..1523d39a8e 100644 --- a/files/index.php +++ b/files/index.php @@ -295,7 +295,7 @@ function displaydir($file_info) { } else { - $icon = mimeinfo_from_type("icon", $mimetype); + $icon = str_replace(array('.gif', '.png'), '', mimeinfo_from_type("icon", $mimetype)); if ($downloadurl = $child_info->get_url(true)) { $downloadurl = " old_icon_url('t/down') . "\" class=\"iconsmall\" alt=\"$strdownload\" />"; } else { @@ -314,7 +314,7 @@ function displaydir($file_info) { echo ""; print_cell(); - print_cell("left", "pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" /> ".s($filename).$downloadurl.$viewurl, 'name'); + print_cell("left", "old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"$strfile\" /> ".s($filename).$downloadurl.$viewurl, 'name'); print_cell("right", $filesize, 'size'); print_cell("right", $filedate, 'date'); if ($parentwritable) { diff --git a/grade/lib.php b/grade/lib.php index eafc5bc888..decf3599fa 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -1586,8 +1586,7 @@ class grade_structure { '&eid='.$element['eid']; $url = $gpr->add_url_params($url); - $action = ''.s($strunlock).
+            $action  = '<a href='.s($strunlock).
                     ''; } else { @@ -1616,7 +1615,7 @@ class grade_structure { * @return string */ public function get_calculation_icon($element, $gpr) { - global $CFG; + global $CFG, $OUTPUT; if (!has_capability('moodle/grade:manage', $this->context)) { return ''; } @@ -1637,16 +1636,16 @@ class grade_structure { // show calculation icon only when calculation possible if (!$object->is_external_item() and ($is_scale or $is_value)) { if ($object->is_calculated()) { - $icon = 'calc.gif'; + $icon = 't/calc'; } else { - $icon = 'calc_off.gif'; + $icon = 't/calc_off'; } $url = $CFG->wwwroot.'/grade/edit/tree/calculation.php?courseid='. $this->courseid.'&id='.$object->id; $url = $gpr->add_url_params($url); $calculation_icon = '' . - '' .
+                        '<img src=old_icon_url($icon).'" class="iconsmall" alt="' . s($streditcalculation).'" title="'.s($streditcalculation).'" />'. "\n"; } }