$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);
}
}
* @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);
/** 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);
}
* @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);
}
/**
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));
$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)));
}
}
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)) {
$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();
'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');
$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);
}
$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);
$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);
}
}