From: tjhunt <tjhunt> Date: Thu, 2 Jul 2009 10:26:02 +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=5d3b9994689e086c340b55cff1e2fc2061006012;p=moodle.git MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url --- diff --git a/admin/filters.php b/admin/filters.php index 721dce8bca..1b82509041 100644 --- a/admin/filters.php +++ b/admin/filters.php @@ -232,7 +232,7 @@ function action_url($filterpath, $action) { function action_icon($url, $icon, $straction) { global $CFG; return '<a href="' . $url . '" title="' . $straction . '">' . - '<img src="' . $CFG->pixpath . '/t/' . $icon . '.gif" alt="' . $straction . '" /></a> '; + '<img src="' . $OUTPUT->old_icon_url('t/' . $icon) . '" alt="' . $straction . '" /></a> '; } function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings) { diff --git a/admin/report/spamcleaner/index.php b/admin/report/spamcleaner/index.php index 5d3ebb0c02..fa040efc35 100755 --- a/admin/report/spamcleaner/index.php +++ b/admin/report/spamcleaner/index.php @@ -215,7 +215,7 @@ function filter_user($user, $keywords, $count) { $user->description = '<h3>'.get_string('spamfromblog', 'report_spamcleaner').'</h3>'.$user->summary; unset($user->summary); } - if (preg_match('#<img.*src=[\"\']('.$CFG->pixpath.')#', $user->description, $matches) + if (preg_match('#<img.*src=[\"\']('.$CFG->wwwroot.')#', $user->description, $matches) && $image_search) { $result = false; foreach ($keywords as $keyword) { diff --git a/admin/roles/lib.php b/admin/roles/lib.php index 5aec111610..a67421f0d4 100644 --- a/admin/roles/lib.php +++ b/admin/roles/lib.php @@ -413,9 +413,9 @@ abstract class capability_table_with_risks extends capability_table_base { * get_all_risks array. Must start with 'risk'. */ function get_risk_icon($type) { - global $CFG; + global $OUTPUT; if (!isset($this->riskicons[$type])) { - $iconurl = $CFG->pixpath . '/i/' . str_replace('risk', 'risk_', $type) . '.gif'; + $iconurl = $OUTPUT->old_icon_url('i/' . str_replace('risk', 'risk_', $type)); $this->riskicons[$type] = link_to_popup_window($this->risksurl, 'docspopup', '<img src="' . $iconurl . '" alt="' . get_string($type . 'short', 'admin') . '" />', 0, 0, get_string($type, 'admin'), null, true); diff --git a/admin/roles/manage.php b/admin/roles/manage.php index c016f30bab..a5cfc71e91 100755 --- a/admin/roles/manage.php +++ b/admin/roles/manage.php @@ -266,12 +266,12 @@ die; function get_action_icon($url, $icon, $alt, $tooltip) { - global $CFG; + global $OUTPUT; return '<a title="' . $tooltip . '" href="'. $url . '">' . - '<img src="' . $CFG->pixpath . '/t/' . $icon . '.gif" class="iconsmall" alt="' . $alt . '" /></a> '; + '<img src="' . $OUTPUT->old_icon_url('t/' . $icon) . '" class="iconsmall" alt="' . $alt . '" /></a> '; } function get_spacer() { - global $CFG; - return '<img src="' . $CFG->pixpath . '/spacer.gif" class="iconsmall" alt="" /> '; + global $OUTPUT; + return '<img src="' . $OUTPUT->old_icon_url('spacer') . '" class="iconsmall" alt="" /> '; } ?> diff --git a/grade/lib.php b/grade/lib.php index 3ab3bb2b21..c8cd25fdbf 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -1501,7 +1501,7 @@ class grade_structure { * @return string */ public function get_hiding_icon($element, $gpr) { - global $CFG; + global $CFG, $OUTPUT; if (!has_capability('moodle/grade:manage', $this->context) and !has_capability('moodle/grade:hide', $this->context)) { @@ -1529,7 +1529,7 @@ class grade_structure { $url = $gpr->add_url_params($url); $action = '<a href="'.$url.'" class="hide"><img alt="'.s($strshow). - '" src="'.$CFG->pixpath.'/t/'.$icon.'.gif" ' . + '" src="'.$OUTPUT->old_icon_url('t/' . $icon) . '" ' . 'class="iconsmall" title="'.s($tooltip).'"/></a>'; } else { diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index e08f2ec9c8..e742f2fa19 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -1380,7 +1380,7 @@ class grade_report_grader extends grade_report { * @return string HTML */ protected function get_collapsing_icon($element) { - global $CFG; + global $OUTPUT; $contract_expand_icon = ''; // If object is a category, display expand/contract icon @@ -1398,7 +1398,7 @@ class grade_report_grader extends grade_report { $expand_contract = 'switch_whole'; } $url = $this->gpr->get_return_url(null, array('target'=>$element['eid'], 'action'=>$expand_contract, 'sesskey'=>sesskey())); - $contract_expand_icon = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/'.$expand_contract.'.gif" class="iconsmall" alt="' + $contract_expand_icon = '<a href="'.$url.'"><img src="'.$OUTPUT->old_icon_url('t/' . $expand_contract) . '" class="iconsmall" alt="' .${'str'.$expand_contract}.'" title="'.${'str'.$expand_contract}.'" /></a>'; } return $contract_expand_icon; diff --git a/lib/weblib.php b/lib/weblib.php index 98c36c8f2d..98028b0470 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2017,8 +2017,7 @@ function cleanAttributes2($htmlArray){ * @return string */ function replace_smilies(&$text) { - - global $CFG; + global $CFG, $OUTPUT; if (empty($CFG->emoticons)) { /// No emoticons defined, nothing to process here return; @@ -2048,7 +2047,7 @@ function replace_smilies(&$text) { $alttext = get_string($image, 'pix'); $alttext = preg_replace('/^\[\[(.*)\]\]$/', '$1', $alttext); /// Clean alttext in case there isn't lang string for it. $e[$lang][] = $emoticon; - $img[$lang][] = '<img alt="'. $alttext .'" width="15" height="15" src="'. $CFG->pixpath .'/s/'. $image .'.gif" />'; + $img[$lang][] = '<img alt="'. $alttext .'" width="15" height="15" src="'. $OUTPUT->old_icon_url('s/' . $image) . '" />'; } } @@ -5494,7 +5493,7 @@ function print_location_comment($file, $line, $return = false) * */ function print_arrow($direction='up', $strsort=null, $return=false) { - global $CFG; + global $OUTPUT; if (!in_array($direction, array('up', 'down', 'right', 'left', 'move'))) { return null; @@ -5523,7 +5522,7 @@ function print_arrow($direction='up', $strsort=null, $return=false) { $strsort = get_string('sort' . $sortdir, 'grades'); } - $return = ' <img src="'.$CFG->pixpath.'/t/' . $direction . '.gif" alt="'.$strsort.'" /> '; + $return = ' <img src="'.$OUTPUT->old_icon_url('t/' . $direction) . '" alt="'.$strsort.'" /> '; if ($return) { return $return; diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php index c3a63daa5d..45e0015c67 100644 --- a/mod/quiz/editlib.php +++ b/mod/quiz/editlib.php @@ -905,7 +905,7 @@ function quiz_print_randomquestion_reordertool(&$question, &$pageurl, &$quiz) { * @param $question the random question. */ function print_random_option_icon($question) { - global $CFG; + global $OUTPUT; if (!empty($question->questiontext)) { $icon = 'withsubcat'; $tooltip = get_string('randomwithsubcat', 'quiz'); @@ -913,7 +913,7 @@ function print_random_option_icon($question) { $icon = 'nosubcat'; $tooltip = get_string('randomnosubcat', 'quiz'); } - echo '<img src="' . $CFG->pixpath . '/i/' . $icon . '.png" alt="' . + echo '<img src="' . $OUTPUT->old_icon_url('i/' . $icon) . '" alt="' . $tooltip . '" title="' . $tooltip . '" class="uihint" />'; }