protected function N1ED::addBooleanToForm in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2
Adds boolean value widget to the form.
1 call to N1ED::addBooleanToForm()
- N1ED::settingsForm in src/
Plugin/ CKEditorPlugin/ N1ED.php - Returns a settings form to configure this CKEditor plugin.
File
- src/
Plugin/ CKEditorPlugin/ N1ED.php, line 204
Class
- N1ED
- Defines plugin.
Namespace
Drupal\n1ed\Plugin\CKEditorPluginCode
protected function addBooleanToForm(&$form, $settings, $param, $default) {
$form[$param] = [
'#type' => 'textfield',
'#title' => $param,
'#title_display' => 'invisible',
'#default_value' => $this
->getConfigParam($settings, $param, $default, 'boolean') ? "true" : "false",
'#attributes' => [
'style' => 'display: none!important',
'data-n1ed-eco-param-name' => $param,
'data-n1ed-eco-param-type' => 'boolean',
'data-n1ed-eco-param-default' => $default ? "true" : "false",
],
];
}