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 {{{