You are here

function variable_option_list in Variable 7

Same name and namespace in other branches
  1. 7.2 variable.inc \variable_option_list()

Fetch options for variable

2 calls to variable_option_list()
variable_build_multiple in ./variable.inc
Build multiple variables
variable_build_options in ./variable.inc
Build variable with options

File

./variable.inc, line 206
Variable API module. Extended API.

Code

function variable_option_list($type, $variable, $options) {
  $cache =& drupal_static(__FUNCTION__);
  if (isset($cache[$type])) {
    return $cache[$type];
  }
  elseif ($info = variable_get_type($type)) {
    if (isset($info['options callback'])) {
      $info['options'] = variable_callback(array(
        $info['module'],
        $info['options callback'],
      ), $variable, $options);
    }
    if (!empty($info['cache'])) {
      $cache[$type] = $info['options'];
    }
    return $info['options'];
  }
  else {
    return array();
  }
}