mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
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:
parent
be1bb80efa
commit
c927e35c48
8 changed files with 112 additions and 64 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue