You are here

function notifications_option_get in Notifications 7

Get value from notifications_option_* variables

These variables may be overridden for a page request without affecting the stored variables

Parameters

$name: Variable name, will be prefixed with 'notifications_option_'

$index: Optional index if it s an array variable

4 calls to notifications_option_get()
notifications_info in ./notifications.module
Invoke hook_notifications($name) on all modules and get a property from the array
notifications_option_array_get in ./notifications.module
Get an array of options indexed by type
notifications_option_array_set in ./notifications.module
Set the same property for a family of array variables
notifications_option_set in ./notifications.module
Set value from notifications_option_* variables

File

./notifications.module, line 1112
Notifications module

Code

function notifications_option_get($name, $index = NULL, $default = NULL) {
  $options =& drupal_static('notifications_options', array());
  if (!array_key_exists($name, $options)) {
    $options[$name] = variable_get('notifications_option_' . $name, NULL);
  }
  if (isset($index)) {
    return isset($options[$name][$index]) ? $options[$name][$index] : $default;
  }
  else {
    return $options[$name];
  }
}