You are here

function _epsacrop_jcrop_get_version in EPSA Crop - Image Cropping 7.2

Same name and namespace in other branches
  1. 8.2 epsacrop.module \_epsacrop_jcrop_get_version()

Return the version of jcrop library.

@access public

Return value

void

1 call to _epsacrop_jcrop_get_version()
epsacrop_requirements in ./epsacrop.install
Implementation of hook_requirements.

File

./epsacrop.module, line 884
The main file of module

Code

function _epsacrop_jcrop_get_version() {
  $version = 0;
  $filepath = libraries_get_path('Jcrop') . '/js/jquery.Jcrop.js';
  if (file_exists($filepath)) {
    $lines = file($filepath);
    array_shift($lines);

    // First line is simple comment
    if (preg_match('/v(.*)/', array_shift($lines), $matches)) {
      $version = $matches[1];
    }
    else {
      drupal_set_message(t('Could be give the version of Jcrop %path, check your install.', array(
        '%path' => $filepath,
      )), 'error');
      $version = 0;
    }
  }
  return $version;
}