]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
added an owner block link for the wire plugin
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 23 Mar 2011 00:07:36 +0000 (00:07 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 23 Mar 2011 00:07:36 +0000 (00:07 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8819 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/bookmarks/start.php
mod/thewire/start.php

index fa837c1d2ed8a8c9a90521d2a33f7e1190ed091e..b4a4ef46b75289713e62820e6c79bbee4d517dc3 100644 (file)
@@ -51,9 +51,7 @@ function bookmarks_init() {
                ));
        }
        // Register granular notification for this type
-       if (is_callable('register_notification_object')) {
-               register_notification_object('object', 'bookmarks', elgg_echo('bookmarks:new'));
-       }
+       register_notification_object('object', 'bookmarks', elgg_echo('bookmarks:new'));
 
        // Listen to notification events and supply a more useful message
        elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'bookmarks_notify_message');
index 0b2265082f1f4426be39525eea61e0f4d7a2746f..d10efb6ba395d2511e7085cfe260d15c10bdd46c 100644 (file)
@@ -27,6 +27,9 @@ function thewire_init() {
        $item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'thewire/all');\r
        elgg_register_menu_item('site', $item);\r
 \r
+       // owner block menu\r
+       elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'thewire_owner_block_menu');\r
+\r
        // remove edit and access and add thread, reply, view previous\r
        elgg_register_plugin_hook_handler('register', 'menu:entity', 'thewire_setup_entity_menu_items');\r
        \r
@@ -411,6 +414,19 @@ function thewire_setup_entity_menu_items($hook, $type, $value, $params) {
        return $value;\r
 }\r
 \r
+/**\r
+ * Add a menu item to an ownerblock\r
+ */\r
+function thewire_owner_block_menu($hook, $type, $return, $params) {\r
+       if (elgg_instanceof($params['entity'], 'user')) {\r
+               $url = "thewire/owner/{$params['entity']->username}";\r
+               $item = new ElggMenuItem('thewire', elgg_echo('item:object:thewire'), $url);\r
+               $return[] = $item;\r
+       }\r
+\r
+       return $return;\r
+}\r
+\r
 /**\r
  * Runs unit tests for the wire\r
  */\r