aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser
diff options
context:
space:
mode:
Diffstat (limited to 'mod/logbrowser')
-rw-r--r--mod/logbrowser/start.php19
-rw-r--r--mod/logbrowser/views/default/logbrowser/adminlinks.php10
2 files changed, 13 insertions, 16 deletions
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
index 4236ce64e..1eda00732 100644
--- a/mod/logbrowser/start.php
+++ b/mod/logbrowser/start.php
@@ -12,13 +12,20 @@ elgg_register_event_handler('init', 'system', 'logbrowser_init');
*/
function logbrowser_init() {
- // Extend CSS
elgg_extend_view('css/admin', 'logbrowser/css');
-
- // Extend context menu with admin logbrowser link
- if (isadminloggedin()) {
- elgg_extend_view('profile/menu/adminlinks', 'logbrowser/adminlinks', 10000);
- }
+
+ elgg_register_plugin_hook_handler('register', 'menu:user_admin', 'logbrowser_user_admin_menu');
elgg_add_admin_submenu_item('logbrowser', elgg_echo('logbrowser'), 'overview');
}
+
+/**
+ * Add to the user admin menu
+ */
+function logbrowser_user_admin_menu($hook, $type, $return, $params) {
+ $user = $params['user'];
+
+ $url = "pg/admin/overview/logbrowser/?user_guid={$user->guid}";
+ $item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url);
+ elgg_register_menu_item('user_admin', $item);
+} \ No newline at end of file
diff --git a/mod/logbrowser/views/default/logbrowser/adminlinks.php b/mod/logbrowser/views/default/logbrowser/adminlinks.php
deleted file mode 100644
index 03e42fbb8..000000000
--- a/mod/logbrowser/views/default/logbrowser/adminlinks.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-/**
- * The dropdown link for exploring a user's log
- *
- * @package ElggLogBrowser
- */
-?>
-<a href="<?php echo elgg_get_site_url(); ?>pg/admin/overview/logbrowser/?user_guid=<?php echo $vars['entity']->guid; ?>">
- <?php echo elgg_echo("logbrowser:explore"); ?>
-</a> \ No newline at end of file