You are here

function views_slideshow_galleria_path in Views Slideshow: Galleria 6

Return the path to the Galleria plugin.

If views_slideshow_galleria_variable_get('path') has not yet been set, then this will attempt to autodiscover the path if the galleria.js file exists within sites/all/libraries/* or sites/example.com/libraries/*. It will also set the path to views_slideshow_galleria_variable_get('path').

The library is available from http://galleria.aino.se/.

Parameters

boolean $reset: (Optional) If TRUE, then reset the variable and attempt a new autodiscovery.

Return value

string The path to the galleria.js file.

2 calls to views_slideshow_galleria_path()
views_slideshow_galleria_settings in includes/views_slideshow_galleria.admin.inc
Configure Views Slideshow: Galleria; menu callback for admin/build/views/views_slideshow_galleria.
_views_slideshow_galleria_add_js in themes/views_slideshow_galleria.theme.inc

File

./views_slideshow_galleria.module, line 60
Integrating Galleria with Views Slideshow.

Code

function views_slideshow_galleria_path($reset = FALSE) {
  static $path;
  if (!isset($path) || $reset) {
    if (!($path = views_slideshow_galleria_variable_get('path')) || $reset) {
      $files = drupal_system_listing('^galleria\\.js$', 'libraries', 'basename', 0);
      if (isset($files['galleria.js'])) {
        $path = dirname($files['galleria.js']->filename);
        views_slideshow_galleria_variable_set('path', $path);
      }
    }
  }
  return $path;
}