You are here

function _variable_options in Variable 7

Same name and namespace in other branches
  1. 7.2 variable.module \_variable_options()

Normalize variable options

Will fill the following values if not present in the parameters

  • langcode, Language code
  • language, Language object
4 calls to _variable_options()
variable_build_variable in ./variable.inc
Build single variable
variable_get_default in ./variable.module
Get variable default
variable_get_info in ./variable.module
Get variable information
variable_get_value in ./variable.module
Get value for simple scalar variable

File

./variable.module, line 592
Variable API module

Code

function _variable_options($options = array()) {
  if (!empty($options['language'])) {
    $options['langcode'] = $options['language']->language;
  }
  elseif (!empty($options['langcode']) && ($list = language_list()) && isset($list[$options['langcode']])) {
    $options['language'] = $list[$options['langcode']];
  }
  else {
    $language = _variable_language();
    $options['language'] = $language;
    $options['langcode'] = $language->language;
  }
  return $options;
}