You are here

function plupload_library_path in Plupload integration 6

Finds the path to the plupload library directory. 1. Check sites/all/libraries 2. If the library_api module exists and the appropriate APIs are available, use it. 3. Look in the module's directory.

3 calls to plupload_library_path()
plupload_requirements in ./plupload.install
@file Install, update and uninstall functions for the plupload module.
plupload_upload_page in ./plupload.module
Page callback for the bulk uploader.
theme_plupload_uploader in ./plupload.module
Theme function to return the uploader. (Once JS has it's way with it.)

File

./plupload.module, line 381

Code

function plupload_library_path() {
  static $plupload_dir = NULL;

  // Short-circuit if we're cached
  if (isset($plupload_dir) && file_exists($plupload_dir)) {
    return $plupload_dir;
  }
  $dirs = array(
    'sites/all/libraries/plupload',
    module_exists('libraries') ? libraries_get_path('plupload') : NULL,
    drupal_get_path('module', 'plupload') . '/plupload',
  );
  foreach ($dirs as $dir) {
    if (isset($dir) && file_exists($dir)) {
      $plupload_dir = $dir;
      return $plupload_dir;
    }
  }
  return FALSE;
}