You are here

function _panopoly_wysiwyg_set_editor_linkit in Panopoly WYSIWYG 8.2

Sets the linkit plugin into the editor.

Parameters

string $editor_id: The editor ID.

1 call to _panopoly_wysiwyg_set_editor_linkit()
panopoly_wysiwyg_update_8207 in ./panopoly_wysiwyg.install
Installs and configures editor_advanced_link and linkit.

File

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

Code

function _panopoly_wysiwyg_set_editor_linkit($editor_id) {
  if (!($editor = Editor::load($editor_id))) {
    return;
  }

  // Only update ckeditor.
  if ($editor
    ->getEditor() != 'ckeditor') {
    return;
  }
  $settings = $editor
    ->get('settings');
  $settings['plugins']['drupallink']['linkit_enabled'] = TRUE;
  $settings['plugins']['drupallink']['linkit_profile'] = 'default';
  $editor
    ->setSettings($settings);
  $editor
    ->save();
}