aboutsummaryrefslogtreecommitdiff
path: root/mod/reportedcontent/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-26 02:03:29 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-26 02:03:29 +0000
commit2ef37109d866708def220d082c0430f77efd6410 (patch)
tree6f55647507b5a23a0030b8e806c21367da1957b0 /mod/reportedcontent/start.php
parent16539579880fbdc0136b815ea5d26c57f2399cb1 (diff)
downloadelgg-2ef37109d866708def220d082c0430f77efd6410.tar.gz
elgg-2ef37109d866708def220d082c0430f77efd6410.tar.bz2
adding margin to admin buttons
git-svn-id: http://code.elgg.org/elgg/trunk@7931 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/reportedcontent/start.php')
-rw-r--r--mod/reportedcontent/start.php33
1 files changed, 31 insertions, 2 deletions
diff --git a/mod/reportedcontent/start.php b/mod/reportedcontent/start.php
index d92eb05a2..9708c3b14 100644
--- a/mod/reportedcontent/start.php
+++ b/mod/reportedcontent/start.php
@@ -19,15 +19,22 @@ function reportedcontent_init() {
elgg_extend_view('css/screen', 'reportedcontent/css');
elgg_extend_view('css/admin', 'reportedcontent/admin_css');
- // Extend context menu and footer with report content link
+ // Extend footer with report content link
if (isloggedin()) {
- elgg_extend_view('profile/menu/links', 'reportedcontent/user_report');
elgg_extend_view('footer/links', 'reportedcontent/footer_link');
}
+ elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'reportedcontent_user_hover_menu');
+
// Add admin menu item
elgg_add_admin_menu_item('reportedcontent', elgg_echo('reportedcontent'), 'utilities');
+ elgg_register_widget_type(
+ 'reportedcontent',
+ elgg_echo('reportedcontent'),
+ elgg_echo('reportedcontent:widget:description'),
+ 'admin');
+
// Register actions
$action_path = elgg_get_plugin_path() . "reportedcontent/actions";
elgg_register_action('reportedcontent/add', "$action_path/add.php");
@@ -58,3 +65,25 @@ function reportedcontent_page_handler($page) {
echo elgg_view_page(elgg_echo('reportedcontent:this'), $body);
}
+
+/**
+ * Add report user link to hover menu
+ */
+function reportedcontent_user_hover_menu($hook, $type, $return, $params) {
+ $user = $params['entity'];
+
+ $profile_url = urlencode($user->getURL());
+ $name = urlencode($user->name);
+ $url = "pg/reportedcontent/add/?address=$profile_url&title=$name";
+
+ if (isloggedin() && get_loggedin_userid() != $user->guid) {
+ $item = new ElggMenuItem(
+ 'reportuser',
+ elgg_echo('reportedcontent:user'),
+ $url);
+ $item->setSection('action');
+ $return[] = $item;
+ }
+
+ return $return;
+} \ No newline at end of file