From c39e5ba20f458e3613be56e52077510f1c221884 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 16 Dec 2009 20:33:37 +0000 Subject: [PATCH] MDL-20787 renaming image_url() to pix_url() to be more consistent with the actual image location ;-) --- lib/outputlib.php | 4 ++-- lib/outputrenderers.php | 14 +++++++------- lib/simpletest/testoutputlib.php | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index 0641ccd72a..292d5e414a 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -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); diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index c26c2d9878..213d175f74 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -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(); diff --git a/lib/simpletest/testoutputlib.php b/lib/simpletest/testoutputlib.php index 19427acc35..725ce5169d 100644 --- a/lib/simpletest/testoutputlib.php +++ b/lib/simpletest/testoutputlib.php @@ -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); } } -- 2.39.5