downtime reacts to PageRequestEvent
git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.1@486 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
e7595260c1
commit
d51f2b3032
@ -6,17 +6,17 @@ class Downtime extends Extension {
|
|||||||
public function receive_event($event) {
|
public function receive_event($event) {
|
||||||
if(is_null($this->theme)) $this->theme = get_theme_object("downtime", "DowntimeTheme");
|
if(is_null($this->theme)) $this->theme = get_theme_object("downtime", "DowntimeTheme");
|
||||||
|
|
||||||
$this->check_downtime($event);
|
|
||||||
|
|
||||||
if(is_a($event, 'SetupBuildingEvent')) {
|
if(is_a($event, 'SetupBuildingEvent')) {
|
||||||
$sb = new SetupBlock("Downtime");
|
$sb = new SetupBlock("Downtime");
|
||||||
$sb->add_bool_option("downtime", "Disable non-admin access: ");
|
$sb->add_bool_option("downtime", "Disable non-admin access: ");
|
||||||
$sb->add_longtext_option("downtime_message", "<br>");
|
$sb->add_longtext_option("downtime_message", "<br>");
|
||||||
$event->panel->add_block($sb);
|
$event->panel->add_block($sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_a($event, 'PageRequestEvent')) {
|
if(is_a($event, 'PageRequestEvent')) {
|
||||||
global $config;
|
global $config;
|
||||||
if($config->get_bool("downtime")) {
|
if($config->get_bool("downtime")) {
|
||||||
|
$this->check_downtime($event);
|
||||||
$this->theme->display_notification($event->page);
|
$this->theme->display_notification($event->page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user