1 views_plugin_argument_validate_user.inc views_plugin_argument_validate_user::process_summary_arguments(&$args)

Process the summary arguments for displaying.

Some plugins alter the argument so it uses something else internally. For example the user validation set's the argument to the uid, for a faster query. But there are use cases where you want to use the old value again, for example the summary.

Overrides views_plugin_argument_validate::process_summary_arguments

File

core/modules/user/views/views_plugin_argument_validate_user.inc, line 128
Definition of views_plugin_argument_validate_user.

Class

views_plugin_argument_validate_user
Validate whether an argument is a valid user.

Code

function process_summary_arguments(&$args) {
  // If the validation says the input is an username, we should reverse the
  // argument so it works for example for generation summary urls.
  $uids_arg_keys = array_flip($args);
  if ($this->options['type'] == 'name') {
    $users = user_load_multiple($args);
    foreach ($users as $uid => $account) {
      $args[$uids_arg_keys[$uid]] = $account->name;
    }
  }
}