From 3050d4aba881ffb2d6904b2e8e7054c2566d2de2 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 5 Aug 2008 16:44:56 +0000 Subject: The log browser is now a part of the admin panel. git-svn-id: https://code.elgg.org/elgg/trunk@1716 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/logbrowser/index.php | 14 ++++++-------- mod/logbrowser/start.php | 25 +++++++++++++++---------- 2 files changed, 21 insertions(+), 18 deletions(-) (limited to 'mod') diff --git a/mod/logbrowser/index.php b/mod/logbrowser/index.php index 9ef3d2617..c548e450b 100644 --- a/mod/logbrowser/index.php +++ b/mod/logbrowser/index.php @@ -12,14 +12,12 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); admin_gatekeeper(); - - $context = get_context(); - set_context('search'); + set_context('admin'); $limit = get_input('limit', 10); $offset = get_input('offset'); - $title = elgg_echo("logbrowser"); + $title = elgg_view_title(elgg_echo('logbrowser')); // Get log entries $log = get_system_log("", "","",$limit, $offset); @@ -33,11 +31,11 @@ $tmp->entry = $l; $log_entries[] = $tmp; } - - $result = elgg_view_entity_list($log_entries, $count, $offset, $limit, false); + set_context('search'); + $result = elgg_view_entity_list($log_entries, $count, $offset, $limit, false);# + set_context('admin'); // Display main admin menu - page_draw($title,elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title).$result)); - set_context($context); + page_draw($title,elgg_view_layout("two_column_left_sidebar", '', $title.$result)); ?> \ No newline at end of file diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php index c1b4ff73f..f7b9c97c1 100644 --- a/mod/logbrowser/start.php +++ b/mod/logbrowser/start.php @@ -17,16 +17,20 @@ { global $CONFIG; - if (isadminloggedin()) - { - add_menu(elgg_echo('logbrowser'), $CONFIG->wwwroot . "pg/logbrowser/",array( - menu_item(elgg_echo('logbrowser:browse'), $CONFIG->wwwroot."pg/logbrowser/"), - ),'logbrowser'); - - } - // Register a page handler, so we can have nice URLs register_page_handler('logbrowser','logbrowser_page_handler'); + } + + /** + * Adding the log browser to the admin menu + * + */ + function logbrowser_pagesetup() + { + if (get_context() == 'admin' && isadminloggedin()) { + global $CONFIG; + add_submenu_item(elgg_echo('logbrowser:browser'), $CONFIG->wwwroot . 'pg/logbrowser/'); + } } /** @@ -44,6 +48,7 @@ - // Initialise log - register_elgg_event_handler('init','system','logbrowser_init'); + // 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 -- cgit v1.2.3