requestcontext stuff is messy, go back to globals :(

This commit is contained in:
Shish
2009-05-11 07:04:33 -07:00
parent e592ee4c59
commit bb84a735a2
57 changed files with 407 additions and 477 deletions

View File

@ -16,24 +16,24 @@ class ET implements Extension {
var $theme;
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("system_info")) {
if($event->context->user->is_admin()) {
$this->theme->display_info_page($event->page, $this->get_info($event->context));
if($user->is_admin()) {
$this->theme->display_info_page($page, $this->get_info());
}
}
if($event instanceof UserBlockBuildingEvent) {
if($event->context->user->is_admin()) {
if($user->is_admin()) {
$event->add_link("System Info", make_link("system_info"));
}
}
}
private function get_info($context) {
$database = $context->database;
$config = $context->config;
private function get_info() {
global $config, $database;
global $_event_listeners; // yay for using secret globals \o/
$info = array();