scorify the PM extension

This commit is contained in:
Shish
2009-01-04 09:38:23 -08:00
parent 85c8875ffe
commit cdde0e072c
3 changed files with 25 additions and 28 deletions

View File

@@ -13,22 +13,21 @@ class ET implements Extension {
if(is_null($this->theme)) $this->theme = get_theme_object($this);
if(($event instanceof PageRequestEvent) && $event->page_matches("system_info")) {
if($event->user->is_admin()) {
$this->theme->display_info_page($event->page, $this->get_info());
if($event->context->user->is_admin()) {
$this->theme->display_info_page($event->page, $this->get_info($event->context));
}
}
if($event instanceof UserBlockBuildingEvent) {
if($event->user->is_admin()) {
if($event->context->user->is_admin()) {
$event->add_link("System Info", make_link("system_info"));
}
}
}
// do it {{{
private function get_info() {
global $database;
global $config;
private function get_info($context) {
$database = $context->database;
$config = $context->config;
global $_event_listeners; // yay for using secret globals \o/
$info = array();