#35 Moved 'Add element' submit button
This commit is contained in:
parent
937cf3ad81
commit
69405ced78
1 changed files with 5 additions and 5 deletions
|
@ -231,11 +231,6 @@ class edit_form extends \moodleform {
|
||||||
$mform->setDefault('pagerightmargin_' . $page->id, 0);
|
$mform->setDefault('pagerightmargin_' . $page->id, 0);
|
||||||
$mform->addHelpButton('pagerightmargin_' . $page->id, 'rightmargin', 'customcert');
|
$mform->addHelpButton('pagerightmargin_' . $page->id, 'rightmargin', 'customcert');
|
||||||
|
|
||||||
$group = array();
|
|
||||||
$group[] = $mform->createElement('select', 'element_' . $page->id, '', element::get_available_types());
|
|
||||||
$group[] = $mform->createElement('submit', 'addelement_' . $page->id, get_string('addelement', 'customcert'));
|
|
||||||
$mform->addElement('group', 'elementgroup', '', $group, '', false);
|
|
||||||
|
|
||||||
// Check if there are elements to add.
|
// Check if there are elements to add.
|
||||||
if ($elements = $DB->get_records('customcert_elements', array('pageid' => $page->id), 'sequence ASC')) {
|
if ($elements = $DB->get_records('customcert_elements', array('pageid' => $page->id), 'sequence ASC')) {
|
||||||
// Get the total number of elements.
|
// Get the total number of elements.
|
||||||
|
@ -289,6 +284,11 @@ class edit_form extends \moodleform {
|
||||||
$mform->addHelpButton('elements_' . $page->id, 'elements', 'customcert');
|
$mform->addHelpButton('elements_' . $page->id, 'elements', 'customcert');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$group = array();
|
||||||
|
$group[] = $mform->createElement('select', 'element_' . $page->id, '', element::get_available_types());
|
||||||
|
$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.
|
// Add option to delete this page if there is more than one page.
|
||||||
if ($this->numpages > 1) {
|
if ($this->numpages > 1) {
|
||||||
// Link to delete the element.
|
// Link to delete the element.
|
||||||
|
|
Loading…
Reference in a new issue