From e63f88c9a6ef41f8cc4ada5aa70c9bbc35db99c9 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 2 Jul 2009 12:07:58 +0000 Subject: [PATCH] MDL-19690 - lots more $CFG->pixpath to $OUTPUT->old_icon_url and $CFG->modpixpath to $OUTPUT->mod_icon_url --- admin/filters.php | 2 +- admin/generator.php | 2 -- admin/modules.php | 2 +- admin/qtypes.php | 6 ++--- admin/user/user_bulk_display.php | 2 +- admin/user/user_bulk_enrol.php | 2 +- .../block_activity_modules.php | 4 ++-- .../site_main_menu/block_site_main_menu.php | 12 +++++----- .../block_social_activities.php | 12 +++++----- calendar/lib.php | 4 ++-- course/lib.php | 14 +++++------ course/modedit.php | 2 +- course/recent.php | 2 +- course/report/outline/index.php | 2 +- course/user.php | 4 ++-- grade/lib.php | 4 ++-- grade/report/grader/lib.php | 4 ++-- lib/form/modgrade.php | 4 ++-- lib/formslib.php | 6 ++--- lib/weblib.php | 24 +++++++++---------- mod/assignment/lib.php | 4 ++-- mod/feedback/edit.php | 8 +++---- mod/feedback/lib.php | 4 ++-- mod/forum/lib.php | 4 ++-- mod/hotpot/lib.php | 4 ++-- mod/quiz/lib.php | 4 ++-- question/editlib.php | 4 ++-- search/query.php | 2 +- user/profile/index.php | 10 ++++---- 29 files changed, 78 insertions(+), 80 deletions(-) diff --git a/admin/filters.php b/admin/filters.php index 1b82509041ae7..4ca0de8dae369 100644 --- a/admin/filters.php +++ b/admin/filters.php @@ -253,7 +253,7 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings) // Re-order $updown = ''; - $spacer = ' '; + $spacer = ' '; if ($filterinfo->active != TEXTFILTER_DISABLED) { if (!$isfirstrow) { $updown .= action_icon(action_url($filter, 'up'), 'up', get_string('up')); diff --git a/admin/generator.php b/admin/generator.php index 0a9bbe95e46f2..5447148fd8191 100755 --- a/admin/generator.php +++ b/admin/generator.php @@ -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 @@ function get_data() { class generator_form extends moodleform { function definition() { global $generator, $CFG; - $CFG->pixpath = $CFG->wwwroot. '/pix'; $mform =& $this->_form; $mform->addElement('hidden', 'do_generation', 1); diff --git a/admin/modules.php b/admin/modules.php index 97646b5321643..2f125de65c530 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -210,7 +210,7 @@ foreach ($modulebyname as $modulename => $module) { // took out hspace="\10\", because it does not validate. don't know what to replace with. - $icon = "modpixpath/$module->name/icon.gif\" class=\"icon\" alt=\"\" />"; + $icon = "mod_icon_url('icon', $module->name) . "\" class=\"icon\" alt=\"\" />"; $delete = "name&sesskey=".sesskey()."\">$strdelete"; diff --git a/admin/qtypes.php b/admin/qtypes.php index f4aebc3f96b77..4cd107e1a1cc5 100644 --- a/admin/qtypes.php +++ b/admin/qtypes.php @@ -229,7 +229,7 @@ $rowclass = 'dimmed_text'; } } else { - $icons = ''; + $icons = ''; } // 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 = '
'; $html .= ''; $html .= ''; + '" src="' . $OUTPUT->old_icon_url($icon) . '" alt="' . $alt . '" ' . $tip . '/>'; $html .= '
'; return $html; } diff --git a/admin/user/user_bulk_display.php b/admin/user/user_bulk_display.php index 2adbc7ec21f81..79bcbf1ab3aa2 100755 --- a/admin/user/user_bulk_display.php +++ b/admin/user/user_bulk_display.php @@ -55,7 +55,7 @@ function sort_compare($a, $b) { $columndir = 'asc'; } else { $columndir = $dir == 'asc' ? 'desc' : 'asc'; - $columnicon = ' '; + $columnicon = ' '; } $table->head[] = ''.$strtitle.''.$columnicon; $table->align[] = 'left'; diff --git a/admin/user/user_bulk_enrol.php b/admin/user/user_bulk_enrol.php index 9db129c7ec97a..0bee217204e54 100644 --- a/admin/user/user_bulk_enrol.php +++ b/admin/user/user_bulk_enrol.php @@ -59,7 +59,7 @@ function sort_compare($a, $b) { $columndir = 'asc'; } else { $columndir = ($dir == 'asc') ? 'desc' : 'asc'; - $columnicon = ' '; + $columnicon = ' '; } $table->head[] = ''.$strtitle.''.$columnicon; $table->align[] = 'left'; diff --git a/blocks/activity_modules/block_activity_modules.php b/blocks/activity_modules/block_activity_modules.php index 0efc4a27f684d..85469902e870d 100644 --- a/blocks/activity_modules/block_activity_modules.php +++ b/blocks/activity_modules/block_activity_modules.php @@ -7,7 +7,7 @@ function init() { } function get_content() { - global $CFG, $DB; + global $CFG, $DB, $OUTPUT; if($this->content !== NULL) { return $this->content; @@ -37,7 +37,7 @@ function get_content() { foreach ($modfullnames as $modname => $modfullname) { if ($modname != 'label') { $this->content->items[] = ''.$modfullname.''; - $this->content->icons[] = ''; + $this->content->icons[] = ''; } } diff --git a/blocks/site_main_menu/block_site_main_menu.php b/blocks/site_main_menu/block_site_main_menu.php index 9c2068e09595e..7d61d211597c8 100644 --- a/blocks/site_main_menu/block_site_main_menu.php +++ b/blocks/site_main_menu/block_site_main_menu.php @@ -50,9 +50,9 @@ function get_content() { ' href="'.$CFG->wwwroot.'/mod/'.$cm->modname.'/view.php?id='.$cm->id.'">'.$instancename.''; //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[] = ''; } @@ -110,7 +110,7 @@ function get_content() { continue; } $this->content->items[] = ''. - ''.$strmovehere.''; + ''.$strmovehere.''; $this->content->icons[] = ''; } $instancename = $modinfo->cms[$modnumber]->name; @@ -122,9 +122,9 @@ function get_content() { $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 @@ function get_content() { if ($ismoving) { $this->content->items[] = ''. - ''.$strmovehere.''; + ''.$strmovehere.''; $this->content->icons[] = ''; } diff --git a/blocks/social_activities/block_social_activities.php b/blocks/social_activities/block_social_activities.php index aacb80f450ec1..789cea388e42a 100644 --- a/blocks/social_activities/block_social_activities.php +++ b/blocks/social_activities/block_social_activities.php @@ -52,9 +52,9 @@ function get_content() { ' href="'.$CFG->wwwroot.'/mod/'.$cm->modname.'/view.php?id='.$cm->id.'">'.$instancename.''; //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[] = ''; } @@ -119,7 +119,7 @@ function get_content() { continue; } $this->content->items[] = ''. - ''.$strmovehere.''; + ''.$strmovehere.''; $this->content->icons[] = ''; } $instancename = $modinfo->cms[$modnumber]->name; @@ -131,9 +131,9 @@ function get_content() { $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 @@ function get_content() { if ($ismoving) { $this->content->items[] = ''. - ''.$strmovehere.''; + ''.$strmovehere.''; $this->content->icons[] = ''; } diff --git a/calendar/lib.php b/calendar/lib.php index bc2e1294ef522..cd95bd69fa86d 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -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 = ''.$eventtype.''; $event->referer = ''.$event->name.''; diff --git a/course/lib.php b/course/lib.php index 75697a8130353..d193e7b903946 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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 ''. - ''.$strmovehere.'
'; } @@ -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 '
  • '. - ''.$strmovehere.'
  • '; } @@ -1925,20 +1925,20 @@ function print_category_info($category, $depth, $showcourses = false) { echo ''; echo ''.$strallowguests.''; } else { - echo ''; + echo ''; } if ($course->password) { echo ''; echo ''.$strrequireskey.''; } else { - echo ''; + echo ''; } if ($course->summary) { link_to_popup_window ('/course/info.php?id='.$course->id, 'courseinfo', ''.$strsummary.'', 400, 500, $strsummary); } else { - echo ''; + echo ''; } echo ''; } diff --git a/course/modedit.php b/course/modedit.php index f1a2d9b274a65..ff9c7fc964a6a 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -578,7 +578,7 @@ $currenttab = 'update'; require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php'); } - $icon = ''; + $icon = ''; print_heading_with_help($pageheading, 'mods', $module->name, $icon); $mform->display(); diff --git a/course/recent.php b/course/recent.php index 04a2bfbd10b57..99c71bbd3af4d 100644 --- a/course/recent.php +++ b/course/recent.php @@ -223,7 +223,7 @@ $name = format_string($cm->name); $modfullname = $modnames[$cm->modname]; - $image = "modpixpath/$cm->modname/icon.gif\" class=\"icon\" alt=\"$modfullname\" />"; + $image = "mod_icon_url('icon', $cm->modname) . "\" class=\"icon\" alt=\"$modfullname\" />"; echo "

    $image $modfullname". " wwwroot/mod/$cm->modname/view.php?id=$cm->id\" $linkformat>$name

    "; } diff --git a/course/report/outline/index.php b/course/report/outline/index.php index c058986c0b85c..26c9204994830 100644 --- a/course/report/outline/index.php +++ b/course/report/outline/index.php @@ -89,7 +89,7 @@ $dimmed = $cm->visible ? '' : 'class="dimmed"'; $modulename = get_string('modulename', $cm->modname); echo ''; - echo "modpixpath/$cm->modname/icon.gif\" class=\"icon\" alt=\"$modulename\" />"; + echo "mod_icon_url('icon', $cm->modname) . "\" class=\"icon\" alt=\"$modulename\" />"; echo "wwwroot/mod/$cm->modname/view.php?id=$cm->id\">".format_string($cm->name).""; echo ""; if (!empty($views[$cm->id]->numviews)) { diff --git a/course/user.php b/course/user.php index f4efe00c3d2e1..904e2b75b3ce9 100644 --- a/course/user.php +++ b/course/user.php @@ -334,9 +334,9 @@ function print_outline_row($mod, $instance, $result) { - global $CFG; + global $OUTPUT; - $image = "modpixpath/$mod->modname/icon.gif\" class=\"icon\" alt=\"$mod->modfullname\" />"; + $image = "mod_icon_url('icon', $mod->modname) . "\" class=\"icon\" alt=\"$mod->modfullname\" />"; echo ""; echo "$image"; diff --git a/grade/lib.php b/grade/lib.php index 6bdd550ddbfdd..e99944e4694d7 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -1268,8 +1268,8 @@ public function get_element_icon(&$element, $spacerifnone=false) { } else if ($element['object']->itemtype == 'mod') { $strmodname = get_string('modulename', $element['object']->itemmodule); - return '' .s($strmodname).''; diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index e742f2fa198b0..19b0588dda2dd 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -474,7 +474,7 @@ public function get_toggles_html() { * @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 @@ public function print_toggle($type, $return=false) { $string = ${'str' . $show_hide}; - $img = ''
+        $img = '<img src=old_icon_url($image_name).'" class="iconsmall" alt="' .$string.'" title="'.$string.'" />'. "\n"; $retval = '
    ' . $img . '" diff --git a/lib/form/modgrade.php b/lib/form/modgrade.php index fbf178921585c..7238b292d63bd 100644 --- a/lib/form/modgrade.php +++ b/lib/form/modgrade.php @@ -43,7 +43,7 @@ function MoodleQuickForm_modgrade($elementName=null, $elementLabel=null, $attrib */ 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 @@ function onQuickFormEvent($event, $arg, &$caller) $grades[$i] = $i; } $this->load($grades); - $linkobject = ''.$strscales.''; + $linkobject = ''.$strscales.''; $this->setHelpButton(array('/course/scales.php?id='. $COURSE->id .'&list=true', 'ratingscales', $linkobject, 400, 500, $strscales, 'none', true), 'link_to_popup_window'); return $result; diff --git a/lib/formslib.php b/lib/formslib.php index 06e5c0fc0b34e..1e76afb325562 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1088,9 +1088,9 @@ function MoodleQuickForm($formName, $method, $action, $target='', $attributes=nu }else { $this->updateAttributes(array('class'=>'mform')); } - $this->_reqHTML = ''.get_string('requiredelement', 'form').''; - $this->_advancedHTML = ''.get_string('advancedelement', 'form').''; - $this->setRequiredNote(get_string('somefieldsrequired', 'form', ''.get_string('requiredelement', 'form').'')); + $this->_reqHTML = ''.get_string('requiredelement', 'form').''; + $this->_advancedHTML = ''.get_string('advancedelement', 'form').''; + $this->setRequiredNote(get_string('somefieldsrequired', 'form', ''.get_string('requiredelement', 'form').'')); //(Help file doesn't add anything) helpbutton('requiredelement', get_string('requiredelement', 'form'), 'moodle', true, false, '', true)); } diff --git a/lib/weblib.php b/lib/weblib.php index f7c6c469e5f56..725db41761023 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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 .= '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[] = '
  • '. - ''. + ''. ''.$mod->name.'
  • '; } @@ -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 = ''.$strscales.''; + $linkobject = ''.$strscales.''; $output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&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 = ''.$strscales.''; + $linkobject = ''.$strscales.''; $output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&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 = ''.$scale->name.''; + $linkobject = ''.$scale->name.''; $output .= link_to_popup_window ('/course/scales.php?id='. $courseid .'&list=true&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 = ''.$alttag.''; + $linkobject = ''.$alttag.''; return link_to_popup_window(s('/lib/form/editorhelp.php?'.$paramstring), 'popup', $linkobject, 400, 500, $alttag, 'none', true); } diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index b569cbdabe9bf..4210bd3d87f37 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -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 ''; @@ -2776,7 +2776,7 @@ function assignment_print_recent_mod_activity($activity, $courseid, $detail, $mo if ($detail) { $modname = $modnames[$activity->type]; echo '
    '; - echo "modpixpath/assignment/icon.gif\" ". + echo "mod_icon_url('icon', 'assignment') . "\" ". "class=\"icon\" alt=\"$modname\">"; echo "wwwroot/mod/assignment/view.php?id={$activity->cmid}\">{$activity->name}"; echo '
    '; diff --git a/mod/feedback/edit.php b/mod/feedback/edit.php index b3ee402c05f06..30a1f4d556b2e 100644 --- a/mod/feedback/edit.php +++ b/mod/feedback/edit.php @@ -235,11 +235,11 @@ echo '
    '; $buttonlink = $ME.'?'.htmlspecialchars(feedback_edit_get_default_query($id, $do_show).'&movehere='.$moveposition); echo ' - '.get_string('move_here','feedback').' + '.get_string('move_here','feedback').' '; // echo '
    '; - // echo ''; + // echo ''; // echo ''; // feedback_edit_print_default_form_values($id, $do_show); // echo '
    '; @@ -377,10 +377,10 @@ echo '
    '; $buttonlink = $ME.'?'.htmlspecialchars(feedback_edit_get_default_query($id, $do_show).'&movehere='.$moveposition); echo ' - '.get_string('move_here','feedback').' + '.get_string('move_here','feedback').' '; // echo '
    '; - // echo ''; + // echo ''; // echo ''; // feedback_edit_print_default_form_values($id, $do_show); // echo '
    '; diff --git a/mod/feedback/lib.php b/mod/feedback/lib.php index 72511e19b86ff..f6ef6a332ed73 100644 --- a/mod/feedback/lib.php +++ b/mod/feedback/lib.php @@ -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 ''; @@ -336,7 +336,7 @@ function feedback_print_recent_mod_activity($activity, $courseid, $detail, $modn if ($detail) { $modname = $modnames[$activity->type]; echo '
    '; - echo "modpixpath/{$activity->type}/icon.gif\" ". + echo "mod_icon_url('icon', $activity->type) . "\" ". "class=\"icon\" alt=\"$modname\" />"; echo "wwwroot/mod/feedback/view.php?id={$activity->cmid}\">{$activity->name}"; echo '
    '; diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 71b41abd93a25..c719ac4f7d328 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -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 '
    '; @@ -828,7 +828,7 @@ function quiz_print_recent_mod_activity($activity, $courseid, $detail, $modnames if ($detail) { $modname = $modnames[$activity->type]; echo ''; diff --git a/question/editlib.php b/question/editlib.php index 194a32769930c..260c1db1e42cd 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -576,9 +576,9 @@ public function get_extra_classes() { } protected function print_icon($icon, $title, $url) { - global $CFG; + global $OUTPUT; echo ' - ' . $title . ''; + ' . $title . ''; } public function get_required_fields() { diff --git a/search/query.php b/search/query.php index 5da64bfdfc2fb..a477860f2f0a0 100644 --- a/search/query.php +++ b/search/query.php @@ -336,7 +336,7 @@ 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 = "\"\"/"; } $coursename = $DB->get_field('course', 'fullname', array('id' => $listing->courseid)); diff --git a/user/profile/index.php b/user/profile/index.php index a3bd68c058a57..9752d0c017e2f 100644 --- a/user/profile/index.php +++ b/user/profile/index.php @@ -178,21 +178,21 @@ function profile_category_icons ($category) { $editstr .= ''.$strdelete.' '; } else { - $editstr .= ' '; + $editstr .= ' '; } /// Move up if ($category->sortorder > 1) { $editstr .= ''.$strmoveup.' '; } else { - $editstr .= ' '; + $editstr .= ' '; } /// Move down if ($category->sortorder < $categorycount) { $editstr .= ''.$strmovedown.' '; } else { - $editstr .= ' '; + $editstr .= ' '; } return $editstr; @@ -227,14 +227,14 @@ function profile_field_icons($field) { if ($field->sortorder > 1) { $editstr .= ''.$strmoveup.' '; } else { - $editstr .= ' '; + $editstr .= ' '; } /// Move down if ($field->sortorder < $fieldcount) { $editstr .= ''.$strmovedown.' '; } else { - $editstr .= ' '; + $editstr .= ' '; } return $editstr;