adminpage -> simpleext
This commit is contained in:
parent
3d582dc0d9
commit
18d6fa317c
@ -35,16 +35,11 @@ class AdminBuildingEvent extends Event {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AdminPage implements Extension {
|
class AdminPage extends SimpleExtension {
|
||||||
var $theme;
|
public function onPageRequest($event) {
|
||||||
|
global $page, $user;
|
||||||
|
|
||||||
public function get_priority() {return 50;}
|
if($event->page_matches("admin")) {
|
||||||
|
|
||||||
public function receive_event(Event $event) {
|
|
||||||
global $config, $database, $page, $user;
|
|
||||||
if(is_null($this->theme)) $this->theme = get_theme_object($this);
|
|
||||||
|
|
||||||
if(($event instanceof PageRequestEvent) && $event->page_matches("admin")) {
|
|
||||||
if(!$user->is_admin()) {
|
if(!$user->is_admin()) {
|
||||||
$this->theme->display_permission_denied($page);
|
$this->theme->display_permission_denied($page);
|
||||||
}
|
}
|
||||||
@ -53,7 +48,7 @@ class AdminPage implements Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($event instanceof PageRequestEvent) && $event->page_matches("admin_utils")) {
|
if($event->page_matches("admin_utils")) {
|
||||||
if($user->is_admin() && $user->check_auth_token()) {
|
if($user->is_admin() && $user->check_auth_token()) {
|
||||||
log_info("admin", "Util: {$_POST['action']}");
|
log_info("admin", "Util: {$_POST['action']}");
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
@ -91,16 +86,18 @@ class AdminPage implements Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($event instanceof AdminBuildingEvent) {
|
public function onAdminBuilding($event) {
|
||||||
$this->theme->display_page($page);
|
global $page;
|
||||||
$this->theme->display_form($page);
|
$this->theme->display_page($page);
|
||||||
}
|
$this->theme->display_form($page);
|
||||||
|
}
|
||||||
|
|
||||||
if($event instanceof UserBlockBuildingEvent) {
|
public function onUserBlockBuilding($event) {
|
||||||
if($user->is_admin()) {
|
global $user;
|
||||||
$event->add_link("Board Admin", make_link("admin"));
|
if($user->is_admin()) {
|
||||||
}
|
$event->add_link("Board Admin", make_link("admin"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user