diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 39c1a303657..2b246d92da2 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -117,10 +117,15 @@ class moodle_html_component { /** * Perform any cleanup or final processing that should be done before an - * instance of this class is output. + * instance of this class is output. This method is supposed to be called + * only from renderers. + * + * @param renderer_base $output output renderer + * @param moodle_page $page + * @param string $target rendering target * @return void */ - public function prepare() { + public function prepare(renderer_base $output, moodle_page $page, $target) { $this->classes = array_unique(self::clean_classes($this->classes)); } @@ -206,6 +211,7 @@ class moodle_html_component { } } + class labelled_html_component extends moodle_html_component { /** * @var mixed $label The label for that component. String or html_label object @@ -273,14 +279,15 @@ class html_label extends moodle_html_component { * @see moodle_html_component::prepare() * @return void */ - public function prepare() { + public function prepare(renderer_base $output, moodle_page $page, $target) { if (empty($this->text)) { throw new coding_exception('html_label must have a $text value.'); } - parent::prepare(); + parent::prepare($output, $page, $target); } } + /** * This class hold all the information required to describe a