Moved the add element submit button above the element list

This commit is contained in:
Mark Nelson 2013-06-27 19:26:33 +08:00
parent f3dd124473
commit bb5ce9f4ac

View file

@ -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.