aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser
diff options
context:
space:
mode:
Diffstat (limited to 'mod/logbrowser')
-rw-r--r--mod/logbrowser/index.php14
-rw-r--r--mod/logbrowser/start.php25
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