$editpage->set_title($strheading);
$editpage->set_heading($strheading);
- $output = $editpage->find_renderer('core');
+ $output = $editpage->get_renderer('core');
echo $output->header();
echo $output->heading($strheading, 2);
$mform->display();
*/
protected $_legacypageobject = null;
- /**
- * Returns instance of page renderer
- * @param string $component name such as 'core', 'mod_forum' or 'qtype_multichoice'.
- * @param string $subtype optional subtype such as 'news' resulting to 'mod_forum_news'
- * @return renderer_base
- */
- public function find_renderer($component, $subtype = null) {
- return $this->magic_get_theme()->get_renderer($this, $component, $subtype);
- }
-
-/// Getter methods =============================================================
+/// Magic getter methods =============================================================
/// Due to the __get magic below, you normally do not call these as $PAGE->magic_get_x
/// methods, but instead use the $PAGE->x syntax.
/// Other information getting methods ==========================================
+ /**
+ * Returns instance of page renderer
+ * @param string $component name such as 'core', 'mod_forum' or 'qtype_multichoice'.
+ * @param string $subtype optional subtype such as 'news' resulting to 'mod_forum_news'
+ * @return renderer_base
+ */
+ public function get_renderer($component, $subtype = null) {
+ return $this->magic_get_theme()->get_renderer($this, $component, $subtype);
+ }
+
/**
* Checks to see if there are any items on the navbar object
* @return bool true if there are, false if not
if ($this === $PAGE) {
$THEME = $this->_theme;
- $OUTPUT = $this->find_renderer('core');
+ $OUTPUT = $this->get_renderer('core');
}
$this->_wherethemewasinitialised = debug_backtrace();
* @param moodle_page $page
*/
public function __construct(moodle_page $page) {
- $this->output = $page->find_renderer('core');
+ $this->output = $page->get_renderer('core');
parent::__construct($page);
}
add_to_log($course->id, "forum", "view subscribers", "subscribers.php?id=$forum->id", $forum->id, $cm->id);
-$forumoutput = $PAGE->find_renderer('mod_forum');
+$forumoutput = $PAGE->get_renderer('mod_forum');
$currentgroup = groups_get_activity_group($cm);
$options = array('forumid'=>$forum->id, 'currentgroup'=>$currentgroup, 'context'=>$context);
$existingselector = new forum_existing_subscriber_selector('existingsubscribers', $options);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$canmanage = has_capability('mod/lesson:manage', $context);
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
$url = new moodle_url($CFG->wwwroot.'/mod/lesson/continue.php', array('id'=>$cm->id));
$PAGE->set_url($url);
set_user_preference('lesson_view', $mode);
}
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
$PAGE->navbar->add(get_string('edit'));
echo $lessonoutput->header($lesson, $mode);
if (!$lesson->has_pages()) {
redirect(new moodle_url($CFG->wwwroot.'/mod/lesson/edit.php', array('id'=>$cm->id)));
}
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
echo $lessonoutput->header($lesson);
$mform->display();
echo $lessonoutput->footer();
\ No newline at end of file
// Log it
add_to_log($course->id, 'lesson', 'view grade', "essay.php?id=$cm->id", get_string('manualgrading', 'lesson'), $cm->id);
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
echo $lessonoutput->header($lesson, 'essay');
switch ($mode) {
// Log it
add_to_log($course->id, 'lesson', 'view highscores', "highscores.php?id=$cm->id", $lesson->name, $cm->id);
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
echo $lessonoutput->header($lesson, 'highscores');
switch ($mode) {
require_capability('mod/lesson:edit', $context);
require_sesskey();
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
/// Process the action
switch ($action) {
require_login($course, false, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
// Get the mimetype
$mimetype = mimeinfo("type", $lesson->mediafile);
* @param moodle_page $page
*/
public function __construct(moodle_page $page) {
- $this->output = $page->find_renderer('core');
+ $this->output = $page->get_renderer('core');
parent::__construct($page);
}
}
$PAGE->set_url($url);
$PAGE->navbar->add(get_string('reports', 'lesson'), new moodle_url($CFG->wwwroot.'/mod/lesson/report.php', array('id'=>$id)));
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
/// Process any form data before fetching attempts, grades and times
if (has_capability('mod/lesson:edit', $context) && $form = data_submitted() && confirm_sesskey()) {
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$canmanage = has_capability('mod/lesson:manage', $context);
-$lessonoutput = $PAGE->find_renderer('mod_lesson');
+$lessonoutput = $PAGE->get_renderer('mod_lesson');
/// Check these for students only TODO: Find a better method for doing this!
/// Check lesson availability
* @param moodle_page $page
*/
public function __construct(moodle_page $page) {
- $this->output = $page->find_renderer('core');
+ $this->output = $page->get_renderer('core');
parent::__construct($page);
}
$USER->id = null;
echo $OUTPUT->header();
$USER->id = $userid;
- $renderer = $PAGE->find_renderer('core', 'wsdoc');
+ $renderer = $PAGE->get_renderer('core', 'wsdoc');
echo $renderer->documentation_html($this->functions, $this->username);
echo $OUTPUT->footer();
$PAGE->set_pagelayout('popup');
echo $OUTPUT->header();
- $renderer = $PAGE->find_renderer('core', 'wsdoc');
+ $renderer = $PAGE->get_renderer('core', 'wsdoc');
echo $renderer->login_page_html($errormessage);
echo $OUTPUT->footer();