From bb5ce9f4ac189da286790c0b893f044ca4919c99 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 27 Jun 2013 19:26:33 +0800 Subject: [PATCH] Moved the add element submit button above the element list --- edit_form.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/edit_form.php b/edit_form.php index d7f30eb..23c6768 100644 --- a/edit_form.php +++ b/edit_form.php @@ -202,6 +202,11 @@ class mod_customcert_edit_form extends moodleform { $mform->addRule('pageheight_' . $page->id, null, 'required', null, 'client'); $mform->addHelpButton('pageheight_' . $page->id, 'height', 'customcert'); + $group = array(); + $group[] = $mform->createElement('select', 'element_' . $page->id, '', customcert_get_elements()); + $group[] = $mform->createElement('submit', 'addelement_' . $page->id, get_string('addelement', 'customcert')); + $mform->addElement('group', 'elementgroup', '', $group, '', false); + // Check if there are elements to add. if ($elements = $DB->get_records('customcert_elements', array('pageid' => $page->id), 'sequence ASC')) { // Get the total number of elements. @@ -259,11 +264,6 @@ class mod_customcert_edit_form extends moodleform { $mform->addHelpButton('elements_' . $page->id, 'elements', 'customcert'); } - $group = array(); - $group[] = $mform->createElement('select', 'element_' . $page->id, '', customcert_get_elements()); - $group[] = $mform->createElement('submit', 'addelement_' . $page->id, get_string('addelement', 'customcert')); - $mform->addElement('group', 'elementgroup', '', $group, '', false); - // Add option to delete this page if there is more than one page. if ($this->numpages > 1) { // Link to delete the element.