Moved location of the delete customcert page button

This commit is contained in:
Mark Nelson 2013-02-22 17:35:49 +08:00
parent 5945171a9d
commit 0c66a5242f

View file

@ -226,6 +226,13 @@ class mod_customcert_edit_form extends moodleform {
$group[] = $mform->createElement('submit', 'addelement_' . $pageid, get_string('addelement', 'customcert'));
$mform->addElement('group', 'elementgroup', '', $group, '', false);
// Add option to delete this page if it is not the first page.
if ($pagenum > 1) {
$mform->addElement('html', html_writer::start_tag('div', array('class' => 'deletecertpage')));
$mform->addElement('submit', 'deletecertpage_' . $pageid, get_string('deletecertpage', 'customcert'));
$mform->addElement('html', html_writer::end_tag('div'));
}
// Check if there are elements to add.
if ($elements = $DB->get_records('customcert_elements', array('pageid' => $pageid), 'id ASC')) {
// Loop through and add the ones present.
@ -247,12 +254,5 @@ class mod_customcert_edit_form extends moodleform {
}
}
}
// Add option to delete this page if it is not the first page.
if ($pagenum > 1) {
$mform->addElement('html', html_writer::start_tag('div', array('class' => 'deletecertpage')));
$mform->addElement('submit', 'deletecertpage_' . $pageid, get_string('deletecertpage', 'customcert'));
$mform->addElement('html', html_writer::end_tag('div'));
}
}
}