-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem_settings.api.module
101 lines (94 loc) · 2.27 KB
/
system_settings.api.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* @file
* Provide example implementations and documentation
* for system_settings api capabilities.
*/
//
$setting = array(
'name' => $name,
'value' => $value,
'description' => $description,
'always_load' => $always_load,
'modules' => array(
'views' => array(
'requires' => TRUE,
'required by' => TRUE,
),
'content' => array(
'requires' => TRUE,
'required by' => TRUE,
'callback' => 'content_update_setting', // Not a real function (yours should be).
),
),
'entities' => array(
array(
'entity' => 'node',
'type' => 'type',
'identifier' => 'story',
'requires' => TRUE,
'required by' => TRUE,
),
array(
'entity' => 'node',
'type' => 'type',
'identifier' => 'page',
'requires' => TRUE,
'required by' => FALSE,
),
),
'groups' => array(
'Ubercart' => array(
'Payment',
),
),
);
/**
* Implemenation of hook_system_settings().
*/
function hook_system_settings() {
$settings = array();
$settings['system_settings_handlers'] = array(
'modules' => array('views');
'groups' => array('system_settings');
'setting' => array(
'system_settings_log' => 'default',
'system_settings_settings' => 'default',
);
);
return $settings;
}
/**
* Implementation of hook_system_settings_alter().
*/
function hook_system_settings_alter(&$settings) {
if (isset($settings['system_settings']['handlers']['system_settings_log'])) {
$settings['system_settings']['handlers']['system_settings_log'] = 'static_files';
}
}
// Overriding system_settings can be done from settings.php. This will
// override what is in code, stored in the database, and even cached.
// For now this is set as part of conf, eventually it probably replaces it.
$conf['system_settings_conf'] = array(
'system_settings_handlers' =>array(
'modules' => array('Garland'),
'value' => array(
'system_settings_log' => 'static_files',
),
),
);
/**
* Implementation of hook_system_settings_update_handler().
*/
function hook_system_settings_update_handler() {
}
/**
* Implementation of hook_system_settings_groups()
*/
function hook_system_settings_groups() {
$groups = array(
'views',
'ubercart',
);
return $groups;
}