From 39eaa3450e32756944dcefc940f39fd1d4cb719d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 24 Jul 2010 20:30:52 +0000 Subject: undid the 1.8 changes that leaked into trunk --- start.php | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'start.php') diff --git a/start.php b/start.php index c447c2a34..dc7debcd6 100644 --- a/start.php +++ b/start.php @@ -30,14 +30,14 @@ elgg_extend_view('css', 'tidypics/css'); // Extend hover-over and profile menu - elgg_extend_view('profile/menu/links','tidypics/hover_menu'); + extend_view('profile/menu/links','tidypics/hover_menu'); //group view ** psuedo widget view for group pages** - elgg_extend_view('groups/right_column','tidypics/groupprofile_albums'); + extend_view('groups/right_column','tidypics/groupprofile_albums'); // rss extensions - elgg_extend_view('extensions/xmlns', 'extensions/tidypics/xmlns'); - elgg_extend_view('extensions/channel', 'extensions/tidypics/channel'); + extend_view('extensions/xmlns', 'extensions/tidypics/xmlns'); + extend_view('extensions/channel', 'extensions/tidypics/channel'); // Register a page handler, so we can have nice URLs register_page_handler('photos','tidypics_page_handler'); @@ -72,13 +72,7 @@ } // slideshow plugin hook - register_plugin_hook('tp_slideshow', 'album', 'tidypics_slideshow'); - - elgg_add_submenu_item(array( - 'text' => elgg_echo('tidypics:administration'), - 'href' => "{$CONFIG->wwwroot}mod/tidypics/pages/admin.php", - 'parent_id' => 'site', - ), 'admin', 'default'); + register_plugin_hook('tp_slideshow', 'album', 'tidypics_slideshow'); } /** @@ -204,6 +198,18 @@ } + /** + * Sets up tidypics admin menu. Triggered on pagesetup. + */ + function tidypics_adminmenu() + { + global $CONFIG; + + if (get_context() == 'admin' && isadminloggedin()) { + add_submenu_item(elgg_echo('tidypics:administration'), $CONFIG->url . "mod/tidypics/pages/admin.php"); + } + } + /** * Sets up submenus for tidypics most viewed pages */ @@ -411,7 +417,7 @@ $slideshow_link = "javascript:PicLensLite.start({maxScale:0,feedUrl:location.href+'?view=rss'})"; // add the slideshow javascript to the header - elgg_extend_view('metatags', 'tidypics/js/slideshow'); + extend_view('metatags', 'tidypics/js/slideshow'); return $slideshow_link; } @@ -424,6 +430,7 @@ // Make sure tidypics_init is called on initialisation register_elgg_event_handler('init','system','tidypics_init'); register_elgg_event_handler('pagesetup','system','tidypics_submenus'); + register_elgg_event_handler('pagesetup','system','tidypics_adminmenu'); // Register actions register_action("tidypics/settings", false, $CONFIG->pluginspath . "tidypics/actions/settings.php"); -- cgit v1.2.3