-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotgo.api.php
executable file
·87 lines (81 loc) · 2.62 KB
/
dotgo.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* @file
* Hooks provided by the Menu module.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Respond to a custom menu creation.
*
* This hook is used to notify modules that a custom menu has been created.
* Contributed modules may use the information to perform actions based on the
* information entered into the menu system.
*
* @param $menu
* An array representing a custom menu:
* - dotgo_name: The unique name of the custom menu.
* - title: The human readable menu title.
* - description: The custom menu description.
*
* @see hook_dotgo_update()
* @see hook_dotgo_delete()
*/
function hook_dotgo_insert($menu) {
// For example, we track available menus in a variable.
$my_menus = variable_get('my_module_menus', array());
$my_menus[$menu['dotgo_name']] = $menu['dotgo_name'];
variable_set('my_module_menus', $my_menus);
}
/**
* Respond to a custom menu update.
*
* This hook is used to notify modules that a custom menu has been updated.
* Contributed modules may use the information to perform actions based on the
* information entered into the menu system.
*
* @param $menu
* An array representing a custom menu:
* - dotgo_name: The unique name of the custom menu.
* - title: The human readable menu title.
* - description: The custom menu description.
* - old_name: The current 'dotgo_name'. Note that internal menu names cannot
* be changed after initial creation.
*
* @see hook_dotgo_insert()
* @see hook_dotgo_delete()
*/
function hook_dotgo_update($menu) {
// For example, we track available menus in a variable.
$my_menus = variable_get('my_module_menus', array());
$my_menus[$menu['dotgo_name']] = $menu['dotgo_name'];
variable_set('my_module_menus', $my_menus);
}
/**
* Respond to a custom menu deletion.
*
* This hook is used to notify modules that a custom menu along with all links
* contained in it (if any) has been deleted. Contributed modules may use the
* information to perform actions based on the information entered into the menu
* system.
*
* @param $menu
* An array representing a custom menu:
* - dotgo_name: The unique name of the custom menu.
* - title: The human readable menu title.
* - description: The custom menu description.
*
* @see hook_dotgo_insert()
* @see hook_dotgo_update()
*/
function hook_dotgo_delete($menu) {
// Delete the record from our variable.
$my_menus = variable_get('my_module_menus', array());
unset($my_menus[$menu['dotgo_name']]);
variable_set('my_module_menus', $my_menus);
}
/**
* @} End of "addtogroup hooks".
*/