Options form subform for setting options.
This should be overridden by all child classes and it must define $form['value']
Overrides InOperator::valueForm
buildOptionsForm()
protected function valueForm(&$form, &$form_state) {
$values = array();
if ($this->value) {
$result = entity_load_multiple_by_properties('user', array(
'uid' => $this->value,
));
foreach ($result as $account) {
if ($account
->id()) {
$values[] = $account->name->value;
}
else {
$values[] = 'Anonymous';
// Intentionally NOT translated.
}
}
}
sort($values);
$default_value = implode(', ', $values);
$form['value'] = array(
'#type' => 'textfield',
'#title' => t('Usernames'),
'#description' => t('Enter a comma separated list of user names.'),
'#default_value' => $default_value,
'#autocomplete_path' => 'user/autocomplete/anonymous',
);
if (!empty($form_state['exposed']) && !isset($form_state['input'][$this->options['expose']['identifier']])) {
$form_state['input'][$this->options['expose']['identifier']] = $default_value;
}
}