sys info to simpleext
This commit is contained in:
parent
ee40a9aad3
commit
eedfc5e6b4
@ -12,25 +12,22 @@
|
|||||||
* versions of PHP I should test with, etc.
|
* versions of PHP I should test with, etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ET implements Extension {
|
class ET extends SimpleExtension {
|
||||||
var $theme;
|
public function onPageRequest($event) {
|
||||||
|
global $user;
|
||||||
public function receive_event(Event $event) {
|
if($event->page_matches("system_info")) {
|
||||||
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($user->is_admin()) {
|
if($user->is_admin()) {
|
||||||
$this->theme->display_info_page($page, $this->get_info());
|
$this->theme->display_info_page($this->get_info());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($event instanceof UserBlockBuildingEvent) {
|
public function onUserBlockBuilding($event) {
|
||||||
|
global $user;
|
||||||
if($user->is_admin()) {
|
if($user->is_admin()) {
|
||||||
$event->add_link("System Info", make_link("system_info"));
|
$event->add_link("System Info", make_link("system_info"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private function get_info() {
|
private function get_info() {
|
||||||
global $config, $database;
|
global $config, $database;
|
||||||
@ -72,7 +69,5 @@ class ET implements Extension {
|
|||||||
|
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
// }}}
|
|
||||||
}
|
}
|
||||||
add_event_listener(new ET());
|
|
||||||
?>
|
?>
|
||||||
|
@ -6,7 +6,9 @@ class ETTheme extends Themelet {
|
|||||||
*
|
*
|
||||||
* $info = an array of ($name => $value)
|
* $info = an array of ($name => $value)
|
||||||
*/
|
*/
|
||||||
public function display_info_page(Page $page, $info) {
|
public function display_info_page($info) {
|
||||||
|
global $page;
|
||||||
|
|
||||||
$page->set_title("System Info");
|
$page->set_title("System Info");
|
||||||
$page->set_heading("System Info");
|
$page->set_heading("System Info");
|
||||||
$page->add_block(new NavBlock());
|
$page->add_block(new NavBlock());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user