aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 21:44:07 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 21:44:07 +0000
commit6b5a3b2dfd0a20da1dfb46f42a7bc79dfe9377fc (patch)
treee2f5b3cf9c799790fcc57b9e2c31c03cc70cb270 /mod/logbrowser
parent07727717f2341edc80ba9dc47e78649d1133b29b (diff)
downloadelgg-6b5a3b2dfd0a20da1dfb46f42a7bc79dfe9377fc.tar.gz
elgg-6b5a3b2dfd0a20da1dfb46f42a7bc79dfe9377fc.tar.bz2
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
Diffstat (limited to 'mod/logbrowser')
-rw-r--r--mod/logbrowser/index.php2
-rw-r--r--mod/logbrowser/start.php98
2 files changed, 45 insertions, 55 deletions
diff --git a/mod/logbrowser/index.php b/mod/logbrowser/index.php
index 3629b94d5..c72e9fc23 100644
--- a/mod/logbrowser/index.php
+++ b/mod/logbrowser/index.php
@@ -59,6 +59,6 @@
set_context('admin');
// Display main admin menu
- page_draw(elgg_echo('logbrowser'),elgg_view_layout("one_column_with_sidebar", $title . $form . $result));
+ page_draw(elgg_echo('logbrowser'),elgg_view_layout('administration', $title . $form . $result));
?>
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
index 86c75c7c5..c8c830f00 100644
--- a/mod/logbrowser/start.php
+++ b/mod/logbrowser/start.php
@@ -1,61 +1,51 @@
<?php
- /**
- * Elgg log browser.
- *
- * @package ElggLogBrowser
- * @author Curverider Ltd
- * @link http://elgg.com/
- */
+/**
+ * Elgg log browser.
+ *
+ * @package ElggLogBrowser
+ * @author Curverider Ltd
+ * @link http://elgg.com/
+ */
- /**
- * Initialise the log browser and set up the menus.
- *
- */
- function logbrowser_init()
- {
- global $CONFIG;
-
- // Register a page handler, so we can have nice URLs
- register_page_handler('logbrowser','logbrowser_page_handler');
-
- // Extend CSS
- elgg_extend_view('css','logbrowser/css');
-
- // Extend context menu with admin logbrowsre link
- if (isadminloggedin())
- {
- elgg_extend_view('profile/menu/adminlinks','logbrowser/adminlinks',10000);
- }
- }
+/**
+ * Initialise the log browser and set up the menus.
+ *
+ */
+function logbrowser_init()
+{
+ global $CONFIG;
- /**
- * Adding the log browser to the admin menu
- *
- */
- function logbrowser_pagesetup()
- {
- if (get_context() == 'admin' && isadminloggedin()) {
- global $CONFIG;
- add_submenu_item(elgg_echo('logbrowser'), $CONFIG->wwwroot . 'pg/logbrowser/');
- }
- }
+ // Register a page handler, so we can have nice URLs
+ register_page_handler('logbrowser','logbrowser_page_handler');
- /**
- * Log browser page handler
- *
- * @param array $page Array of page elements, forwarded by the page handling mechanism
- */
- function logbrowser_page_handler($page)
- {
- global $CONFIG;
-
- // only interested in one page for now
- include($CONFIG->pluginspath . "logbrowser/index.php");
- }
+ // Extend CSS
+ elgg_extend_view('css','logbrowser/css');
+ // Extend context menu with admin logbrowsre link
+ if (isadminloggedin()) {
+ elgg_extend_view('profile/menu/adminlinks','logbrowser/adminlinks',10000);
+ }
+ elgg_add_submenu_item(array(
+ 'text' => elgg_echo('logbrowser'),
+ 'href' => "{$CONFIG->wwwroot}pg/logbrowser",
+ 'parent_id' => 'overview',
+ ), 'admin', 'default');
+}
+
+/**
+ * Log browser page handler
+ *
+ * @param array $page Array of page elements, forwarded by the page handling mechanism
+ */
+function logbrowser_page_handler($page)
+{
+ global $CONFIG;
- // Initialise log browser
- register_elgg_event_handler('init','system','logbrowser_init');
- register_elgg_event_handler('pagesetup','system','logbrowser_pagesetup');
-?> \ No newline at end of file
+ // only interested in one page for now
+ include($CONFIG->pluginspath . "logbrowser/index.php");
+}
+
+
+// Initialise log browser
+register_elgg_event_handler('init','system','logbrowser_init');