menu.inc

Version 1.255.2.32 (checked in on 2009/10/06 at 11:59:05 by goba)

API for the Drupal menu system.

Constants

NameDescription
MENU_ACCESS_DENIED
MENU_CALLBACKCallbacks simply register a path so that the correct function is fired when the URL is accessed. They are not shown in the menu.
MENU_CREATED_BY_ADMIN
MENU_DEFAULT_LOCAL_TASKEvery set of local tasks should provide one "default" task, that links to the same path as its parent when clicked.
MENU_FOUND
MENU_IS_LOCAL_TASK
MENU_IS_ROOT
MENU_LINKS_TO_PARENT
MENU_LOCAL_TASKLocal tasks are rendered as tabs by default. Use this for menu items that describe actions to be performed on their parent item. An example is the path "node/52/edit", which performs the "edit" task on "node/52".
MENU_MAX_DEPTHThe maximum depth of a menu links tree - matches the number of p columns.
MENU_MAX_PARTSThe maximum number of path elements for a menu callback
MENU_MODIFIED_BY_ADMIN
MENU_NORMAL_ITEMNormal menu items show up in the menu tree and can be moved/hidden by the administrator. Use this for most menu items. It is the default value if no menu item type is specified.
MENU_NOT_FOUND
MENU_SITE_OFFLINE
MENU_SUGGESTED_ITEMModules may "suggest" menu items that the administrator may enable. They act just as callbacks do until enabled, at which time they act like normal items. Note for the value: 0x0010 was a flag which is no longer used, but this way the values...
MENU_VISIBLE_IN_BREADCRUMB
MENU_VISIBLE_IN_TREE

Functions

NameDescription
drupal_help_argGenerates elements for the $arg array in the help hook.
menu_cache_clearClears the cached cached data for a single named menu.
menu_cache_clear_allClears all cached menu data. This should be called any time broad changes might have been made to the router items or menu links.
menu_execute_active_handlerExecute the page callback associated with the current path
menu_get_active_breadcrumbGet the breadcrumb for the current page, as determined by the active trail.
menu_get_active_helpReturns the help associated with the active menu item.
menu_get_active_menu_nameGet the active menu for the current page - determines the active trail.
menu_get_active_titleGet the title of the current page, as determined by the active trail.
menu_get_active_trailGets the active trail (path to root menu root) of the current page.
menu_get_ancestorsReturns the ancestors (and relevant placeholders) for any given path.
menu_get_itemGet a router item.
menu_get_namesBuild a list of named menus.
menu_get_objectGet a loaded object from a router item.
menu_link_children_relative_depthFind the depth of an item's children relative to its depth.
menu_link_deleteDelete one or several menu links.
menu_link_loadGet a menu link by its mlid, access checked and link translated for rendering.
menu_link_maintainInsert, update or delete an uncustomized menu link related to a module.
menu_link_saveSave a menu link.
menu_list_system_menusReturn an array containing the names of system-defined (default) menus.
menu_local_tasksCollects the local tasks (tabs) for a given level.
menu_navigation_linksReturn an array of links for a navigation menu.
menu_path_is_externalReturns TRUE if a path is external (e.g. http://example.com).
menu_primary_linksReturn an array of links to be rendered as the Primary links.
menu_primary_local_tasksReturns the rendered local tasks at the top level.
menu_rebuild(Re)populate the database tables used by various menu functions.
menu_router_buildCollect, alter and store the menu definitions.
menu_secondary_linksReturn an array of links to be rendered as the Secondary links.
menu_secondary_local_tasksReturns the rendered local tasks at the second level.
menu_set_active_itemSet the active path, which determines which page is loaded.
menu_set_active_menu_nameSet (or get) the active menu for the current page - determines the active trail.
menu_set_active_trailSets or gets the active trail (path to root menu root) of the current page.
menu_set_itemReplaces the statically cached item for a given path.
menu_tab_root_pathReturns the router path, or the path of the parent tab of a default local task.
menu_tail_to_arg
menu_treeRender a menu tree based on the current path.
menu_tree_all_dataGet the data structure representing a named menu tree.
menu_tree_check_accessCheck access and perform other dynamic operations for each link in the tree.
menu_tree_collect_node_linksRecursive helper function - collect node links.
menu_tree_dataBuild the data representing a menu tree.
menu_tree_outputReturns a rendered menu tree.
menu_tree_page_dataGet the data structure representing a named menu tree, based on the current page.
menu_unserializeThe menu system uses serialized arrays stored in the database for arguments. However, often these need to change according to the current path. This function unserializes such an array and does the necessary change.
menu_valid_pathValidates the path of a menu link being created or edited.
theme_menu_itemGenerate the HTML output for a menu item and submenu.
theme_menu_item_linkGenerate the HTML output for a single menu link.
theme_menu_local_taskGenerate the HTML output for a single local task link.
theme_menu_local_tasksReturns the rendered local tasks. The default implementation renders them as tabs.
theme_menu_treeGenerate the HTML output for a menu tree
_menu_check_accessCheck access to a menu item using the access callback
_menu_clear_page_cacheHelper function to clear the page and block caches at most twice per page load.
_menu_delete_itemHelper function for menu_link_delete; deletes a single menu link.
_menu_find_router_pathFind the router path which will serve this path.
_menu_item_localizeLocalize the router item title using t() or another callback.
_menu_link_buildBuilds a link from a router item.
_menu_link_map_translateThis function translates the path elements in the map using any to_arg helper function. These functions take an argument and return an object. See http://drupal.org/node/109153 for more information.
_menu_link_move_childrenUpdate the children of a menu link that's being moved.
_menu_link_parents_setHelper function that sets the p1..p9 values for a menu link being saved.
_menu_link_translateThis function is similar to _menu_translate() but does link-specific preparation such as always calling to_arg functions.
_menu_load_objectsLoads objects into the map as defined in the $item['load_functions'].
_menu_navigation_links_rebuildHelper function to build menu links for the items in the menu router.
_menu_router_buildHelper function to build the router table based on the data from hook_menu.
_menu_router_cacheHelper function to store the menu router if we have it in memory.
_menu_set_expanded_menusHelper function to update a list of menus with expanded items
_menu_site_is_offlineChecks whether the site is off-line for maintenance.
_menu_translateHandles dynamic path translation and menu access control.
_menu_tree_check_accessRecursive helper function for menu_tree_check_access()
_menu_tree_cidHelper function - compute the real cache ID for menu tree data.
_menu_tree_dataRecursive helper function to build the data representing a menu tree.
_menu_update_parental_statusCheck and update the has_children status for the parent of a link.
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.