From 5d3b9994689e086c340b55cff1e2fc2061006012 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 2 Jul 2009 10:26:02 +0000 Subject: [PATCH] MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url --- admin/filters.php | 2 +- admin/report/spamcleaner/index.php | 2 +- admin/roles/lib.php | 4 ++-- admin/roles/manage.php | 8 ++++---- grade/lib.php | 4 ++-- grade/report/grader/lib.php | 4 ++-- lib/weblib.php | 9 ++++----- mod/quiz/editlib.php | 4 ++-- 8 files changed, 18 insertions(+), 19 deletions(-) diff --git a/admin/filters.php b/admin/filters.php index 721dce8bcad..1b82509041a 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 '' . - '' . $straction . ' '; + '' . $straction . ' '; } function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings) { diff --git a/admin/report/spamcleaner/index.php b/admin/report/spamcleaner/index.php index 5d3ebb0c02d..fa040efc350 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 = '

'.get_string('spamfromblog', 'report_spamcleaner').'

'.$user->summary; unset($user->summary); } - if (preg_match('#pixpath.')#', $user->description, $matches) + if (preg_match('#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 5aec111610a..a67421f0d46 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', '' . 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 c016f30bab7..a5cfc71e911 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 '' . - '' . $alt . ' '; + '' . $alt . ' '; } function get_spacer() { - global $CFG; - return ' '; + global $OUTPUT; + return ' '; } ?> diff --git a/grade/lib.php b/grade/lib.php index 3ab3bb2b21a..c8cd25fdbf7 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 = ''.s($strshow).
-                    ''; } else { diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index e08f2ec9c85..e742f2fa198 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 = ''
+            $contract_expand_icon = '<a href='
                                     .${'str'.$expand_contract}.''; } return $contract_expand_icon; diff --git a/lib/weblib.php b/lib/weblib.php index 98c36c8f2d5..98028b0470b 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][] = ''. $alttext .''; + $img[$lang][] = ''. $alttext .''; } } @@ -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 = ' '.$strsort.' '; + $return = ' '.$strsort.' '; if ($return) { return $return; diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php index c3a63daa5da..45e0015c675 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 '' .
+    echo '<img src=old_icon_url('i/' . $icon) . '" alt="' . $tooltip . '" title="' . $tooltip . '" class="uihint" />'; }