You are here

function hook_admin_menu_map in Administration menu 7.3

Same name and namespace in other branches
  1. 8.3 admin_menu.api.php \hook_admin_menu_map()

Provide expansion arguments for dynamic menu items.

The map items must be keyed by the dynamic path to expand, i.e. a menu path containing one or more '%' placeholders. Each map item may have the following properties:

  • parent: The parent menu path to link the expanded items to.
  • arguments: An array of argument sets that will be used in the expansion. Each set consists of an array of one or more placeholders, which again is an array of possible expansion values. Upon expansion, each argument is combined with every other argument from the set (technically, the cartesian product of all arguments). The expansion values may be empty; that is, you do not need to insert logic to skip map items for which no values exist, since Administration menu will take care of that.

See also

admin_menu.map.inc

6 functions implement hook_admin_menu_map()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

field_ui_admin_menu_map in ./admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Field UI module.
filter_admin_menu_map in ./admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Filter module.
menu_admin_menu_map in ./admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Menu module.
node_admin_menu_map in ./admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Node module.
taxonomy_admin_menu_map in ./admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Taxonomy module.

... See full list

2 invocations of hook_admin_menu_map()
admin_menu_js_info in ./admin_menu.module
Implements hook_js_info().
_admin_menu_tree in ./admin_menu.inc
Build the full administration menu tree from static and expanded dynamic items.

File

./admin_menu.api.php, line 25
API documentation for Administration menu.

Code

function hook_admin_menu_map() {

  // Expand content types below Structure > Content types.
  // The key denotes the dynamic path to expand to multiple menu items.
  $map['admin/structure/types/manage/%node_type'] = array(
    // Link generated items directly to the "Content types" item.
    'parent' => 'admin/structure/types',
    // Create expansion arguments for the '%node_type' placeholder.
    'arguments' => array(
      array(
        '%node_type' => array_keys(node_type_get_types()),
      ),
    ),
  );
  return $map;
}