public function UserData::buildOptionsForm in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/user/src/Plugin/views/field/UserData.php \Drupal\user\Plugin\views\field\UserData::buildOptionsForm()
Default options form that provides the label widget that all fields should have.
Overrides FieldPluginBase::buildOptionsForm
File
- core/
modules/ user/ src/ Plugin/ views/ field/ UserData.php, line 75 - Contains \Drupal\user\Plugin\views\field\UserData.
Class
- UserData
- Provides access to the user data service.
Namespace
Drupal\user\Plugin\views\fieldCode
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$modules = $this->moduleHandler
->getModuleList();
$names = array();
foreach (array_keys($modules) as $name) {
$names[$name] = $this->moduleHandler
->getName($name);
}
$form['data_module'] = array(
'#title' => $this
->t('Module name'),
'#type' => 'select',
'#description' => $this
->t('The module which sets this user data.'),
'#default_value' => $this->options['data_module'],
'#options' => $names,
);
$form['data_name'] = array(
'#title' => $this
->t('Name'),
'#type' => 'textfield',
'#description' => $this
->t('The name of the data key.'),
'#default_value' => $this->options['data_name'],
);
}