mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-21148 plugin renderers now redirect calls to core renderer, credit goes to anybody who did the lesson renderer ;-)
This commit is contained in:
parent
755909352c
commit
ff5265c64f
2 changed files with 16 additions and 16 deletions
|
@ -222,6 +222,22 @@ class plugin_renderer_base extends renderer_base {
|
||||||
$this->output = $page->get_renderer('core');
|
$this->output = $page->get_renderer('core');
|
||||||
parent::__construct($page);
|
parent::__construct($page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magic method used to pass calls otherwise meant for the standard renderer
|
||||||
|
* to it to ensure we don't go causing unnessecary greif.
|
||||||
|
*
|
||||||
|
* @param string $method
|
||||||
|
* @param array $arguments
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function __call($method, $arguments) {
|
||||||
|
if (method_exists($this->output, $method)) {
|
||||||
|
return call_user_func_array(array($this->output, $method), $arguments);
|
||||||
|
} else {
|
||||||
|
throw new coding_exception('Unknown method called against '.__CLASS__.' :: '.$method);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,22 +24,6 @@
|
||||||
**/
|
**/
|
||||||
|
|
||||||
class mod_lesson_renderer extends plugin_renderer_base {
|
class mod_lesson_renderer extends plugin_renderer_base {
|
||||||
/**
|
|
||||||
* Magic method used to pass calls otherwise meant for the standard renderer
|
|
||||||
* to it to ensure we don't go causing unnessecary greif.
|
|
||||||
*
|
|
||||||
* @param string $method
|
|
||||||
* @param array $arguments
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function __call($method, $arguments) {
|
|
||||||
if (method_exists($this->output, $method)) {
|
|
||||||
return call_user_func_array(array($this->output, $method), $arguments);
|
|
||||||
} else {
|
|
||||||
throw new coding_exception('Unknown method called against '.__CLASS__.' :: '.$method);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the header for the lesson module
|
* Returns the header for the lesson module
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue