aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/logbrowser/start.php')
-rw-r--r--mod/logbrowser/start.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/mod/logbrowser/start.php b/mod/logbrowser/start.php
new file mode 100644
index 000000000..22659877b
--- /dev/null
+++ b/mod/logbrowser/start.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Elgg log browser.
+ *
+ * @package ElggLogBrowser
+ */
+
+elgg_register_event_handler('init', 'system', 'logbrowser_init');
+
+/**
+ * Initialize the log browser plugin.
+ */
+function logbrowser_init() {
+
+ elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'logbrowser_user_hover_menu');
+
+ elgg_register_admin_menu_item('administer', 'logbrowser', 'administer_utilities');
+}
+
+/**
+ * Add to the user hover menu
+ */
+function logbrowser_user_hover_menu($hook, $type, $return, $params) {
+ $user = $params['entity'];
+
+ $url = "admin/administer_utilities/logbrowser?user_guid={$user->guid}";
+ $item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url);
+ $item->setSection('admin');
+ $return[] = $item;
+
+ return $return;
+}