mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Fix Cancel button on Edit form.
This commit is contained in:
@@ -163,10 +163,16 @@ class edit extends moodleform {
|
||||
$this->_form->addElement('html',
|
||||
$OUTPUT->notification(get_string('warningreenablemaintenancemode', 'auth_outage'), 'notifywarning'));
|
||||
}
|
||||
|
||||
$this->add_action_buttons();
|
||||
} else {
|
||||
throw new coding_exception('$outage must be an outage object.', $outage);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see moodleform::definition_after_data()
|
||||
*/
|
||||
public function definition_after_data() {
|
||||
$this->add_action_buttons();
|
||||
}
|
||||
}
|
||||
|
||||
14
edit.php
14
edit.php
@@ -38,11 +38,15 @@ $PAGE->set_url(new moodle_url('/auth/outage/manage.php'));
|
||||
|
||||
$mform = new edit();
|
||||
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
} else if ($outage = $mform->get_data()) {
|
||||
$id = outagedb::save($outage);
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
if ($mform->is_submitted()) {
|
||||
$mform->is_validated();
|
||||
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
} else if ($outage = $mform->get_data()) {
|
||||
$id = outagedb::save($outage);
|
||||
redirect(new moodle_url('/auth/outage/manage.php'));
|
||||
}
|
||||
}
|
||||
|
||||
$clone = optional_param('clone', 0, PARAM_INT);
|
||||
|
||||
Reference in New Issue
Block a user