-
Notifications
You must be signed in to change notification settings - Fork 1
/
nestedbox_core.module
72 lines (61 loc) · 1.53 KB
/
nestedbox_core.module
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
<?php
require_once __DIR__ . '/nestedbox.public.inc';
/**
* Implements hook_module_implements_alter()
*
* @param array $implementations
* Array of the format $implementations[$module] = $group|false.
* @param string $hook
*/
function nestedbox_core_module_implements_alter(&$implementations, $hook) {
switch ($hook) {
case 'menu_alter':
// Push these implementations to the end.
// $group will be changed further down.
$group = FALSE;
unset($implementations['nestedbox_core']);
}
switch ($hook) {
case 'menu_alter':
case 'admin_menu_map':
$group = 'menu';
break;
case 'entity_info':
case 'entity_info_alter':
case 'entity_property_info':
case 'entity_operation_info':
$group = 'entity';
break;
case 'theme':
$group = 'theme';
break;
}
if (!isset($group)) {
return;
}
elseif (FALSE !== $group) {
require_once __DIR__ . '/nestedbox_core.' . $group . '.inc';
}
$implementations['nestedbox_core'] = $group;
}
/**
* Implements hook_permission()
*
* @return array
*/
function nestedbox_core_permission() {
return array(
'administer nestedbox types' => array(
'title' => t('Administer Nested Box entities'),
'description' => t('Perform administration tasks for my module.'),
),
);
}
/**
* Implements hook_form_FORM_ID_alter()
*
* @param array $form
*/
function nestedbox_core_form_entity_operations_operation_form_nestedbox_edit_alter(&$form) {
$form['admin_title']['#title'] = t('Administrative title');
}