diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-05 16:44:56 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-05 16:44:56 +0000 |
commit | 3050d4aba881ffb2d6904b2e8e7054c2566d2de2 (patch) | |
tree | 939d11fc5966fb50b6d3d5b35906a0827f264f2d /mod | |
parent | 4b1f528ff37cf8ae43685b4d3cb2759ae1645770 (diff) | |
download | elgg-3050d4aba881ffb2d6904b2e8e7054c2566d2de2.tar.gz elgg-3050d4aba881ffb2d6904b2e8e7054c2566d2de2.tar.bz2 |
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
Diffstat (limited to 'mod')
-rw-r--r-- | mod/logbrowser/index.php | 14 | ||||
-rw-r--r-- | mod/logbrowser/start.php | 25 |
2 files changed, 21 insertions, 18 deletions
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 |