[drupal-devel] menu system idea

Bèr Kessels berdrupal at tiscali.be
Sun Jun 19 07:16:51 UTC 2005


Chris,

Op zondag 19 juni 2005 06:34, schreef Chris Johnson:
> Adrian Rossouw wrote:
> >> It might also simplify the menu system to the point where mere
> >> mortals can understand it =)
>
> I appreciate the effort to simplify the menu system, but your examples of
> multi-dimensional arrays make my brain hurt even more than the current menu
> system arrangement.  :-/

   $menu[item]             = array('title' => 'root page', 
                                                 'callback' =>'root_page');
   $menu['node'][item] = array('title' => 'listing',
                                                'callback' =>'node_listing');
   $menu['node']['add']['blog']['here'][item] 
                                   = array('title' =>'blog entry',
                                   'callback' => 'some_func' );
   $menu['node']['add'][item] 
                                   = array('title' => 'create content',
                                                'callback' => 'node_page');


 $menu['node'][item] would replace your current 'path' => 'node/item'

Is the part to look at, The other part is, afaik only to show how easy it is 
to handle the menus in the rest of the code, not in your code!

Alternatively, Adrian, if people really do not like this new idea of your (I 
like it), an option would be to add extra logic in core that first iterates 
over all menus, and creates your multidim. arrays from the 'path/to' 
variables? 

Regards,
 Bèr
-- 
 [ Bèr Kessels | Drupal services www.webschuur.com ]



More information about the drupal-devel mailing list