You are here

function variable_format_selection in Variable 6

Same name and namespace in other branches
  1. 7.2 variable.variable.inc \variable_format_selection()
  2. 7 variable.variable.inc \variable_format_selection()

Format select variable

1 string reference to 'variable_format_selection'
variable_variable_type_info in ./variable.variable.inc
Implements hook_variable_type_info().

File

./variable.variable.inc, line 155
Variable module hook implementations

Code

function variable_format_selection($variable, $options = array()) {
  $variable = variable_build_options($variable, $options);
  if (isset($variable['value'])) {
    return isset($variable['options'][$variable['value']]) ? $variable['options'][$variable['value']] : t('<Invalid option>');
  }
  else {
    return variable_format_empty($variable);
  }
}