You are here

private function BalloonPanelPlugin::librariesGetPath in CKEditor Balloon Panel 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/CKEditorPlugin/BalloonPanelPlugin.php \Drupal\ckeditor_balloonpanel\Plugin\CKEditorPlugin\BalloonPanelPlugin::librariesGetPath()

Gets the path of a library.

Parameters

string $name: The machine name of a library to return the path for.

string $base_path: Whether to prefix the resulting path with base_path().

Return value

string The path to the specified library or FALSE if the library wasn't found.

1 call to BalloonPanelPlugin::librariesGetPath()
BalloonPanelPlugin::getFile in src/Plugin/CKEditorPlugin/BalloonPanelPlugin.php
Returns the Drupal root-relative file path to the plugin JavaScript file.

File

src/Plugin/CKEditorPlugin/BalloonPanelPlugin.php, line 52

Class

BalloonPanelPlugin
Defines the "balloonpanel" plugin.

Namespace

Drupal\ckeditor_balloonpanel\Plugin\CKEditorPlugin

Code

private function librariesGetPath($name, $base_path = FALSE) {
  $libraries =& drupal_static(__FUNCTION__);
  if (!isset($libraries)) {
    $libraries = $this
      ->getLibraryPaths();
  }
  $path = $base_path ? base_path() : '';
  if (!isset($libraries[$name])) {
    return FALSE;
  }
  else {
    $path .= $libraries[$name];
  }
  return $path;
}