[development] create a block with menu links

nan wich nan_wich at bellsouth.net
Wed Sep 29 13:23:40 UTC 2010


Perhaps I am confused as to why this is a confusing topic. Standard menu 
definitions can be put into any menu (which is already effectively a block). The 
menu system supports a "menu_name" parameter.
  $items['mystats'] = array(
    'title' => 'My Statistics',
    'description' => 'See my post statistics',
    'page callback' => 'mymodule_mystats',
    'access arguments' => array('view analyst statistics'),
    'type' => MENU_NORMAL_ITEM,
    'menu_name' => 'menu-analyst',
    );
So, just do this in your standard menu building code. In this case, you 
then enable the "menu-analyst" block.
 
Nancy
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.



________________________________

From: Lluís Forns
In my module I want to create a block with menu links. Which is the
correct way to do it so permissions are checked?
I thought of creating a block and add l() funcionits, but l() don't
check permission, and using if(users_accesss()) don't look smart.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100929/eb539b19/attachment.html 


More information about the development mailing list