the bulk of theme engine 2.0; it's still rough, but it works

git-svn-id: file:///home/shish/svn/shimmie2/trunk@201 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish
2007-06-30 01:19:11 +00:00
parent d06f0ef30f
commit a625fcd787
58 changed files with 1198 additions and 891 deletions

View File

@ -8,8 +8,11 @@
*/
class AdminUtils extends Extension {
var $theme;
// event handler {{{
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("admin_utils", "AdminUtilsTheme");
if(is_a($event, 'PageRequestEvent') && ($event->page == "admin_utils")) {
global $user;
if($user->is_admin()) {
@ -29,7 +32,7 @@ class AdminUtils extends Extension {
if(is_a($event, 'AdminBuildingEvent')) {
global $page;
$page->add_main_block(new Block("Misc Admin Tools", $this->build_form()));
$this->theme->display_form($page);
}
}
// }}}
@ -50,17 +53,6 @@ class AdminUtils extends Extension {
}
}
// }}}
// admin page HTML {{{
private function build_form() {
$html = "
<p><form action='".make_link("admin_utils")."' method='POST'>
<input type='hidden' name='action' value='lowercase all tags'>
<input type='submit' value='Lowercase All Tags'>
</form>
";
return $html;
}
// }}}
}
add_event_listener(new AdminUtils());
?>