Create user menu

So I have been doing some searching around with no luck. What I am looking for is a way to make a user menu like what Facebook has that will allow you to selecet a group you are members of and also to hose the links for Administration (Admins option only), User Settings and the Log out option.

I know how to make an Elgg menu but how do I hide the current options from users.

  • I got it to remove the Administration with the same code as above just had to make sure what it was called. now I am trying to remove all calls for items in the Owner_Block which should be done the same way.

    The only issue I am now having is with removing Izaps Video and HypeGallery Owner_Block menu item

  • The only issue I am now having is with removing Izaps Video and HypeGallery from the Owner_Block menu. Dose any one know how these are called as I have looked through the start.php and must be blind

  • some menus are context sensitive, eg. the owner block, entity menu, and the user hover menu all need to know what owner/entity/user the menu is for.  This can't be done at the time of initialization, so it uses a plugin hook system.  Seems complicated at first but it's actually really useful and extensible.

    http://community.elgg.org/discussion/view/713340/elgg-blog-elggs-new-menu-system-registering-a-menu-item

    http://blog.elgg.org/pg/blog/cash/read/191/elggs-new-menu-system-dynamic-menus

     

    So what you want to do is register a handler for the 'register', 'menu:owner_block'.  The return value of the handler is an array of the menu items, so in your handler you add/edit/remove any of the menu items you choose.

  • @Matt Beckett Thanks for the adivce and that is the way I was going I just can not seam to figure out what Izaps Videos and the HypeGallery call for there menu items so I can disable them in the manner you discribed.


    Have asked on the plugin pages so will have to just wait and see.

  • @FusionOz: the developers plugin bundled with Elgg core can be used to find out which callback functions are registered for particular plugin hooks (in admin backend: "Develop" - "Tools" - "Inspect").

    For example you can check which functions are registered for the 'register', 'menu:owner_block' plugin hook. If you know the name, you can search in the plugin code for these functions. The functions itself are not necessarily within start.php (while the elgg_register_plugin_hook_handler() call normally is). Fulltext search ("grep") on the code should tell you where the callback functions are.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking