From 256c3e1b67940f112128fdbea376b180617eb451 Mon Sep 17 00:00:00 2001 From: Johannes Burk Date: Wed, 1 Jun 2016 17:12:52 +0200 Subject: [PATCH] Use renderer for edit page. --- edit.php | 6 ++---- renderer.php | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/edit.php b/edit.php index 49b7048..ae033a3 100644 --- a/edit.php +++ b/edit.php @@ -78,7 +78,5 @@ if ($mform->is_cancelled()) { $PAGE->set_heading(format_string($course->fullname)); $PAGE->set_title(get_string('pluginname', 'enrol_apply')); -echo $OUTPUT->header(); -echo $OUTPUT->heading(get_string('pluginname', 'enrol_apply')); -$mform->display(); -echo $OUTPUT->footer(); +$renderer = $PAGE->get_renderer('enrol_apply'); +$renderer->edit_page($mform); diff --git a/renderer.php b/renderer.php index 74c2e0a..b9681a8 100644 --- a/renderer.php +++ b/renderer.php @@ -34,6 +34,13 @@ class enrol_apply_renderer extends plugin_renderer_base { echo $this->footer(); } + public function edit_page($mform) { + echo $this->header(); + echo $this->heading(get_string('pluginname', 'enrol_apply')); + $mform->display(); + echo $this->footer(); + } + public function manage_form($table, $manageurl) { echo html_writer::start_tag('form', array('id' => 'enrol_apply_manage_form', 'method' => 'post', 'action' => $manageurl->out()));