1 views_handler_filter_user_name.inc views_handler_filter_user_name::exposed_validate(&$form, &$form_state)

Validate the exposed handler form

Overrides views_handler::exposed_validate

File

core/modules/user/views/views_handler_filter_user_name.inc, line 67
Definition of views_handler_filter_user_name.

Class

views_handler_filter_user_name
Filter handler for usernames.

Code

function exposed_validate(&$form, &$form_state) {
  if (empty($this->options['exposed'])) {
    return;
  }

  if (empty($this->options['expose']['identifier'])) {
    return;
  }

  $identifier = $this->options['expose']['identifier'];
  $input = $form_state['values'][$identifier];

  if ($this->options['is_grouped'] && isset($this->options['group_info']['group_items'][$input])) {
    $this->operator = $this->options['group_info']['group_items'][$input]['operator'];
    $input = $this->options['group_info']['group_items'][$input]['value'];
  }

  $values = backdrop_explode_tags($input);

  if (!$this->options['is_grouped'] || ($this->options['is_grouped'] && ($input != 'All'))) {
    $uids = $this->validate_user_strings($form[$identifier], $values);
  }
  else {
    $uids = FALSE;
  }

  if ($uids) {
    $this->validated_exposed_input = $uids;
  }
}