mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-17 05:48:43 +02:00
Namespace changes, outagedb changed to used static methods instead on singleton, utils renamed to outagelib (better name when using the 'use' directive). Issue #1
This commit is contained in:
15
create.php
15
create.php
@@ -23,24 +23,23 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
use \auth_outage\outage;
|
||||
use \auth_outage\outageutils;
|
||||
use \auth_outage\outagedb;
|
||||
use \auth_outage\outageform;
|
||||
use auth_outage\models\outage;
|
||||
use auth_outage\outagedb;
|
||||
use auth_outage\outagelib;
|
||||
|
||||
require_once('../../config.php');
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/formslib.php');
|
||||
|
||||
outageutils::pagesetup();
|
||||
outagelib::pagesetup();
|
||||
|
||||
$mform = new outageform();
|
||||
$mform = new \auth_outage\forms\outage\edit();
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect('/auth/outage/list.php');
|
||||
} else if ($fromform = $mform->get_data()) {
|
||||
$fromform = outageutils::parseformdata($fromform);
|
||||
$fromform = outagelib::parseformdata($fromform);
|
||||
$outage = new outage($fromform);
|
||||
$id = outagedb::get()->save($outage);
|
||||
$id = outagedb::save($outage);
|
||||
redirect('/auth/outage/list.php#auth_outage_id=' . $id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user