aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pages/admin.php2
-rw-r--r--start.php31
2 files changed, 20 insertions, 13 deletions
diff --git a/pages/admin.php b/pages/admin.php
index addff5b50..d3e810351 100644
--- a/pages/admin.php
+++ b/pages/admin.php
@@ -18,6 +18,6 @@
$body .= elgg_view("tidypics/admin/tidypics", array('tab' => $tab));
- page_draw(elgg_echo('tidypics:administration'), elgg_view_layout("administration", $body));
+ page_draw(elgg_echo('tidypics:administration'), elgg_view_layout("two_column_left_sidebar", '', $body));
?> \ No newline at end of file
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');
}
/**
@@ -205,6 +199,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
*/
function tidypics_mostviewed_submenus() {
@@ -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");