You are here

protected function N1EDEcosystemCKEditorPlugin::addJsonToForm in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8

1 call to N1EDEcosystemCKEditorPlugin::addJsonToForm()
n1ed::addControlsToForm in src/Plugin/CKEditorPlugin/n1ed.php
Adds controls to form using this class methods.

File

src/Plugin/N1EDEcosystemCKEditorPlugin.php, line 192

Class

N1EDEcosystemCKEditorPlugin
Defines plugin.

Namespace

Drupal\n1ed\Plugin

Code

protected function addJsonToForm(&$form, $settings, $param, $default) {
  $form[$param] = array(
    '#type' => 'textarea',
    '#title' => $param,
    '#title_display' => 'invisible',
    '#default_value' => $this
      ->getConfigParam($settings, $param, $default, 'string'),
    '#attributes' => array(
      'style' => 'display: none!important',
      'data-n1ed-eco-param-name' => $param,
      'data-n1ed-eco-param-type' => 'json',
      'data-n1ed-eco-param-default' => $default,
    ),
  );
}