You are here

public function Name::validateExposed in Views (for Drupal 7) 8.3

Validate the exposed handler form

Overrides HandlerBase::validateExposed

File

lib/Views/user/Plugin/views/filter/Name.php, line 78
Definition of Views\user\Plugin\views\filter\Name.

Class

Name
Filter handler for usernames.

Namespace

Views\user\Plugin\views\filter

Code

public function validateExposed(&$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 = drupal_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;
  }
}