Provide the default form for setting options.
Overrides ArgumentValidatorPluginBase::buildOptionsForm
public function buildOptionsForm(&$form, &$form_state) {
$form['type'] = array(
'#type' => 'radios',
'#title' => t('Type of user filter value to allow'),
'#options' => array(
'uid' => t('Only allow numeric UIDs'),
'name' => t('Only allow string usernames'),
'either' => t('Allow both numeric UIDs and string usernames'),
),
'#default_value' => $this->options['type'],
);
$form['restrict_roles'] = array(
'#type' => 'checkbox',
'#title' => t('Restrict user based on role'),
'#default_value' => $this->options['restrict_roles'],
);
$form['roles'] = array(
'#type' => 'checkboxes',
'#title' => t('Restrict to the selected roles'),
'#options' => array_map('check_plain', user_roles(TRUE)),
'#default_value' => $this->options['roles'],
'#description' => t('If no roles are selected, users from any role will be allowed.'),
'#states' => array(
'visible' => array(
':input[name="options[validate][options][user][restrict_roles]"]' => array(
'checked' => TRUE,
),
),
),
);
}