function locale_variable_language_default_element in Variable 7.2
Same name and namespace in other branches
- 7 includes/locale.variable.inc \locale_variable_language_default_element()
 
Form element for site default language
1 string reference to 'locale_variable_language_default_element'
- locale_variable_info in includes/
locale.variable.inc  - Implements hook_variable_info().
 
File
- includes/
locale.variable.inc, line 58  - Variable API module. Definition for Drupal core variables
 
Code
function locale_variable_language_default_element($variable, $options) {
  $element = variable_form_element_options($variable, $options);
  // Default needs to be language code for the radios to work.
  $element['#default_value'] = $element['#default_value']->language;
  // Since 'value callback' is useless as it is run before validation, we use validate
  // callback to transform language code into an object.
  $element['#element_validate'][] = 'locale_variable_language_element_validate';
  return $element;
}