You are here

function wysiwyg_get_path in Wysiwyg 7.2

Same name and namespace in other branches
  1. 5.2 wysiwyg.module \wysiwyg_get_path()
  2. 5 wysiwyg.module \wysiwyg_get_path()
  3. 6.2 wysiwyg.module \wysiwyg_get_path()
  4. 6 wysiwyg.module \wysiwyg_get_path()

Helper function to build paths to libraries.

Parameters

$library: The external library name to return the path for.

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

Return value

The path to the specified library.

Related topics

5 calls to wysiwyg_get_path()
wysiwyg_get_all_editors in ./wysiwyg.module
Compile a list holding all supported editors including installed editor version information.
wysiwyg_jwysiwyg_editor in editors/jwysiwyg.inc
Plugin implementation of hook_editor().
wysiwyg_markitup_editor in editors/markitup.inc
Plugin implementation of hook_editor().
wysiwyg_tinymce_editor in editors/tinymce.inc
Plugin implementation of hook_editor().
wysiwyg_yui_editor in editors/yui.inc
Plugin implementation of hook_editor().

File

./wysiwyg.module, line 1255

Code

function wysiwyg_get_path($library, $base_path = FALSE) {
  static $libraries;
  if (!isset($libraries)) {
    $libraries = wysiwyg_get_libraries();
  }
  if (!isset($libraries[$library])) {

    // Most often, external libraries can be shared across multiple sites.
    return 'sites/all/libraries/' . $library;
  }
  $path = $base_path ? base_path() : '';
  $path .= $libraries[$library];
  return $path;
}