5 * Hooks provided by the Menu module.
14 * Respond to a custom menu creation.
16 * This hook is used to notify modules that a custom menu has been created.
17 * Contributed modules may use the information to perform actions based on the
18 * information entered into the menu system.
21 * An array representing a custom menu:
22 * - menu_name: The unique name of the custom menu.
23 * - title: The human readable menu title.
24 * - description: The custom menu description.
26 * @see hook_menu_update()
27 * @see hook_menu_delete()
29 function hook_menu_insert($menu) {
30 // For example, we track available menus in a variable.
31 $my_menus = variable_get('my_module_menus', array());
32 $my_menus[$menu['menu_name']] = $menu['menu_name'];
33 variable_set('my_module_menus', $my_menus);
37 * Respond to a custom menu update.
39 * This hook is used to notify modules that a custom menu has been updated.
40 * Contributed modules may use the information to perform actions based on the
41 * information entered into the menu system.
44 * An array representing a custom menu:
45 * - menu_name: The unique name of the custom menu.
46 * - title: The human readable menu title.
47 * - description: The custom menu description.
48 * - old_name: The current 'menu_name'. Note that internal menu names cannot
49 * be changed after initial creation.
51 * @see hook_menu_insert()
52 * @see hook_menu_delete()
54 function hook_menu_update($menu) {
55 // For example, we track available menus in a variable.
56 $my_menus = variable_get('my_module_menus', array());
57 $my_menus[$menu['menu_name']] = $menu['menu_name'];
58 variable_set('my_module_menus', $my_menus);
62 * Respond to a custom menu deletion.
64 * This hook is used to notify modules that a custom menu along with all links
65 * contained in it (if any) has been deleted. Contributed modules may use the
66 * information to perform actions based on the information entered into the menu
70 * An array representing a custom menu:
71 * - menu_name: The unique name of the custom menu.
72 * - title: The human readable menu title.
73 * - description: The custom menu description.
75 * @see hook_menu_insert()
76 * @see hook_menu_update()
78 function hook_menu_delete($menu) {
79 // Delete the record from our variable.
80 $my_menus = variable_get('my_module_menus', array());
81 unset($my_menus[$menu['menu_name']]);
82 variable_set('my_module_menus', $my_menus);
86 * @} End of "addtogroup hooks".