You are here

function hook_variable_realm_info in Variable 7

Same name and namespace in other branches
  1. 7.2 variable_realm/variable_realm.api.php \hook_variable_realm_info()

Provides human readable information about existing realms.

This information is mainly used to build exportable realms as Features.

Return value

array Array keyed by realm name which contains the following elements:

  • 'title', Humam readable name for the realm.
  • 'keys', Associative array with human readable names for keys.
  • 'keys callback', Callback function to provide the keys.
  • 'default key', The default key.
  • 'options', Array of variable names that may be set for this realm. If not set any variable will be allowed for this realm.
  • 'list callback', Callback function to provide variable list for this realm.
  • 'select', Boolean flag whether variables for this realm can be selected from a list.
  • 'select path', Path to variable selection form (optional).
  • 'variable name', Name for variables that belong to this realm: e.g. 'multilingual' variable/s
  • 'variable class', CSS class name for annotated variables in system settings forms.
  • 'form settings', Boolean flag, whether realm variables should be handled automatically in system settings forms.
  • 'form switcher', Boolean flag, whether a realm switcher should be auto-generated for settings forms which contain variables that belong to this realm.

See also

i18n_variable_variable_realm_info()

2 functions implement hook_variable_realm_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

variable_example_variable_realm_info in variable_example/variable_example.variable.inc
Implements hook_variable_realm_info()
variable_realm_variable_realm_info in variable_realm/variable_realm.variable.inc
Implements hook_variable_realm_info().
1 invocation of hook_variable_realm_info()
variable_realm_info in variable_realm/variable_realm.module
Get information about variable realms.

File

variable_realm/variable_realm.api.php, line 63
Documents hooks provided by Variable Realm API.

Code

function hook_variable_realm_info() {
  $realm['language'] = array(
    'title' => t('Language'),
    'keys' => locale_language_list('name', TRUE),
    'default key' => language_default('language'),
    'options' => _i18n_variable_variable_realm_list(),
    'select' => TRUE,
    'select path' => 'admin/config/regional/i18n/variable',
    'variable name' => t('multilingual'),
    'variable class' => 'i18n-variable',
    'form settings' => TRUE,
  );
  return $realm;
}