Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2010 at 08:51 UTC
Updated:
15 Sep 2010 at 20:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
darren ohComment #2
jhodgdonHmmm. Is that true? Does it apply to Drupal 6 as well? And under what circumstances are the options used -- only if it is displayed in your Primary Links or another menu, or is it also used if you are on for instance the Configuration page that displays all the admin/configure page links?
If it is true, I would like to see this reworded slightly to say something like "An array of options to be passed to l() when generating the menu link", and then describe when exactly it's used.
Comment #3
jhodgdonI did some investigating.
It seems that this applies to anything that is marked as MENU_VISIBLE_IN_BREADCRUMB, and that these options are merged with some defaults and saved in the menu links table. See http://api.drupal.org/api/constant/MENU_VISIBLE_IN_BREADCRUMB/7 -- which includes MENU_DEFAULT_LOCAL_TASK, MENU_LOCAL_ACTION, MENU_LOCAL_TASK, MENU_NORMAL_ITEM, and MENU_SUGGESTED_ITEM.
But I'm not sure when exactly these are used in rendering.
Comment #4
darren ohRendering happens in theme_menu_link() in Drupal 7 and in theme_menu_item_link() in Drupal 6.
Comment #5
jhodgdonI think it's also happening in breadcrumb theming.
Comment #6
darren ohI think it’s safe to say the options array is used whenever links are rendered.
Drupal 7:
_menu_overview_tree_form()
theme_menu_link
theme_menu_local_task()
theme_menu_local_action()
menu_get_active_breadcrumb
theme_node_add_list
system_main_admin_page
theme_admin_block_content
Drupal 6:
_menu_overview_tree_form
theme_menu_item_link
menu_get_active_breadcrumb
theme_node_add_list
theme_admin_block_content
Comment #7
jhodgdonOK. Then we just need a minor rewording as I suggested in #2... How about:
An array of options to be passed to l() when generating a link from this menu item.
Comment #8
darren ohSounds good to me.
Comment #9
jhodgdonLooks good, thanks!
If committed, we should also port this to D6.
Comment #10
jhodgdon#8: system.api_.php-888747-8.patch queued for re-testing.
Comment #11
dries commentedIs theme_menu_link() even used?
Comment #12
jhodgdonYes, theme_menu_link() is being used, at least by default.
Where/how: http://api.drupal.org/api/function/menu_tree_output/7 puts #theme = 'menu_link__' . $data['link']['menu_name'] on each menu item it sets up for rendering, which will default back to looking for theme('menu_link') if the specific theme function doesn't exist, according to http://api.drupal.org/api/function/theme/7 (and you can see this happening in the code too).
That function menu_tree_output() is called from several functions that build menus for output, such as menu_tree() (which is used by several modules to render menus) and some book module functions.
Comment #13
dries commentedLooks like I committed this patch already along with another patch. Sorry for omitting the proper credit! :/