You are here

function _lang_dropdown_validate_output_value in Language Switcher Dropdown 7

Same name and namespace in other branches
  1. 7.2 lang_dropdown.module \_lang_dropdown_validate_output_value()

Validates output value

1 string reference to '_lang_dropdown_validate_output_value'
lang_dropdown_block_configure in ./lang_dropdown.module
Implements hook_block_configure().

File

./lang_dropdown.module, line 251

Code

function _lang_dropdown_validate_output_value($element, &$form_state, $form) {
  if ($element['#value'] == 2 && module_exists('chosen')) {
    form_error($element, t('You can\'t use chosen output directly on language dropdown switcher. You have chosen module installed. Use simple HTML select as output and chosen module will render it with the chosen library.'));
  }
  else {
    if ($element['#value'] == 2 && !_get_chosen_path()) {
      form_error($element, t('You can\'t use chosen output. You don\'t have chosen library installed.'));
    }
  }
}