function hook_admin_menu_map

nittany7 admin_menu.api.php hook_admin_menu_map()
cis7 admin_menu.api.php hook_admin_menu_map()
mooc7 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

7 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.

feeds_ui_admin_menu_map in modules/contrib/feeds/feeds_ui/feeds_ui.module
Implements hook_admin_menu_map().
field_ui_admin_menu_map in modules/contrib/admin_menu/admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Field UI module.
filter_admin_menu_map in modules/contrib/admin_menu/admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Filter module.
menu_admin_menu_map in modules/contrib/admin_menu/admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Menu module.
node_admin_menu_map in modules/contrib/admin_menu/admin_menu.map.inc
Implements hook_admin_menu_map() on behalf of Node module.

... See full list

1 invocation of hook_admin_menu_map()
admin_menu_tree in modules/contrib/admin_menu/admin_menu.inc
Build the full administration menu tree from static and expanded dynamic items.

File

modules/contrib/admin_menu/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;
}