]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19690 - more $CFG->pixpath to $OUTPUT->old_icon_url
authortjhunt <tjhunt>
Thu, 2 Jul 2009 10:26:02 +0000 (10:26 +0000)
committertjhunt <tjhunt>
Thu, 2 Jul 2009 10:26:02 +0000 (10:26 +0000)
admin/filters.php
admin/report/spamcleaner/index.php
admin/roles/lib.php
admin/roles/manage.php
grade/lib.php
grade/report/grader/lib.php
lib/weblib.php
mod/quiz/editlib.php

index 721dce8bcadff9704dec08be7a553d47622cafb8..1b82509041ae7125eac8d85dd45eace71f5f611f 100644 (file)
@@ -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) {
index 5d3ebb0c02d88df466d47483a657cf72100921bc..fa040efc350619f6377a46de6937cf64f85367fb 100755 (executable)
@@ -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) {
index 5aec111610a762c19f0332f283407c5ffdf0eea5..a67421f0d468ba471669bcd6bf7abc38d452caa0 100644 (file)
@@ -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);
index c016f30bab785e2e5fa290b1f03dbb65cbd6c021..a5cfc71e9112ad7ed58706b1e891666e78fb68cc 100755 (executable)
     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="" /> ';
 }
 ?>
index 3ab3bb2b21a8ad285cfc56321d2cf97f739c2726..c8cd25fdbf77f18b33fd3b0d23e89cbf1cf67d96 100644 (file)
@@ -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 {
index e08f2ec9c852e23c879c7b6be3a4a5207d46c3f2..e742f2fa198b0a3b7a2f0f3f5ec29246290fbba9 100644 (file)
@@ -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;
index 98c36c8f2d5d7ff45bf1c31ea93bd82f61342432..98028b0470b08252c33334a9fe23db280a8d2ae1 100644 (file)
@@ -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;
index c3a63daa5da36ffc9f87256fef82a1eb1118d903..45e0015c675e9bcb820546ae45a42dc578fa4601 100644 (file)
@@ -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" />';
 
 }