On Mon, 28 Jul 2008 16:07:50 +0200 Florent JOUSSEAUME florent.jousseaume@makina-corpus.com wrote:
For your example, this is not a switch, but 2 modules with differents ACL. The block 'login' is displayed for 'Anonymous' and the menu is displayed for 'Authenticated user' (block Navigation).
For the element's visibility in the menu, this is with the user_access method defined in the function 'hook_menu' for each module.
It looks a bit hakish. And I still can't get it completely.
1) path user points to user_login if(uid) otherwise it should point to something else... but what is the alternative? In user_menu all paths are user/[something else] or admin/user/... I can't understand why once the user is logged in and the path user/[uid] becomes available the path /user reaches user_view
2) I can't yet understand the magic that make -My account appear in the Menu admin pages as locked. I still haven't had the time to read the code.
3) I miss how I can *render* menu with the admin interface and/or in modules. I'd expect that if I build up a $items hierarchy I could build up a menu from the "admin" interface adding a path and the menu system will take care of rendering children once I eg. put the menu in a block. What if I'd like to render the menu inside my code? I think I should use menu_tree... but well I bet there are a lot of tricks I could learn without guessing them from the API.
4) I haven't seen any tutorial, handbook... on any of the menu_ family of function. There is nothing on "Pro Drupal development" book.
thanks