From 979b0f936a738d565c4a85968cd2a1bfaab5be32 Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 4 Jun 2007 02:35:28 +0000 Subject: [PATCH] alias list / edit moved to its own page git-svn-id: file:///home/shish/svn/shimmie2/trunk@153 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/alias_editor/main.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php index 5400878f..1d7d9b40 100644 --- a/ext/alias_editor/main.php +++ b/ext/alias_editor/main.php @@ -31,14 +31,15 @@ class AliasEditor extends Extension { $page->set_redirect(make_link("admin")); } } + else if($event->get_arg(0) == "list") { + global $page; + $page->set_title("Alias List"); + $page->set_heading("Alias List"); + $page->add_main_block(new Block("Aliases", $this->build_aliases())); + } } } - if(is_a($event, 'AdminBuildingEvent')) { - global $page; - $page->add_main_block(new Block("Edit Aliases", $this->build_aliases())); - } - if(is_a($event, 'AddAliasEvent')) { global $database; $database->Execute("INSERT INTO aliases(oldtag, newtag) VALUES(?, ?)", array($event->oldtag, $event->newtag)); @@ -47,6 +48,12 @@ class AliasEditor extends Extension { $page->set_mode("redirect"); $page->set_redirect(make_link("admin")); } + + if(is_a($event, 'UserBlockBuildingEvent')) { + if($event->user->is_admin()) { + $event->add_link("Alias Editor", make_link("alias/list")); + } + } } // }}} // admin page HTML {{{