MDL-21148 geenral support for rendering targets, this should give us more flexibility; please propose improvements in the tracker if necessary, thanks

This commit is contained in:
Petr Skoda 2009-12-17 22:43:27 +00:00
parent be1bb80efa
commit c927e35c48
8 changed files with 112 additions and 64 deletions

View file

@ -909,19 +909,16 @@ class theme_config {
* @param moodle_page $page the page we are rendering
* @param string $module the name of part of moodle. E.g. 'core', 'quiz', 'qtype_multichoice'.
* @param string $subtype optional subtype such as 'news' resulting to 'mod_forum_news'
* @param string $target one of rendering target constants
* @return renderer_base the requested renderer.
*/
public function get_renderer(moodle_page $page, $component, $subtype=null) {
public function get_renderer(moodle_page $page, $component, $subtype = null, $target = null) {
if (is_null($this->rf)) {
if (CLI_SCRIPT) {
$classname = 'cli_renderer_factory';
} else {
$classname = $this->rendererfactory;
}
$classname = $this->rendererfactory;
$this->rf = new $classname($this);
}
return $this->rf->get_renderer($page, $component, $subtype);
return $this->rf->get_renderer($page, $component, $subtype, $target);
}
/**