]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19690 - lots more $CFG->pixpath to $OUTPUT->old_icon_url
authortjhunt <tjhunt>
Thu, 2 Jul 2009 12:07:58 +0000 (12:07 +0000)
committertjhunt <tjhunt>
Thu, 2 Jul 2009 12:07:58 +0000 (12:07 +0000)
and $CFG->modpixpath to $OUTPUT->mod_icon_url

29 files changed:
admin/filters.php
admin/generator.php
admin/modules.php
admin/qtypes.php
admin/user/user_bulk_display.php
admin/user/user_bulk_enrol.php
blocks/activity_modules/block_activity_modules.php
blocks/site_main_menu/block_site_main_menu.php
blocks/social_activities/block_social_activities.php
calendar/lib.php
course/lib.php
course/modedit.php
course/recent.php
course/report/outline/index.php
course/user.php
grade/lib.php
grade/report/grader/lib.php
lib/form/modgrade.php
lib/formslib.php
lib/weblib.php
mod/assignment/lib.php
mod/feedback/edit.php
mod/feedback/lib.php
mod/forum/lib.php
mod/hotpot/lib.php
mod/quiz/lib.php
question/editlib.php
search/query.php
user/profile/index.php

index 1b82509041ae7125eac8d85dd45eace71f5f611f..4ca0de8dae36905c98c5d1304913cf7018975cd8 100644 (file)
@@ -253,7 +253,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
 
     // Re-order
     $updown = '';
