You are here

public function BidiCKEditorButton::getFile in CKEditor BiDi Buttons 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/CKEditorPlugin/BidiCKEditorButton.php \Drupal\ckeditor_bidi\Plugin\CKEditorPlugin\BidiCKEditorButton::getFile()
  2. 3.x src/Plugin/CKEditorPlugin/BidiCKEditorButton.php \Drupal\ckeditor_bidi\Plugin\CKEditorPlugin\BidiCKEditorButton::getFile()

Returns the Drupal root-relative file path to the plugin JavaScript file.

Note: this does not use a Drupal library because this uses CKEditor's API.

Return value

string|false The Drupal root-relative path to the file, FALSE if an internal plugin.

Overrides CKEditorPluginInterface::getFile

See also

https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_resourceManager....

File

src/Plugin/CKEditorPlugin/BidiCKEditorButton.php, line 58
Contains \Drupal\ckeditor_bidi\Plugin\CKEditorPlugin\BidiCKEditorButton.

Class

BidiCKEditorButton
Defines the "bidi" plugin.

Namespace

Drupal\ckeditor_bidi\Plugin\CKEditorPlugin

Code

public function getFile() {
  $file_path = 'libraries/bidi/plugin.js';

  // Support for "Libaraies API" module.
  if (\Drupal::moduleHandler()
    ->moduleExists('libraries')) {
    $file_path = libraries_get_path('bidi') . '/plugin.js';
  }
  return $file_path;
}