function variable_get_info in Variable 7.2
Same name and namespace in other branches
- 7 variable.module \variable_get_info()
Get variable information
Variable information is collected from modules and cached by language
Parameters
$name: Optional variable name. Will return all if no name.
$options array: Options for variable values
- 'langcode', Language code
Related topics
12 calls to variable_get_info()
- VariableRealmDefaultController::getAvailableVariables in variable_realm/
variable_realm.class.inc - Implementation of VariableRealmControllerInterface::getAvailableVariables().
- VariableTestCase::testVariableAPI in ./
variable.test - Test that all core modules can be enabled, disabled and uninstalled.
- variable_edit_subform in ./
variable.module - Form elements for variable list.
- variable_form_submit_callback in ./
variable.form.inc - Execute submit callbacks for variables in form.
- variable_list_group in ./
variable.inc - List variables for a group
File
- ./
variable.module, line 159 - Variable API module
Code
function variable_get_info($name = NULL, $options = array()) {
$options = _variable_options($options);
if (!$name) {
return _variable_info('variable', NULL, $options);
}
elseif ($info = _variable_info('variable', $name, $options)) {
return $info;
}
elseif ($parent = variable_parent($name)) {
$info = variable_build(variable_get_info($parent));
$child = $info['children'][$name];
// Copy over some values from parent to child to add some context to it.
$child['title'] = $info['title'] . ' [' . $child['title'] . ']';
if (isset($info['description'])) {
$child['description'] = $info['description'];
}
return $child;
}
else {
return NULL;
}
}