public function FieldPluginBase::submitOptionsForm in Drupal 8
Same name and namespace in other branches
- 9 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::submitOptionsForm()
Performs some cleanup tasks on the options array before saving it.
Overrides PluginBase::submitOptionsForm
1 call to FieldPluginBase::submitOptionsForm()
- NumericField::submitOptionsForm in core/
modules/ views/ src/ Plugin/ views/ field/ NumericField.php - Performs some cleanup tasks on the options array before saving it.
1 method overrides FieldPluginBase::submitOptionsForm()
- NumericField::submitOptionsForm in core/
modules/ views/ src/ Plugin/ views/ field/ NumericField.php - Performs some cleanup tasks on the options array before saving it.
File
- core/
modules/ views/ src/ Plugin/ views/ field/ FieldPluginBase.php, line 493
Class
- FieldPluginBase
- Base class for views fields.
Namespace
Drupal\views\Plugin\views\fieldCode
public function submitOptionsForm(&$form, FormStateInterface $form_state) {
$options =& $form_state
->getValue('options');
$types = [
'element_type',
'element_label_type',
'element_wrapper_type',
];
$classes = array_combine([
'element_class',
'element_label_class',
'element_wrapper_class',
], $types);
foreach ($types as $type) {
if (!$options[$type . '_enable']) {
$options[$type] = '';
}
}
foreach ($classes as $class => $type) {
if (!$options[$class . '_enable'] || !$options[$type . '_enable']) {
$options[$class] = '';
}
}
if (empty($options['custom_label'])) {
$options['label'] = '';
$options['element_label_colon'] = FALSE;
}
}