Issue #11 - Manage lists outages in separate tables.

This commit is contained in:
Daniel Thee Roperto
2016-09-12 12:58:16 +10:00
parent 22f85930ce
commit 25abb3ae82
6 changed files with 81 additions and 38 deletions

View File

@@ -28,14 +28,15 @@ use auth_outage\outagelib;
require_once('../../config.php');
$outage = outagedb::get_active();
$id = optional_param('id', null, PARAM_INT);
$outage = is_null($id) ? outagedb::get_active() : outagedb::get_by_id($id);
if (is_null($outage)) {
redirect(new moodle_url('/'));
}
$PAGE->set_context(context_system::instance());
$PAGE->set_title("Outage Warning");
$PAGE->set_heading("Outage Warning");
$PAGE->set_title($outage->get_title());
$PAGE->set_heading($outage->get_title());
$PAGE->set_url(new \moodle_url('/auth/outage/info.php'));
echo $OUTPUT->header();