]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url
authortjhunt <tjhunt>
Fri, 3 Jul 2009 04:23:05 +0000 (04:23 +0000)
committertjhunt <tjhunt>
Fri, 3 Jul 2009 04:23:05 +0000 (04:23 +0000)
12 files changed:
blocks/admin_tree/admintree.js
blocks/admin_tree/block_admin_tree.php
blocks/mnet_hosts/block_mnet_hosts.php
blocks/moodleblock.class.php
blocks/rss_client/block_rss_client_action.php
blog/lib.php
course/lib.php
course/report/progress/index.php
course/search.php
files/draftfiles.php
files/index.php
grade/lib.php

index 7acc422f7abb349621c65b9b6158bfdde9f6c5a6..f2660967828eac23976326921ef2839b18e79e1f 100644 (file)
@@ -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.
index c6aee6266ee10f6ea042d57d460e0d9cdda720bd..fe3ad37936e3865e1cdb2e60d533f235b33b842c 100644 (file)
@@ -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();
index b6e7c038429fd3d6ce081ea34c691dbec29dc6c2..884e7a42e64df8d3ea436ddc134d6506712e6a04 100644 (file)
@@ -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  = '<img src="'.$CFG->pixpath.'/i/'.$host->application.'_host.gif"'.
+            $icon  = '<img src="'.$OUTPUT->old_icon_url('i/'.$host->application.'_host') . '"'.
                 ' class="icon" alt="'.get_string('server', 'block_mnet_hosts').'" />';
 
                 $this->content->icons[]=$icon;
index 2eff44e1353caa7d5cf9222e6dfb1d56542f2821..1ab1eae8bc47acbddc2b4d2eaa6114d16ae38d63 100644 (file)
@@ -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 = '<div class="commands">';
 
         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 .= '<a class="icon hide" title="'. $title .'" href="'.$script.'&amp;blockaction=toggle">' .
