You are here

function panopoly_wysiwyg_update_8209 in Panopoly WYSIWYG 8.2

Enable the 'kitchensink' plugin.

File

./panopoly_wysiwyg.install, line 469
Install hooks for Panopoly WYSIWYG.

Code

function panopoly_wysiwyg_update_8209() {
  $editor_names = [
    'panopoly_wysiwyg_basic',
    'panopoly_wysiwyg_full',
  ];
  foreach ($editor_names as $editor_name) {
    if ($editor = Editor::load($editor_name)) {
      $settings = $editor
        ->getSettings();
      foreach ($settings['toolbar']['rows'][0] as &$group) {
        if ($group['name'] === 'Tools') {
          $group['items'][] = 'panopoly_wysiwyg_kitchensink';
        }
      }
      $editor
        ->setSettings($settings);
      $editor
        ->save();
    }
  }
}