You are here

public function CKEditor::getAttachments in Editor 7

Implements QuickEditInPlaceEditorInterface::getAttachments().

Overrides QuickEditInPlaceEditorInterface::getAttachments

See also

Drupal 8's \Drupal\editor\Plugin\quickedit\editor\Editor::getAttachments().

File

InPlaceEditors/CKEditor.php, line 64

Class

CKEditor
Defines the CKEditor in-place editor.

Code

public function getAttachments() {
  global $user;

  // Get a list of formats to which the current user has access.
  $formats = filter_formats($user);

  // Get filter configuration information for the available formats.
  $settings = editor_get_attached($formats);

  // Also include editor.module's formatted text editor.
  $settings['library'][] = array(
    'editor',
    'quickedit.inPlaceEditor.formattedText',
  );
  $settings['js'][] = array(
    'type' => 'setting',
    'data' => array(
      'quickedit' => array(
        'ckeditor' => array(
          'basePath' => base_path() . drupal_get_path('module', 'editor_ckeditor') . '/lib/ckeditor/',
        ),
      ),
    ),
  );
  return $settings;
}