From d2f13478127b304a4a0d5d366bc12513a555ebbf Mon Sep 17 00:00:00 2001 From: Johannes Burk Date: Tue, 12 Apr 2016 17:21:33 +0200 Subject: [PATCH] Use html_writer for HTML generation --- manage.php | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/manage.php b/manage.php index 2995525..2373cb1 100644 --- a/manage.php +++ b/manage.php @@ -89,19 +89,32 @@ $table->define_headers($headers); $table->sortable(true, 'id'); -echo '
'; -echo ''; +echo html_writer::start_tag('form', array('id' => 'enrol_apply_manage_form', 'method' => 'post', 'action' => $manageurl->out())); +echo html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'type', 'name' => 'type', 'value' => 'confirm')); $table->out(50, true); -echo '

'; -echo ''; -echo ''; -echo ''; -echo '

'; -echo '
'; -echo ''; +echo html_writer::start_tag('p', array('align' => 'center')); +echo html_writer::empty_tag('input', array( + 'type' => 'button', + 'onclick' => 'doSubmit("confirm");', + 'value' => get_string('btnconfirm', 'enrol_apply'))); +echo html_writer::empty_tag('input', array( + 'type' => 'button', + 'onclick' => 'doSubmit("wait");', + 'value' => get_string('btnwait', 'enrol_apply'))); +echo html_writer::empty_tag('input', array( + 'type' => 'button', + 'onclick' => 'doSubmit("cancel");', + 'value' => get_string('btncancel', 'enrol_apply'))); +echo html_writer::end_tag('p'); +echo html_writer::end_tag('form'); + +$js = " + function doSubmit(type){ + document.getElementById('type').value=type; + document.getElementById('enrol_apply_manage_form').submit(); + }"; +echo html_writer::tag('script', $js, array('type' => 'text/javascript')); + echo $OUTPUT->footer ();