You are here

function isotope_check_additional_libraries in Isotope (with Masonry and Packery) 7.2

Check for all additional libraries.

Return the ones that have been detected, or an empty array. If passed a specific libname to check for, will return the path to the library or FALSE.

3 calls to isotope_check_additional_libraries()
isotope_addjs in ./isotope.module
Function to add the right version of the js file.
isotope_ctools_export_ui_form in plugins/export_ui/isotope_ctools_export_ui.inc
Define the configuration add/edit form.
isotope_default_isotope_configuration in ./isotope.module
Implements hook_default_isotope_preset().

File

./isotope.module, line 237
Load the isotope library and provide configuration and theme options.

Code

function isotope_check_additional_libraries($libname = FALSE) {
  $detected_libraries = array();
  $libraries = isotope_additional_libraries_list();
  if (function_exists('libraries_get_path')) {
    foreach ($libraries as $lib_name => $library) {

      // Check both for files inside the "isotope" folder and files inside a
      // plugin-named folder.
      $layout_path = libraries_get_path('isotope') . '/' . $library['filename'];
      if (file_exists($layout_path) === TRUE) {
        $detected_libraries[$layout_path] = $lib_name;
      }
      $plugin_path = libraries_get_path($lib_name) . '/' . $library['filename'];
      if (file_exists($plugin_path) === TRUE) {
        $detected_libraries[$plugin_path] = $lib_name;
      }
    }
  }
  if ($libname && in_array($libname, $detected_libraries)) {
    return array_search($libname, $detected_libraries);
  }
  elseif ($libname) {
    return FALSE;
  }
  return $detected_libraries;
}