-                            '<img src="'. $CFG->pixpath.$icon .'" alt="'.$title.'" /></a>';
+                            '<img src="'. $OUTPUT->old_icon_url($icon) .'" alt="'.$title.'" /></a>';
         }
 
         if ($options & BLOCK_CONFIGURE && $this->user_can_edit()) {
@@ -478,7 +478,7 @@ class block_base {
 
         if ($options & BLOCK_MOVE_LEFT) {
             $movebuttons .= '<a class="icon left" title="'. $this->str->moveleft .'" href="'.$script.'&amp;blockaction=moveleft">' .
-                            '<img src="'. $CFG->pixpath .'/t/'.$leftarrow.'" alt="'. $this->str->moveleft .'" /></a>';
+                            '<img src="'. $OUTPUT->old_icon_url($leftarrow).'" alt="'. $this->str->moveleft .'" /></a>';
         }
         if ($options & BLOCK_MOVE_UP) {
             $movebuttons .= '<a class="icon up" title="'. $this->str->moveup .'" href="'.$script.'&amp;blockaction=moveup">' .
@@ -490,7 +490,7 @@ class block_base {
         }
         if ($options & BLOCK_MOVE_RIGHT) {
             $movebuttons .= '<a class="icon right" title="'. $this->str->moveright .'" href="'.$script.'&amp;blockaction=moveright">' .
-                            '<img src="'. $CFG->pixpath .'/t/'.$rightarrow.'" alt="'. $this->str->moveright .'" /></a>';
+                            '<img src="'. $OUTPUT->old_icon_url($rightarrow).'" alt="'. $this->str->moveright .'" /></a>';
         }
 
         $movebuttons .= '</div>';
index 3f727dc8f5608cdd37ef8e6857f75834001009bb..2f05664cd8871c755bbbf489b479a18102aa2fd4 100644 (file)
@@ -270,7 +270,7 @@ if ($act == 'updfeed') {
                 /// MDL-9291, blog this feature needs further discussion/implementation
                 /// temporarily disabling for now.
 
-                // print '<img src="'. $CFG->pixpath .'/blog/blog.gif" alt="'. get_string('blogthis', 'blog').'" title="'. get_string('blogthis', 'blog') .'" border="0" align="middle" />'."\n";
+                // print '<img src="'. $OUTPUT->old_icon_url('blog/blog') . '" alt="'. get_string('blogthis', 'blog').'" title="'. get_string('blogthis', 'blog') .'" border="0" align="middle" />'."\n";
                 //print '<a href="'. $CFG->wwwroot .'/blog/blogthis.php?userid='. $USER->id .'&act=use&item='. $y .'&rssid='. $rssid .'"><small><strong>'. get_string('blogthis', 'blog') .'</strong></small></a>'."\n";
             } else {
                 print '<td>&nbsp;';
index 0541d191b0e66446fed1626d2e412f23106c463d..c9db0f630af67be7d8dcc86abf72eabafe2a8850 100755 (executable)
             $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 = "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"\" />";
+            $image = "<img src=\"" . $OUTPUT->old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"\" />";
 
             if ($return == "html") {
                 $output .= "<a href=\"$ffurl\">$image</a> ";
index 98897e95bbe7f663966a39d07d03a69e1f30995a..b26d04bb3789f86e74b9a0203ff613e35f5538f7 100644 (file)
@@ -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 = " <img src=\"{$CFG->pixpath}/t/show.gif\" title=\"".get_string('userhashiddenassignments', 'role')."\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>";
+                            $status = " <img src=\"" . $OUTPUT->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 .= '<a class="editing_moveleft" title="'.$str->moveleft.'" href="'.$path.'/mod.php?id='.$mod->id.
                         '&amp;indent=-1&amp;sesskey='.$sesskey.$section.'"><img'.
-                        ' src="'.$CFG->pixpath.'/t/'.$leftarrow.'" class="iconsmall" '.
+                        ' src="'.$OUTPUT->old_icon_url($leftarrow).'" class="iconsmall" '.
                         ' alt="'.$str->moveleft.'" /></a>'."\n";
         }
         if ($indent >= 0) {
             $leftright .= '<a class="editing_moveright" title="'.$str->moveright.'" href="'.$path.'/mod.php?id='.$mod->id.
                         '&amp;indent=1&amp;sesskey='.$sesskey.$section.'"><img'.
-                        ' src="'.$CFG->pixpath.'/t/'.$rightarrow.'" class="iconsmall" '.
+                        ' src="'.$OUTPUT->old_icon_url($rightarrow).'" class="iconsmall" '.
                         ' alt="'.$str->moveright.'" /></a>'."\n";
         }
     }
index cc592383f9e20f582e0414bc3fedc97c5835bdfc..6bbb2b6e6f4a71dd4baf5c88105b221e1ca5e7dc 100644 (file)
@@ -182,7 +182,7 @@ foreach($activities as $activity) {
         print '<th scope="col" class="'.$activity->datepassedclass.'">'.
             '<a href="'.$CFG->wwwroot.'/mod/'.$activity->modname.
             '/view.php?id='.$activity->id.'">'.
-            '<img src="'.$CFG->pixpath.'/mod/'.$activity->modname.'/icon.gif" alt="'.
+            '<img src="'.$OUTPUT->mod_icon_url('icon', $activity->modname).'/icon.gif" alt="'.
             get_string('modulename',$activity->modname).'" /> <span class="completion-activityname">'.
             format_string($activity->name).'</span></a>';
         if($activity->completionexpected) {
@@ -251,8 +251,8 @@ foreach($progress->users as $user) {
             print $sep.csv_quote($describe).$sep.csv_quote($date);
         } else {
             print '<td class="completion-progresscell '.$activity->datepassedclass.'">'.
-                '<img src="'.$CFG->pixpath.'/i/'.$completionicon.
-                '.gif" alt="'.$describe.'" title="'.$fulldescribe.'" /></td>';
+                '<img src="'.$OUTPUT->old_icon_url('i/'.$completionicon).
+                '" alt="'.$describe.'" title="'.$fulldescribe.'" /></td>';
         }
     }
 
index 10a2b05e91a7984f245247df74a488767ee17492..76f14a0dfc3ab1da06c85a0f8d8a11878ad369af 100644 (file)
 
                 echo "</td>\n";
                 echo "<td>\n";
-                $pixpath = $CFG->pixpath;
 
                 // checks whether user can update course settings
                 if (has_capability('moodle/course:update', $coursecontext)) {
                     echo "<a title=\"".get_string("settings")."\" href=\"$CFG->wwwroot/course/edit.php?id=$course->id\">\n<img".
-                        " src=\"$pixpath/t/edit.gif\" class=\"iconsmall\" alt=\"".get_string("settings")."\" /></a>\n ";
+                        " src=\"" . $OUTPUT->old_icon_url('t/edit') . "\" class=\"iconsmall\" alt=\"".get_string("settings")."\" /></a>\n ";
                 }
 
                 // checks whether user can do role assignment
                 // checks whether user can delete course
                 if (has_capability('moodle/course:delete', $coursecontext)) {
                     echo "<a title=\"".get_string("delete")."\" href=\"delete.php?id=$course->id\">\n<img".
-                        " src=\"$pixpath/t/delete.gif\" class=\"iconsmall\" alt=\"".get_string("delete")."\" /></a>\n ";
+                        " src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"".get_string("delete")."\" /></a>\n ";
                 }
 
                 // checks whether user can change visibility
                 if (has_capability('moodle/course:visibility', $coursecontext)) {
                     if (!empty($course->visible)) {
                         echo "<a title=\"".get_string("hide")."\" href=\"search.php?search=$encodedsearch&amp;perpage=$perpage&amp;page=$page&amp;hide=$course->id&amp;sesskey=".sesskey()."\">\n<img".
-                            " src=\"$pixpath/t/hide.gif\" class=\"iconsmall\" alt=\"".get_string("hide")."\" /></a>\n ";
+                            " src=\"" . $OUTPUT->old_icon_url('t/hide') . "\" class=\"iconsmall\" alt=\"".get_string("hide")."\" /></a>\n ";
                     } else {
                         echo "<a title=\"".get_string("show")."\" href=\"search.php?search=$encodedsearch&amp;perpage=$perpage&amp;page=$page&amp;show=$course->id&amp;sesskey=".sesskey()."\">\n<img".
-                            " src=\"$pixpath/t/show.gif\" class=\"iconsmall\" alt=\"".get_string("show")."\" /></a>\n ";
+                            " src=\"" . $OUTPUT->old_icon_url('t/show') . "\" class=\"iconsmall\" alt=\"".get_string("show")."\" /></a>\n ";
                     }
                 }
 
                 // checks whether user can do site backup
                 if (has_capability('moodle/site:backup', $coursecontext)) {
                     echo "<a title=\"".get_string("backup")."\" href=\"../backup/backup.php?id=$course->id\">\n<img".
-                        " src=\"$pixpath/t/backup.gif\" class=\"iconsmall\" alt=\"".get_string("backup")."\" /></a>\n ";
+                        " src=\"" . $OUTPUT->old_icon_url('t/backup') . "\" class=\"iconsmall\" alt=\"".get_string("backup")."\" /></a>\n ";
                 }
 
                 // checks whether user can do restore
                 if (has_capability('moodle/site:restore', $coursecontext)) {
                     echo "<a title=\"".get_string("restore")."\" href=\"../files/index.php?id=$course->id&amp;wdir=/backupdata\">\n<img".
-                        " src=\"$pixpath/t/restore.gif\" class=\"iconsmall\" alt=\"".get_string("restore")."\" /></a>\n ";
+                        " src=\"" . $OUTPUT->old_icon_url('t/restore') . "\" class=\"iconsmall\" alt=\"".get_string("restore")."\" /></a>\n ";
                 }
 
                 echo "</td>\n</tr>\n";
index 5af4f66cf24da56607b445e55b75ec1d3bf0e30d..5e46e23dd621065e2b0f3b3183f25c1fa681693d 100644 (file)
@@ -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 '<div class="file">';
-        echo "<a href=\"$viewurl\"><img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" />&nbsp;".s($filename)." ($filesize)</a> ";
+        echo "<a href=\"$viewurl\"><img src=\"" . $OUTPUT->old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"$strfile\" />&nbsp;".s($filename)." ($filesize)</a> ";
         echo "<a href=\"draftfiles.php?itemid=$itemid&amp;filepath=$filepath&amp;delete=$filenameurl&amp;subdirs=$subdirs&amp;maxbytes=$maxbytes\"><img src=\"" . $OUTPUT->old_icon_url('t/delete') . "\" class=\"iconsmall\" alt=\"$strdelete\" /></a>";;
         echo '</div>';
     }
index 0ebb046dfb25ce08736aa5dfd2cdefa07c359f3c..1523d39a8e47232856169d59c670d171db980af4 100644 (file)
@@ -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 = "&nbsp;<a href=\"$downloadurl\" title=\"" . get_string('downloadfile') . "\"><img src=\"" . $OUTPUT->old_icon_url('t/down') . "\" class=\"iconsmall\" alt=\"$strdownload\" /></a>";
                 } else {
@@ -314,7 +314,7 @@ function displaydir($file_info) {
 
                 echo "<tr class=\"file\">";
                 print_cell();
-                print_cell("left", "<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" />&nbsp;".s($filename).$downloadurl.$viewurl, 'name');
+                print_cell("left", "<img src=\"" . $OUTPUT->old_icon_url('f/' . $icon) . "\" class=\"icon\" alt=\"$strfile\" />&nbsp;".s($filename).$downloadurl.$viewurl, 'name');
                 print_cell("right", $filesize, 'size');
                 print_cell("right", $filedate, 'date');
                 if ($parentwritable) {
index eafc5bc888a8f1cd7cb4add1d98f6c0ebf9297b4..decf3599faacbe52e9a2086e53ac71e50ffc7922 100644 (file)
@@ -1586,8 +1586,7 @@ class grade_structure {
                     '&amp;eid='.$element['eid'];
 
             $url     = $gpr->add_url_params($url);
-            $action  = '<a href="'.$url.'" class="lock"><img src="'.$CFG->pixpath.
-                    '/t/'.$icon.'.gif" alt="'.s($strunlock).
+            $action  = '<a href="'.$url.'" class="lock"><img src="'.$OUTPUT->old_icon_url('t/'.$icon).'" alt="'.s($strunlock).
                     '" class="iconsmall" title="'.s($tooltip).'"/></a>';
 
         } 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.'&amp;id='.$object->id;
                 $url = $gpr->add_url_params($url);
                 $calculation_icon = '<a href="'. $url.'" class="calculation">' .
-                        '<img src="'.$CFG->pixpath.'/t/'.$icon.'" class="iconsmall" alt="' .
+                        '<img src="'.$OUTPUT->old_icon_url($icon).'" class="iconsmall" alt="' .
                         s($streditcalculation).'" title="'.s($streditcalculation).'" /></a>'. "\n";
             }
         }