You are here

function photoswipe_get_version in PhotoSwipe 7

Get photoswipe version.

2 calls to photoswipe_get_version()
photoswipe_init in ./photoswipe.module
Implements hook_init().
photoswipe_requirements in ./photoswipe.install
Implements hook_requirements().

File

./photoswipe.module, line 204
Photswipe integration with Drupal module.

Code

function photoswipe_get_version($path = NULL) {
  $version = drupal_static(__FUNCTION__);
  if (!empty($version)) {
    return $version;
  }
  if (!$path) {
    $path = libraries_get_path('photoswipe');
  }
  foreach (glob($path . "/code.photoswipe.jquery-*.min.js") as $filename) {
    $version = str_replace(array(
      $path,
      '/code.photoswipe.jquery-',
      '.min.js',
    ), '', $filename);
  }
  return $version;
}