You are here

function chosen_js_path in Chosen 7

Same name and namespace in other branches
  1. 6 chosen.module \chosen_js_path()

Returns the path to the Chosen JavaScript file.

Return value

mixed The path to the JavaScript file or FALSE if no file could be found.

2 calls to chosen_js_path()
chosen_init in ./chosen.module
Implements hook_init().
chosen_requirements in ./chosen.install
Implements hook_requirements().

File

./chosen.module, line 117
General functions and hook implementations.

Code

function chosen_js_path() {
  $path = libraries_get_path('chosen');

  // Use the minified file if it exists to preserve bandwidth.
  if (file_exists($path . '/chosen/chosen.jquery.min.js')) {
    return $path . '/chosen/chosen.jquery.min.js';
  }
  elseif (file_exists($path . '/chosen/chosen.jquery.js')) {
    return $path . '/chosen/chosen.jquery.js';
  }
  return FALSE;
}