]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Registering plugin hooks to extend owner block profile menu.
authorNick Whitt <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 21 May 2010 21:57:36 +0000 (21:57 +0000)
committerNick Whitt <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 21 May 2010 21:57:36 +0000 (21:57 +0000)
git-svn-id: http://code.elgg.org@6131 36083f99-b078-4883-b0ff-0f9b5a30f544

start.php

index 0d275cfbea058ee1e0d2af06f1ace402c3138c4a..6dfcce552ff585844f4801ecb926b640b13fd18a 100644 (file)
--- a/start.php
+++ b/start.php
@@ -40,6 +40,9 @@ function videolist_init() {
 
        // Register entity type
        register_entity_type('object','videolist');
+       
+       // Register profile menu hook
+       register_plugin_hook('profile_menu', 'profile', 'videolist_profile_menu');
 }
 
 /**
@@ -182,6 +185,17 @@ function videolist_object_notifications_intercept($hook, $entity_type, $returnva
        return null;
 }
 
+function videolist_profile_menu($hook, $entity_type, $return_value, $params) {
+       global $CONFIG;
+       
+       $return_value[] = array(
+               'text' => elgg_echo('videolist'),
+               'href' => "{$CONFIG->url}pg/videolist/owned/{$params['owner']->username}",
+       );
+       
+       return $return_value;
+}
+
 // Register a handler for adding videos
 register_elgg_event_handler('create', 'videolist', 'videolist_create_event_listener');