function hook_variable_group_info in Variable 6
Same name and namespace in other branches
- 7.2 variable.api.php \hook_variable_group_info()
- 7 variable.api.php \hook_variable_group_info()
Define groups of variables used by a module.
Variable groups are used for presentation only, to display and edit the variables on manageable groups. Groups can define a subset of a module's variables and can be reused accross modules to group related variables.
A form to edit all variables in a group can be generated with:
drupal_get_form('variable_group_form', group_name);
Return value
An array of information defining variable types. The array contains a sub-array for each variable group, with the group as the key. Possible attributes:
- "title": The human readable name of the group. Must be localized.
- "description": The human readable description of the group. Must be localized.
- "access": Permission required to edit group's variables. Will default to 'administer site configuration'.
- "path": Array of administration paths where these variables can be accessed.
4 functions implement hook_variable_group_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- node_variable_group_info in includes/
node.variable.inc - Node module variable groups
- system_variable_group_info in includes/
system.variable.inc - Node module variable groups
- user_variable_group_info in includes/
user.variable.inc - Node module variable groups
- variable_variable_group_info in ./
variable.variable.inc - Implements hook_variable_group_info().
1 invocation of hook_variable_group_info()
- variable_build_groups in ./
variable.inc - Build variable groups information
File
- ./
variable.api.php, line 184 - Hooks provided by the Variable module.
Code
function hook_variable_group_info() {
$groups['system_site_information'] = array(
'title' => t('Site information'),
'description' => t('Site information and maintenance mode'),
'access' => 'administer site configuration',
'path' => array(
'admin/settings/site-information',
'admin/settings/site-maintenance',
),
);
$groups['system_feed_settings'] = array(
'title' => t('Feed settings'),
'description' => t('Feed settings'),
'access' => 'administer site configuration',
);
return $groups;
}