[development] create a block with menu links

Lluís Forns enboig at gmail.com
Wed Sep 29 15:38:35 UTC 2010


To Lee Rowlands; using just "hook_install()" is not an option; when I
make changes to my devel site, it is easier to just upload files and
clear cache than go through admin menus and repeat the changes.

To Nan Wich: I didn't know about this approach. I added my menu to
database using hook_update_n() and after changing my menu structure it
works perfect now.

--
*Les normes hi són perquè hi pensis abans de saltar-te-les
*La vida és com una taronja, què esperes a exprimir-la?
*Si creus que l'educació és cara, prova la ignorància.
*La vida és com una moneda, la pots gastar en el que vulguis però
només una vegada.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.



2010/9/29 nan wich <nan_wich at bellsouth.net>:
> 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.


More information about the development mailing list