-    $spacer = '<img src="' . $CFG->pixpath . '/spacer.gif" class="iconsmall" alt="" /> ';
+    $spacer = '<img src="' . $OUTPUT->old_icon_url('spacer') . '" class="iconsmall" alt="" /> ';
     if ($filterinfo->active != TEXTFILTER_DISABLED) {
         if (!$isfirstrow) {
             $updown .= action_icon(action_url($filter, 'up'), 'up', get_string('up'));
index 0a9bbe95e46f235785172a19640f1c4d0ea888eb..5447148fd81918947aecb80f5be7a4c52a7de920 100755 (executable)
@@ -1184,7 +1184,6 @@ class generator_web extends generator {
 
     public function setup() {
         global $CFG;
-        $CFG->pixpath = $CFG->wwwroot. '/pix';
         $this->mform = new generator_form();
 
         $this->do_generation = optional_param('do_generation', false, PARAM_BOOL);
@@ -1249,7 +1248,6 @@ class fake_form {
 class generator_form extends moodleform {
     function definition() {
         global $generator, $CFG;
-        $CFG->pixpath = $CFG->wwwroot. '/pix';
 
         $mform =& $this->_form;
         $mform->addElement('hidden', 'do_generation', 1);
index 97646b5321643ff22c737a71425f6c213647f1ee..2f125de65c530c9a7432df9ed6417c71777010f4 100644 (file)
     foreach ($modulebyname as $modulename => $module) {
 
         // took out hspace="\10\", because it does not validate. don't know what to replace with.
-        $icon = "<img src=\"$CFG->modpixpath/$module->name/icon.gif\" class=\"icon\" alt=\"\" />";
+        $icon = "<img src=\"" . $OUTPUT->mod_icon_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />";
 
         $delete = "<a href=\"modules.php?delete=$module->name&amp;sesskey=".sesskey()."\">$strdelete</a>";
 
index f4aebc3f96b77cf6ee60d57181751d7d9de26487..4cd107e1a1cc51cb4df935dba0824276311c597a 100644 (file)
                 $rowclass = 'dimmed_text';
             }
         } else {
-            $icons = '<img src="' . $CFG->pixpath . '/spacer.gif" alt="" class="spacer" />';
+            $icons = '<img src="' . $OUTPUT->old_icon_url('spacer') . '" alt="" class="spacer" />';
         }
 
         // Move icons.
@@ -275,14 +275,14 @@ function enable_disable_button($qtypename, $createable) {
 }
 
 function icon_html($action, $qtypename, $icon, $alt, $tip) {
-    global $CFG;
+    global $OUTPUT;
     if ($tip) {
         $tip = 'title="' . $tip . '" ';
     }
     $html = ' <form action="' . admin_url('qtypes.php') . '" method="post"><div>';
     $html .= '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
     $html .= '<input type="image" name="' . $action . '" value="' . $qtypename .
-            '" src="' . $CFG->pixpath . '/' . $icon . '" alt="' . $alt . '" ' . $tip . '/>';
+            '" src="' . $OUTPUT->old_icon_url($icon) . '" alt="' . $alt . '" ' . $tip . '/>';
     $html .= '</div></form>';
     return $html;
 }
index 2adbc7ec21f81051880bf25d44cdc1965e42ced1..79bcbf1ab3aa2053154266f2658013d93b3eb886 100755 (executable)
@@ -55,7 +55,7 @@ foreach ($columns as $column) {
         $columndir = 'asc';
     } else {
         $columndir = $dir == 'asc' ? 'desc' : 'asc';
-        $columnicon = ' <img src="'.$CFG->pixpath.'/t/'.($dir == 'asc' ? 'down' : 'up' ).'.gif" alt="" />';
+        $columnicon = ' <img src="'.$OUTPUT->old_icon_url('t/'.($dir == 'asc' ? 'down' : 'up' )).'f" alt="" />';
     }
     $table->head[] = '<a href="user_bulk_display.php?sort='.$column.'&amp;dir='.$columndir.'">'.$strtitle.'</a>'.$columnicon;
     $table->align[] = 'left';
index 9db129c7ec97adbf25ce5dfb68ce6b73686471ce..0bee217204e549a57a0719cb815e5296874fb358 100644 (file)
@@ -59,7 +59,7 @@ foreach ($columns as $column) {
         $columndir = 'asc';
     } else {
         $columndir = ($dir == 'asc') ? 'desc' : 'asc';
-        $columnicon = ' <img src="'.$CFG->pixpath.'/t/'.($dir == 'asc' ? 'down' : 'up' ).'.gif" alt="" />';
+        $columnicon = ' <img src="'.$OUTPUT->old_icon_url('t/'.($dir == 'asc' ? 'down' : 'up' )).'" alt="" />';
     }
     $table->head[] = '<a href="user_bulk_enrol.php?sort='.$column.'&amp;dir='.$columndir.'">'.$strtitle.'</a>'.$columnicon;
     $table->align[] = 'left';
index 0efc4a27f684d65c2c42f3203ad4fa12de049508..85469902e870dd986d3dd25e0676079435b8799f 100644 (file)
@@ -7,7 +7,7 @@ class block_activity_modules extends block_list {
     }
 
     function get_content() {
-        global $CFG, $DB;
+        global $CFG, $DB, $OUTPUT;
 
         if($this->content !== NULL) {
             return $this->content;
@@ -37,7 +37,7 @@ class block_activity_modules extends block_list {
         foreach ($modfullnames as $modname => $modfullname) {
             if ($modname != 'label') {
                 $this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$course->id.'">'.$modfullname.'</a>';
-                $this->content->icons[] = '<img src="'.$CFG->modpixpath.'/'.$modname.'/icon.gif" class="icon" alt="" />';
+                $this->content->icons[] = '<img src="'.$OUTPUT->mod_icon_url('icon', $modname) . '" class="icon" alt="" />';
             }
         }
 
index 9c2068e09595e2f74cef99693be36a9db841e15d..7d61d211597c8f0ee5f9bf1b92c92cddcbb131bd 100644 (file)
@@ -50,9 +50,9 @@ class block_site_main_menu extends block_list {
                             ' href="'.$CFG->wwwroot.'/mod/'.$cm->modname.'/view.php?id='.$cm->id.'">'.$instancename.'</a>';
                         //Accessibility: incidental image - should be empty Alt text
                         if (!empty($cm->icon)) {
-                            $icon = $CFG->pixpath.'/'.$cm->icon;
+                            $icon = $OUTPUT->old_icon_url($cm->icon);
                         } else {
-                            $icon = $CFG->modpixpath.'/'.$cm->modname.'/icon.gif';
+                            $icon = $OUTPUT->mod_icon_url('icon', $cm->modname);
                         }
                         $this->content->icons[] = '<img src="'.$icon.'" class="icon" alt="" />';
                     }
@@ -110,7 +110,7 @@ class block_site_main_menu extends block_list {
                             continue;
                         }
                         $this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
-                            '<img style="height:16px; width:80px; border:0px" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" /></a>';
+                            '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->old_icon_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
                         $this->content->icons[] = '';
                     }
                     $instancename = $modinfo->cms[$modnumber]->name;
@@ -122,9 +122,9 @@ class block_site_main_menu extends block_list {
                         $extra = '';
                     }
                     if (!empty($modinfo->cms[$modnumber]->icon)) {
-                        $icon = $CFG->pixpath.'/'.$modinfo->cms[$modnumber]->icon;
+                        $icon = $OUTPUT->old_icon_url($modinfo->cms[$modnumber]->icon);
                     } else {
-                        $icon = $CFG->modpixpath.'/'.$mod->modname.'/icon.gif';
+                        $icon = $OUTPUT->mod_icon_url('icon', $mod->modname);
                     }
 
                     if ($mod->modname == 'label') {
@@ -142,7 +142,7 @@ class block_site_main_menu extends block_list {
 
         if ($ismoving) {
             $this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
-                                      '<img style="height:16px; width:80px; border:0px" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" /></a>';
+                                      '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->old_icon_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
             $this->content->icons[] = '';
         }
 
index aacb80f450ec1e1fe96cc2d483d9ec6773689662..789cea388e42a7ac9ad6f02d91c3b745ac8467ba 100644 (file)
@@ -52,9 +52,9 @@ class block_social_activities extends block_list {
                             ' href="'.$CFG->wwwroot.'/mod/'.$cm->modname.'/view.php?id='.$cm->id.'">'.$instancename.'</a>';
                         //Accessibility: incidental image - should be empty Alt text
                         if (!empty($cm->icon)) {
-                            $icon = $CFG->pixpath.'/'.$cm->icon;
+                            $icon = $OUTPUT->old_icon_url($cm->icon);
                         } else {
-                            $icon = $CFG->modpixpath.'/'.$cm->modname.'/icon.gif';
+                            $icon = $OUTPUT->mod_icon_url('icon', $cm->modname);
                         }
                         $this->content->icons[] = '<img src="'.$icon.'" class="icon" alt="" />';
                     }
@@ -119,7 +119,7 @@ class block_social_activities extends block_list {
                             continue;
                         }
                         $this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
-                            '<img style="height:16px; width:80px; border:0px" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" /></a>';
+                            '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->old_icon_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
                         $this->content->icons[] = '';
                     }
                     $instancename = $modinfo->cms[$modnumber]->name;
@@ -131,9 +131,9 @@ class block_social_activities extends block_list {
                         $extra = '';
                     }
                     if (!empty($modinfo->cms[$modnumber]->icon)) {
-                        $icon = $CFG->pixpath.'/'.$modinfo->cms[$modnumber]->icon;
+                        $icon = $OUTPUT->old_icon_url($modinfo->cms[$modnumber]->icon);
                     } else {
-                        $icon = $CFG->modpixpath.'/'.$mod->modname.'/icon.gif';
+                        $icon = $OUTPUT->mod_icon_url('icon', $mod->modname);
                     }
 
                     if ($mod->modname == 'label') {
@@ -151,7 +151,7 @@ class block_social_activities extends block_list {
 
         if ($ismoving) {
             $this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
-                                      '<img style="height:16px; width:80px; border:0px" src="'.$CFG->pixpath.'/movehere.gif" alt="'.$strmovehere.'" /></a>';
+                                      '<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->old_icon_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
             $this->content->icons[] = '';
         }
 
index bc2e1294ef52266842eaec35e4ca9c788e7c38f5..cd95bd69fa86d17e9a4d5b47f6b48c6fd517853f 100644 (file)
@@ -232,7 +232,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
                 }
                 $event = $events[$eventid];
                 if(!empty($event->modulename)) {
-                    $popupicon = $CFG->modpixpath.'/'.$event->modulename.'/icon.gif';
+                    $popupicon = $OUTPUT->mod_icon_url('icon', $event->modulename) . '';
                     $popupalt  = $event->modulename;
 
                 } else if ($event->courseid == SITEID) {                                // Site event
@@ -484,7 +484,7 @@ function calendar_add_event_metadata($event) {
 
         $modulename = get_string('modulename', $event->modulename);
         $eventtype = get_string($event->eventtype, $event->modulename);
-        $icon = $CFG->modpixpath.'/'.$event->modulename.'/icon.gif';
+        $icon = $OUTPUT->mod_icon_url('icon', $event->modulename) . '';
 
         $event->icon = '<img height="16" width="16" src="'.$icon.'" alt="'.$eventtype.'" title="'.$modulename.'" style="vertical-align: middle;" />';
         $event->referer = '<a href="'.$CFG->wwwroot.'/mod/'.$event->modulename.'/view.php?id='.$module->id.'">'.$event->name.'</a>';
index 75697a8130353df685437de730f23fdf68c0230d..d193e7b90394600d3e08f792816b516c8c69d3bb 100644 (file)
@@ -1184,7 +1184,7 @@ function set_section_visible($courseid, $sectionnumber, $visibility) {
  * Prints a section full of activity modules
  */
 function print_section($course, $section, $mods, $modnamesused, $absolute=false, $width="100%", $hidecompletion=false) {
-    global $CFG, $USER, $DB, $PAGE;
+    global $CFG, $USER, $DB, $PAGE, $OUTPUT;
 
     static $initialised;
 
@@ -1296,7 +1296,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
             if ($ismoving) {
                 echo '<a title="'.$strmovefull.'"'.
                      ' href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
-                     '<img class="movetarget" src="'.$CFG->pixpath.'/movehere.gif" '.
+                     '<img class="movetarget" src="'.$OUTPUT->old_icon_url('movehere') . '" '.
                      ' alt="'.$strmovehere.'" /></a><br />
                      ';
             }
@@ -1337,7 +1337,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
                         $icon = "$CFG->pixpath/".$customicon;
                     }
                 } else {
-                    $icon = "$CFG->modpixpath/$mod->modname/icon.gif";
+                    $icon = "" . $OUTPUT->mod_icon_url('icon', $mod->modname) . "";
                 }
 
                 //Accessibility: for files get description via icon.
@@ -1518,7 +1518,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
     if ($ismoving) {
         echo '<li><a title="'.$strmovefull.'"'.
              ' href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
-             '<img class="movetarget" src="'.$CFG->pixpath.'/movehere.gif" '.
+             '<img class="movetarget" src="'.$OUTPUT->old_icon_url('movehere') . '" '.
              ' alt="'.$strmovehere.'" /></a></li>
              ';
     }
@@ -1925,20 +1925,20 @@ function print_category_info($category, $depth, $showcourses = false) {
                     echo '<a title="'.$strallowguests.'" href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">';
                     echo '<img alt="'.$strallowguests.'" src="'.$OUTPUT->old_icon_url('i/guest') . '" /></a>';
                 } else {
-                    echo '<img alt="" style="width:18px;height:16px;" src="'.$CFG->pixpath.'/spacer.gif" />';
+                    echo '<img alt="" style="width:18px;height:16px;" src="'.$OUTPUT->old_icon_url('spacer') . '" />';
                 }
                 if ($course->password) {
                     echo '<a title="'.$strrequireskey.'" href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">';
                     echo '<img alt="'.$strrequireskey.'" src="'.$OUTPUT->old_icon_url('i/key') . '" /></a>';
                 } else {
-                    echo '<img alt="" style="width:18px;height:16px;" src="'.$CFG->pixpath.'/spacer.gif" />';
+                    echo '<img alt="" style="width:18px;height:16px;" src="'.$OUTPUT->old_icon_url('spacer') . '" />';
                 }
                 if ($course->summary) {
                     link_to_popup_window ('/course/info.php?id='.$course->id, 'courseinfo',
                                           '<img alt="'.$strsummary.'" src="'.$OUTPUT->old_icon_url('i/info') . '" />',
                                            400, 500, $strsummary);
                 } else {
-                    echo '<img alt="" style="width:18px;height:16px;" src="'.$CFG->pixpath.'/spacer.gif" />';
+                    echo '<img alt="" style="width:18px;height:16px;" src="'.$OUTPUT->old_icon_url('spacer') . '" />';
                 }
                 echo '</td></tr>';
             }
index f1a2d9b274a65b8140326b030b4862cbf2fbbaf8..ff9c7fc964a6a66f43464d6c51bb84c19c8b16a0 100644 (file)
             $currenttab = 'update';
             require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
         }
-        $icon = '<img src="'.$CFG->modpixpath.'/'.$module->name.'/icon.gif" alt=""/>';
+        $icon = '<img src="'.$OUTPUT->mod_icon_url('icon', $module->name) . '" alt=""/>';
 
         print_heading_with_help($pageheading, 'mods', $module->name, $icon);
         $mform->display();
index 04a2bfbd10b57d5d99fb56f8f27e0aee8888b0bc..99c71bbd3af4d91424c0450db1564d00454ec066 100644 (file)
                     $name        = format_string($cm->name);
                     $modfullname = $modnames[$cm->modname];
 
-                    $image = "<img src=\"$CFG->modpixpath/$cm->modname/icon.gif\" class=\"icon\" alt=\"$modfullname\" />";
+                    $image = "<img src=\"" . $OUTPUT->mod_icon_url('icon', $cm->modname) . "\" class=\"icon\" alt=\"$modfullname\" />";
                     echo "<h4>$image $modfullname".
                          " <a href=\"$CFG->wwwroot/mod/$cm->modname/view.php?id=$cm->id\" $linkformat>$name</a></h4>";
                }
index c058986c0b85c6d1e59de38a8c2d05a80031747a..26c9204994830f9176bf077a7ff8990d3a6192f0 100644 (file)
@@ -89,7 +89,7 @@
             $dimmed = $cm->visible ? '' : 'class="dimmed"';
             $modulename = get_string('modulename', $cm->modname);
             echo '<tr class="r'.$ri++.'">';
-            echo "<td class=\"cell c0 actvity\"><img src=\"$CFG->modpixpath/$cm->modname/icon.gif\" class=\"icon\" alt=\"$modulename\" />";
+            echo "<td class=\"cell c0 actvity\"><img src=\"" . $OUTPUT->mod_icon_url('icon', $cm->modname) . "\" class=\"icon\" alt=\"$modulename\" />";
             echo "<a $dimmed title=\"$modulename\" href=\"$CFG->wwwroot/mod/$cm->modname/view.php?id=$cm->id\">".format_string($cm->name)."</a></td>";
             echo "<td class=\"cell c1 numviews\">";
             if (!empty($views[$cm->id]->numviews)) {
index f4efe00c3d2e1040f18e96a6d248af4639748c60..904e2b75b3ce9525ca4924c6867129a5d5a73d62 100644 (file)
 
 
 function print_outline_row($mod, $instance, $result) {
-    global $CFG;
+    global $OUTPUT;
 
-    $image = "<img src=\"$CFG->modpixpath/$mod->modname/icon.gif\" class=\"icon\" alt=\"$mod->modfullname\" />";
+    $image = "<img src=\"" . $OUTPUT->mod_icon_url('icon', $mod->modname) . "\" class=\"icon\" alt=\"$mod->modfullname\" />";
 
     echo "<tr>";
     echo "<td valign=\"top\">$image</td>";
index 6bdd550ddbfdd279946997ff93bd0fa8a3e131fd..e99944e4694d73605e43fd8206903c1124e05c22 100644 (file)
@@ -1268,8 +1268,8 @@ class grade_structure {
 
                 } else if ($element['object']->itemtype == 'mod') {
                     $strmodname = get_string('modulename', $element['object']->itemmodule);
-                    return '<img src="'.$CFG->modpixpath.'/'.
-                            $element['object']->itemmodule.'/icon.gif" ' .
+                    return '<img src="'.$OUTPUT->mod_icon_url('icon', 
+                            $element['object']->itemmodule) . '" ' .
                             'class="icon itemicon" title="' .s($strmodname).
                             '" alt="' .s($strmodname).'"/>';
 
index e742f2fa198b0a3b7a2f0f3f5ec29246290fbba9..19b0588dda2dd5c9f711d59a036041d1b28cd997 100644 (file)
@@ -474,7 +474,7 @@ class grade_report_grader extends grade_report {
     * @return void
     */
     public function print_toggle($type, $return=false) {
-        global $CFG;
+        global $CFG, $OUTPUT;
 
         $icons = array('eyecons' => 't/hide.gif',
                        'calculations' => 't/calc.gif',
@@ -510,7 +510,7 @@ class grade_report_grader extends grade_report {
 
         $string = ${'str' . $show_hide};
 
-        $img = '<img src="'.$CFG->pixpath.'/'.$image_name.'" class="iconsmall" alt="'
+        $img = '<img src="'.$OUTPUT->old_icon_url($image_name).'" class="iconsmall" alt="'
                       .$string.'" title="'.$string.'" />'. "\n";
 
         $retval = '<div class="gradertoggle">' . $img . '<a href="' . $this->baseurl . "&amp;toggle=$toggle_action&amp;toggle_type=$type\">"
index fbf178921585cb0d165fa625479021c1d80e8705..7238b292d63bd90e594b8ff780e41c3bb500596a 100644 (file)
@@ -43,7 +43,7 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_select{
      */
     function onQuickFormEvent($event, $arg, &$caller)
     {
-        global $COURSE, $CFG;
+        global $COURSE, $CFG, $OUTPUT;
         switch ($event) {
             case 'createElement':
                 // Need to call superclass first because we want the constructor
@@ -62,7 +62,7 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_select{
                     $grades[$i] = $i;
                 }
                 $this->load($grades);
-                $linkobject = '<span class="helplink"><img height="17" width="17" alt="'.$strscales.'" src="'.$CFG->pixpath .'/help.gif" /></span>';
+                $linkobject = '<span class="helplink"><img height="17" width="17" alt="'.$strscales.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
                 $this->setHelpButton(array('/course/scales.php?id='. $COURSE->id .'&amp;list=true', 'ratingscales',
                                      $linkobject, 400, 500, $strscales, 'none', true), 'link_to_popup_window');
                 return $result;
index 06e5c0fc0b34e9fa6a3061ba0d5c74861f7eab2b..1e76afb325562a32125f174d1f4d52afbb22ea70 100644 (file)
@@ -1088,9 +1088,9 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
         }else {
             $this->updateAttributes(array('class'=>'mform'));
         }
-        $this->_reqHTML = '<img class="req" title="'.get_string('requiredelement', 'form').'" alt="'.get_string('requiredelement', 'form').'" src="'.$CFG->pixpath.'/req.gif'.'" />';
-        $this->_advancedHTML = '<img class="adv" title="'.get_string('advancedelement', 'form').'" alt="'.get_string('advancedelement', 'form').'" src="'.$CFG->pixpath.'/adv.gif'.'" />';
-        $this->setRequiredNote(get_string('somefieldsrequired', 'form', '<img alt="'.get_string('requiredelement', 'form').'" src="'.$CFG->pixpath.'/req.gif'.'" />'));
+        $this->_reqHTML = '<img class="req" title="'.get_string('requiredelement', 'form').'" alt="'.get_string('requiredelement', 'form').'" src="'.$OUTPUT->old_icon_url('req') .'" />';
+        $this->_advancedHTML = '<img class="adv" title="'.get_string('advancedelement', 'form').'" alt="'.get_string('advancedelement', 'form').'" src="'.$OUTPUT->old_icon_url('adv') .'" />';
+        $this->setRequiredNote(get_string('somefieldsrequired', 'form', '<img alt="'.get_string('requiredelement', 'form').'" src="'.$OUTPUT->old_icon_url('req') .'" />'));
         //(Help file doesn't add anything) helpbutton('requiredelement', get_string('requiredelement', 'form'), 'moodle', true, false, '', true));
     }
 
index f7c6c469e5f5627a26a0c5a18173d72df05f76a0..725db41761023a7cae3a43906868cc0421d01f7e 100644 (file)
@@ -3568,7 +3568,7 @@ function print_group_picture($group, $courseid, $large=false, $return=false, $li
  * @return string|bool Depending on $return
  */
 function print_png($url, $sizex, $sizey, $return, $parameters='alt=""') {
-    global $CFG;
+    global $OUTPUT;
     static $recentIE;
 
     if (!isset($recentIE)) {
@@ -3576,7 +3576,7 @@ function print_png($url, $sizex, $sizey, $return, $parameters='alt=""') {
     }
 
     if ($recentIE) {  // work around the HORRIBLE bug IE has with alpha transparencies
-        $output .= '<img src="'. $CFG->pixpath .'/spacer.gif" width="'. $sizex .'" height="'. $sizey .'"'.
+        $output .= '<img src="'. $OUTPUT->old_icon_url('spacer') . '" width="'. $sizex .'" height="'. $sizey .'"'.
                    ' class="png" style="width: '. $sizex .'px; height: '. $sizey .'px; '.
                    ' filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.
                    "'$url', sizingMethod='scale') ".
@@ -4192,7 +4192,7 @@ function navmenu($course, $cm=NULL, $targetwindow='self') {
         }
         $menu[$url] = $localname;
         if (empty($THEME->navmenuiconshide)) {
-            $menustyle[$url] = 'style="background-image: url('.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif);"';  // Unfortunately necessary to do this here
+            $menustyle[$url] = 'style="background-image: url('.$OUTPUT->mod_icon_url('icon', $mod->modname) . ');"';  // Unfortunately necessary to do this here
         }
         $previousmod = $mod;
     }
@@ -4318,7 +4318,7 @@ function navmenulist($course, $sections, $modinfo, $strsection, $strjumpto, $wid
         $class = 'activity '.$mod->modname;
         $class .= ($cmid == $mod->id) ? ' selected' : '';
         $menu[] = '<li class="'.$class.'">'.
-                  '<img src="'.$CFG->modpixpath.'/'.$mod->modname.'/icon.gif" alt="" />'.
+                  '<img src="'.$OUTPUT->mod_icon_url('icon', $mod->modname) . '" alt="" />'.
                   '<a href="'.$CFG->wwwroot.'/mod/'.$url.'">'.$mod->name.'</a></li>';
     }
 
@@ -4465,7 +4465,7 @@ function print_timer_selector($timelimit = 0, $unit = '', $name = 'timelimit', $
  */
 function print_grade_menu($courseid, $name, $current, $includenograde=true, $return=false) {
 
-    global $CFG;
+    global $CFG, $OUTPUT;
 
     $output = '';
     $strscale = get_string('scale');
@@ -4483,7 +4483,7 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
     }
     $output .= choose_from_menu($grades, $name, $current, '', '', 0, true);
 
-    $linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$CFG->pixpath .'/help.gif" /></span>';
+    $linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
     $output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&amp;list=true', 'ratingscales',
                                      $linkobject, 400, 500, $strscales, 'none', true);
 
@@ -4507,13 +4507,13 @@ function print_grade_menu($courseid, $name, $current, $includenograde=true, $ret
  */
 function print_scale_menu($courseid, $name, $current, $return=false) {
 
-    global $CFG;
+    global $CFG, $OUTPUT;
 
     $output = '';
     $strscales = get_string('scales');
     $output .= choose_from_menu(get_scales_menu($courseid), $name, $current, '', '', 0, true);
 
-    $linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$CFG->pixpath .'/help.gif" /></span>';
+    $linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$strscales.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
     $output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&amp;list=true', 'ratingscales',
                                      $linkobject, 400, 500, $strscales, 'none', true);
     if ($return) {
@@ -4534,12 +4534,12 @@ function print_scale_menu($courseid, $name, $current, $return=false) {
  */
 function print_scale_menu_helpbutton($courseid, $scale, $return=false) {
 
-    global $CFG;
+    global $OUTPUT;
 
     $output = '';
     $strscales = get_string('scales');
 
-    $linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$scale->name.'" src="'.$CFG->pixpath .'/help.gif" /></span>';
+    $linkobject = '<span class="helplink"><img class="iconhelp" alt="'.$scale->name.'" src="'.$OUTPUT->old_icon_url('help') . '" /></span>';
     $output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&amp;list=true&amp;scaleid='. $scale->id, 'ratingscale',
                                      $linkobject, 400, 500, $scale->name, 'none', true);
     if ($return) {
@@ -4576,7 +4576,7 @@ function mdie($msg='', $errorcode=1) {
  * @return string Link to help button
  */
 function editorhelpbutton(){
-    global $CFG, $SESSION;
+    global $CFG, $SESSION, $OUTPUT;
     $items = func_get_args();
     $i = 1;
     $urlparams = array();
@@ -4627,7 +4627,7 @@ function editorhelpbutton(){
     $alttag = join (', ', $titles);
 
     $paramstring = join('&', $urlparams);
-    $linkobject = '<img alt="'.$alttag.'" class="iconhelp" src="'.$CFG->pixpath .'/help.gif" />';
+    $linkobject = '<img alt="'.$alttag.'" class="iconhelp" src="'.$OUTPUT->old_icon_url('help') . '" />';
     return link_to_popup_window(s('/lib/form/editorhelp.php?'.$paramstring), 'popup', $linkobject, 400, 500, $alttag, 'none', true);
 }
 
index b569cbdabe9bfe5339eab994b2410d592f5fd346..4210bd3d87f3780fa32a40fbb99a084f15e8cd90 100644 (file)
@@ -2765,7 +2765,7 @@ function assignment_get_recent_mod_activity(&$activities, &$index, $timestart, $
  * This is used by course/recent.php
  */
 function assignment_print_recent_mod_activity($activity, $courseid, $detail, $modnames)  {
-    global $CFG;
+    global $CFG, $OUTPUT;
 
     echo '<table border="0" cellpadding="3" cellspacing="0" class="assignment-recent">';
 
@@ -2776,7 +2776,7 @@ function assignment_print_recent_mod_activity($activity, $courseid, $detail, $mo
     if ($detail) {
         $modname = $modnames[$activity->type];
         echo '<div class="title">';
-        echo "<img src=\"$CFG->modpixpath/assignment/icon.gif\" ".
+        echo "<img src=\"" . $OUTPUT->mod_icon_url('icon', 'assignment') . "\" ".
              "class=\"icon\" alt=\"$modname\">";
         echo "<a href=\"$CFG->wwwroot/mod/assignment/view.php?id={$activity->cmid}\">{$activity->name}</a>";
         echo '</div>';
index b3ee402c05f062a1785598e22b0190271c04d64b..30a1f4d556b2ee0b61294c3e36262956026b1e7a 100644 (file)
                     echo '<td>';
                     $buttonlink = $ME.'?'.htmlspecialchars(feedback_edit_get_default_query($id, $do_show).'&movehere='.$moveposition);
                     echo '<a title="'.get_string('move_here','feedback').'" href="'.$buttonlink.'">
-                            <img class="movetarget" alt="'.get_string('move_here','feedback').'" src="'.$CFG->pixpath .'/movehere.gif" />
+                            <img class="movetarget" alt="'.get_string('move_here','feedback').'" src="'.$OUTPUT->old_icon_url('movehere') . '" />
                           </a>';
 
                         // echo '<form action="'.$ME.'" method="post"><fieldset>';
-                        // echo '<input title="'.get_string('move_here','feedback').'" type="image" src="'.$CFG->pixpath .'/movehere.gif" hspace="1" height="16" width="80" border="0" />';
+                        // echo '<input title="'.get_string('move_here','feedback').'" type="image" src="'.$OUTPUT->old_icon_url('movehere') . '" hspace="1" height="16" width="80" border="0" />';
                         // echo '<input type="hidden" name="movehere" value="'.$moveposition.'" />';
                         // feedback_edit_print_default_form_values($id, $do_show);
                         // echo '</fieldset></form>';
                         echo '<td>';
                             $buttonlink = $ME.'?'.htmlspecialchars(feedback_edit_get_default_query($id, $do_show).'&movehere='.$moveposition);
                             echo '<a title="'.get_string('move_here','feedback').'" href="'.$buttonlink.'">
-                                    <img class="movetarget" alt="'.get_string('move_here','feedback').'" src="'.$CFG->pixpath .'/movehere.gif" />
+                                    <img class="movetarget" alt="'.get_string('move_here','feedback').'" src="'.$OUTPUT->old_icon_url('movehere') . '" />
                                   </a>';
                             // echo '<form action="'.$ME.'" method="post"><fieldset>';
-                            // echo '<input class="feedback_movehere_button" title="'.get_string('move_here','feedback').'" type="image" src="'.$CFG->pixpath .'/movehere.gif" />';
+                            // echo '<input class="feedback_movehere_button" title="'.get_string('move_here','feedback').'" type="image" src="'.$OUTPUT->old_icon_url('movehere') . '" />';
                             // echo '<input type="hidden" name="movehere" value="'.$moveposition.'" />';
                             // feedback_edit_print_default_form_values($id, $do_show);
                             // echo '</fieldset></form>';
index 72511e19b86ff99e49cfc185ac989e6a85cd5819..f6ef6a332ed7309eac6f26c0d552e1810b7453e6 100644 (file)
@@ -325,7 +325,7 @@ function feedback_get_recent_mod_activity(&$activities, &$index, $timemodified,
  * @return void Output is echo'd
  */
 function feedback_print_recent_mod_activity($activity, $courseid, $detail, $modnames) {
-    global $CFG;
+    global $CFG, $OUTPUT;
 
     echo '<table border="0" cellpadding="3" cellspacing="0" class="forum-recent">';
 
@@ -336,7 +336,7 @@ function feedback_print_recent_mod_activity($activity, $courseid, $detail, $modn
     if ($detail) {
         $modname = $modnames[$activity->type];
         echo '<div class="title">';
-        echo "<img src=\"$CFG->modpixpath/{$activity->type}/icon.gif\" ".
+        echo "<img src=\"" . $OUTPUT->mod_icon_url('icon', $activity->type) . "\" ".
              "class=\"icon\" alt=\"$modname\" />";
         echo "<a href=\"$CFG->wwwroot/mod/feedback/view.php?id={$activity->cmid}\">{$activity->name}</a>";
         echo '</div>';
index 71b41abd93a25f301fdcffc926ecd3490645f1d2..c719ac4f7d328d3b6330d3f0a5e211831aa57c17 100644 (file)
@@ -6103,7 +6103,7 @@ function forum_get_recent_mod_activity(&$activities, &$index, $timestart, $cours
  * @global object
  */
 function forum_print_recent_mod_activity($activity, $courseid, $detail, $modnames, $viewfullnames) {
-    global $CFG;
+    global $CFG, $OUTPUT;
 
     if ($activity->content->parent) {
         $class = 'reply';
@@ -6120,7 +6120,7 @@ function forum_print_recent_mod_activity($activity, $courseid, $detail, $modname
     echo '<div class="title">';
     if ($detail) {
         $aname = s($activity->name);
-        echo "<img src=\"$CFG->modpixpath/$activity->type/icon.gif\" ".
+        echo "<img src=\"" . $OUTPUT->mod_icon_url('icon', $activity->type) . "\" ".
              "class=\"icon\" alt=\"{$aname}\" />";
     }
     echo "<a href=\"$CFG->wwwroot/mod/forum/discuss.php?d={$activity->content->discussion}"
index e881757a1b3162333ce9f4655cfeb3c063d4ff75..78b195f8f6f2af12a95e7b2b1fd9d1c1863fb0d4 100644 (file)
@@ -1251,7 +1251,7 @@ function hotpot_get_recent_mod_activity(&$activities, &$index, $sincetime, $cour
  */
 function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
 
-    global $CFG, $THEME, $USER;
+    global $CFG, $THEME, $USER, $OUTPUT;
 
     if (isset($THEME->cellcontent2)) {
         $bgcolor =  ' bgcolor="'.$THEME->cellcontent2.'"';
@@ -1267,7 +1267,7 @@ function hotpot_print_recent_mod_activity($activity, $course, $detail=false) {
 
     if ($detail) {
         // activity icon
-        $src = "$CFG->modpixpath/$activity->type/icon.gif";
+        $src = "" . $OUTPUT->mod_icon_url('icon', $activity->type) . "";
         print '<img src="'.$src.'" class="icon" alt="'.$activity->type.'" /> ';
 
         // link to activity
index d4fa9c22a81f72509699979e2fd6d69f15ff3320..19beb956b410196cd15dcf57e28896bb1c176ee2 100644 (file)
@@ -817,7 +817,7 @@ function quiz_get_recent_mod_activity(&$activities, &$index, $timestart, $course
  * @return void output is echo'd
  */
 function quiz_print_recent_mod_activity($activity, $courseid, $detail, $modnames) {
-    global $CFG;
+    global $CFG, $OUTPUT;
 
     echo '<table border="0" cellpadding="3" cellspacing="0" class="forum-recent">';
 
@@ -828,7 +828,7 @@ function quiz_print_recent_mod_activity($activity, $courseid, $detail, $modnames
     if ($detail) {
         $modname = $modnames[$activity->type];
         echo '<div class="title">';
-        echo "<img src=\"$CFG->modpixpath/{$activity->type}/icon.gif\" ".
+        echo "<img src=\"" . $OUTPUT->mod_icon_url('icon', $activity->type) . "\" ".
              "class=\"icon\" alt=\"$modname\" />";
         echo "<a href=\"$CFG->wwwroot/mod/quiz/view.php?id={$activity->cmid}\">{$activity->name}</a>";
         echo '</div>';
index 194a32769930c949e22532c07a6bbeaa11e4d21e..260c1db1e42cdeaeb158aa29d86fb97ba6e0db00 100644 (file)
@@ -576,9 +576,9 @@ abstract class question_bank_action_column_base extends question_bank_column_bas
     }
 
     protected function print_icon($icon, $title, $url) {
-        global $CFG;
+        global $OUTPUT;
         echo '<a title="' . $title . '" href="' . $url . '">
-                <img src="' . $CFG->pixpath . '/' . $icon . '" class="iconsmall" alt="' . $title . '" /></a>';
+                <img src="' . $OUTPUT->old_icon_url($icon) . '" class="iconsmall" alt="' . $title . '" /></a>';
     }
 
     public function get_required_fields() {
index 5da64bfdfc2fb4449cfc080bb77d5417e1f8d78b..a477860f2f0a0b5c16a1adf4d11a7f00340c75bc 100644 (file)
                 if ($listing->doctype == 'user'){ // A special handle for users                    
                     $icon = print_user_picture ($listing->userid, 0, true, 0, true, false) ;
                 } else {
-                    $iconpath = $CFG->modpixpath.'/'.$listing->doctype.'/icon.gif';
+                    $iconpath = $OUTPUT->mod_icon_url('icon', $listing->doctype);
                     $icon = "<img align=\"top\" src=\"".$iconpath."\" class=\"activityicon\" alt=\"\"/>";
                 }
                $coursename = $DB->get_field('course', 'fullname', array('id' => $listing->courseid));
index a3bd68c058a57b566f1a4f91a93c3d68140b46df..9752d0c017e2fae6623f13dd0168eb18b6a6d8e1 100644 (file)
@@ -178,21 +178,21 @@ function profile_category_icons ($category) {
         $editstr .= '<a title="'.$strdelete.'" href="index.php?id='.$category->id.'&amp;action=deletecategory';
         $editstr .= '"><img src="'.$OUTPUT->old_icon_url('t/delete') . '" alt="'.$strdelete.'" class="iconsmall" /></a> ';
     } else {
-        $editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
+        $editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
     }
 
     /// Move up
     if ($category->sortorder > 1) {
         $editstr .= '<a title="'.$strmoveup.'" href="index.php?id='.$category->id.'&amp;action=movecategory&amp;dir=up&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->old_icon_url('t/up') . '" alt="'.$strmoveup.'" class="iconsmall" /></a> ';
     } else {
-        $editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
+        $editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
     }
 
     /// Move down
     if ($category->sortorder < $categorycount) {
         $editstr .= '<a title="'.$strmovedown.'" href="index.php?id='.$category->id.'&amp;action=movecategory&amp;dir=down&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->old_icon_url('t/down') . '" alt="'.$strmovedown.'" class="iconsmall" /></a> ';
     } else {
-        $editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
+        $editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
     }
 
     return $editstr;
@@ -227,14 +227,14 @@ function profile_field_icons($field) {
     if ($field->sortorder > 1) {
         $editstr .= '<a title="'.$strmoveup.'" href="index.php?id='.$field->id.'&amp;action=movefield&amp;dir=up&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->old_icon_url('t/up') . '" alt="'.$strmoveup.'" class="iconsmall" /></a> ';
      } else {
-        $editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
+        $editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
     }
 
     /// Move down
     if ($field->sortorder < $fieldcount) {
         $editstr .= '<a title="'.$strmovedown.'" href="index.php?id='.$field->id.'&amp;action=movefield&amp;dir=down&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->old_icon_url('t/down') . '" alt="'.$strmovedown.'" class="iconsmall" /></a> ';
     } else {
-        $editstr .= '<img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="iconsmall" /> ';
+        $editstr .= '<img src="'.$OUTPUT->old_icon_url('spacer') . '" alt="" class="iconsmall" /> ';
     }
 
     return $editstr;