aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-19 03:17:51 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-19 03:17:51 +0000
commit7303fb1a0960e6bb3b6e11f51372d1ed689e3b84 (patch)
tree76e202bff895a45c5ed40dcd0020b0e49b6d8125 /mod/logbrowser
parent72c83e4904a13c0e07d0d328ccbd201d16a617cc (diff)
downloadelgg-7303fb1a0960e6bb3b6e11f51372d1ed689e3b84.tar.gz
elgg-7303fb1a0960e6bb3b6e11f51372d1ed689e3b84.tar.bz2
added a user admin menu that plugins can add menu items to
git-svn-id: http://code.elgg.org/elgg/trunk@7678 36083f99-b078-4883-b0ff-0f9b5a30f544
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