From 6b5a3b2dfd0a20da1dfb46f42a7bc79dfe9377fc Mon Sep 17 00:00:00 2001 From: nickw Date: Mon, 24 May 2010 21:44:07 +0000 Subject: Updating multiple plugins to no longer register admin menus with an event hook. git-svn-id: http://code.elgg.org/elgg/trunk@6191 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/sitepages/start.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'mod/sitepages') diff --git a/mod/sitepages/start.php b/mod/sitepages/start.php index 457ed583c..180739cca 100644 --- a/mod/sitepages/start.php +++ b/mod/sitepages/start.php @@ -57,6 +57,11 @@ function sitepages_init() { register_action("sitepages/edit", FALSE, $CONFIG->pluginspath . "sitepages/actions/edit.php"); register_action("sitepages/delete", FALSE, $CONFIG->pluginspath . "sitepages/actions/delete.php"); + elgg_add_submenu_item(array( + 'text' => elgg_echo('sitepages'), + 'href' => "{$CONFIG->wwwroot}pg/sitepages/edit/front", + 'parent_id' => 'site', + ), 'admin', 'default'); } /** @@ -96,16 +101,6 @@ function sitepages_custom_index() { return true; } -/** - * Page setup. Adds admin controls to the admin panel. - */ -function sitepages_pagesetup(){ - if (get_context() == 'admin' && isadminloggedin()) { - global $CONFIG; - add_submenu_item(elgg_echo('sitepages'), $CONFIG->wwwroot . 'pg/sitepages/edit/front'); - } -} - /** * * @param unknown_type $expage @@ -234,4 +229,3 @@ function sitepages_public_pages($hook, $type, $return_value, $params) { } register_elgg_event_handler('init', 'system', 'sitepages_init'); -register_elgg_event_handler('pagesetup', 'system', 'sitepages_pagesetup'); \ No newline at end of file -- cgit v1.2.3