]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20787 renaming image_url() to pix_url() to be more consistent with the actual...
authorPetr Skoda <skodak@moodle.org>
Wed, 16 Dec 2009 20:33:37 +0000 (20:33 +0000)
committerPetr Skoda <skodak@moodle.org>
Wed, 16 Dec 2009 20:33:37 +0000 (20:33 +0000)
lib/outputlib.php
lib/outputrenderers.php
lib/simpletest/testoutputlib.php

index 0641ccd72a45ed993eccadd6dc9c7fcd3df9a765..292d5e414a6a53329635b2b08c6dbd8465d278f2 100644 (file)
@@ -720,7 +720,7 @@ class theme_config {
                 $replaced[$match[0]] = true;
                 $imagename = $match[2];
                 $component = rtrim($match[1], '|');
-                $css = str_replace($match[0], $this->image_url($imagename, $component)->out(false, array(), false), $css);
+                $css = str_replace($match[0], $this->pix_url($imagename, $component)->out(false, array(), false), $css);
             }
         }
 
@@ -740,7 +740,7 @@ class theme_config {
      * @param string $component, specification of one plugin like in get_string()
      * @return moodle_url
      */
-    public function image_url($imagename, $component) {
+    public function pix_url($imagename, $component) {
         global $CFG;
 
         $params = array('theme'=>$this->name, 'image'=>$imagename);
index c26c2d98786b3f3c7def08e1698fb9ebc8bfc9af..213d175f74f5b8a087b474e662e5b9d896729c52 100644 (file)
@@ -151,7 +151,7 @@ class renderer_base {
 
     /** OBSOLETED: to be removed soon */
     public function old_icon_url($iconname, $component='moodle', $escaped=true) {
-        $url = $this->page->theme->image_url($iconname, $component);
+        $url = $this->page->theme->pix_url($iconname, $component);
         return $url->out(false, array(), $escaped);
     }
 
@@ -162,8 +162,8 @@ class renderer_base {
      * @param string $component full plugin name
      * @return moodle_url
      */
-    public function image_url($imagename, $component='moodle') {
-        return $this->page->theme->image_url($imagename, $component);
+    public function pix_url($imagename, $component='moodle') {
+        return $this->page->theme->pix_url($imagename, $component);
     }
 
     /**
@@ -607,7 +607,7 @@ class core_renderer extends renderer_base {
         foreach ($controls as $control) {
             $controlshtml[] = $this->output_tag('a', array('class' => 'icon',
                     'title' => $control['caption'], 'href' => $control['url']),
-                    $this->output_empty_tag('img',  array('src' => $this->image_url($control['icon'])->out(false, array(), false),
+                    $this->output_empty_tag('img',  array('src' => $this->pix_url($control['icon'])->out(false, array(), false),
                     'alt' => $control['caption'])));
         }
         return $this->output_tag('div', array('class' => 'commands'), implode('', $controlshtml));
@@ -687,7 +687,7 @@ class core_renderer extends renderer_base {
             $plaintitle = strip_tags($bc->title);
             $this->page->requires->js_function_call('new block_hider', array($bc->id, $userpref,
                     get_string('hideblocka', 'access', $plaintitle), get_string('showblocka', 'access', $plaintitle),
-                    $this->image_url('t/switch_minus')->out(false, array(), false), $this->image_url('t/switch_plus')->out(false, array(), false)));
+                    $this->pix_url('t/switch_minus')->out(false, array(), false), $this->pix_url('t/switch_plus')->out(false, array(), false)));
         }
     }
 
@@ -945,7 +945,7 @@ class core_renderer extends renderer_base {
         if (!empty($iconpath)) {
             $icon->image->src = $iconpath;
         } else {
-            $icon->image->src = $this->image_url('docs')->out(false, array(), false);
+            $icon->image->src = $this->pix_url('docs')->out(false, array(), false);
         }
 
         if (!empty($CFG->doctonewwindow)) {
@@ -1072,7 +1072,7 @@ class core_renderer extends renderer_base {
         $image = clone($image);
 
         if (empty($image->src)) {
-            $image->src = $this->image_url('spacer')->out(false, array(), false);
+            $image->src = $this->pix_url('spacer')->out(false, array(), false);
         }
 
         $image->prepare();
index 19427acc3549db05bd88c9310001d41a3715fb28..725ce5169dcf284615e1cd448704a37db5551e7c 100644 (file)
@@ -789,7 +789,7 @@ class core_renderer_test extends UnitTestCase {
                  'alt' => ''
                  )), $html);
         $spacer = new html_image();
-        $spacer->src = $this->renderer->image_url('myspacer');
+        $spacer->src = $this->renderer->pix_url('myspacer');
         $spacer->alt = 'sometext';
         $spacer->add_class('my');
 
@@ -797,7 +797,7 @@ class core_renderer_test extends UnitTestCase {
 
         $this->assert(new ContainsTagWithAttributes('img', array(
                  'class' => 'my image spacer',
-                 'src' => $this->renderer->image_url('myspacer'),
+                 'src' => $this->renderer->pix_url('myspacer'),
                  'alt' => 'sometext')), $html);
 
     }
@@ -899,7 +899,7 @@ class core_renderer_test extends UnitTestCase {
         $this->assert(new ContainsTagWithAttribute('div', 'class', 'heading-with-help'), $html);
         $this->assert(new ContainsTagWithAttribute('span', 'class', 'helplink'), $html);
         $this->assert(new ContainsTagWithAttribute('h2', 'class', 'main help'), $html);
-        $this->assert(new ContainsTagWithAttributes('img', array('class' => 'iconhelp image', 'src' => $this->renderer->image_url('help'))), $html);
+        $this->assert(new ContainsTagWithAttributes('img', array('class' => 'iconhelp image', 'src' => $this->renderer->pix_url('help'))), $html);
         $this->assert(new ContainsTagWithContents('h2', 'Cool help text'), $html);
 
         $helpicon = clone($originalicon);
@@ -909,7 +909,7 @@ class core_renderer_test extends UnitTestCase {
         $this->assert(new ContainsTagWithAttribute('div', 'class', 'heading-with-help'), $html);
         $this->assert(new ContainsTagWithAttribute('span', 'class', 'helplink'), $html);
         $this->assert(new ContainsTagWithAttribute('h2', 'class', 'main help'), $html);
-        $this->assert(new ContainsTagWithAttributes('img', array('class' => 'iconhelp image', 'src' => $this->renderer->image_url('help'))), $html);
+        $this->assert(new ContainsTagWithAttributes('img', array('class' => 'iconhelp image', 'src' => $this->renderer->pix_url('help'))), $html);
         $this->assert(new ContainsTagWithContents('h2', 'Cool help text'), $html);
     }
 }