You are here

function epsacrop_jcrop_get_version in EPSA Crop - Image Cropping 6

Same name and namespace in other branches
  1. 6.2 epsacrop.module \epsacrop_jcrop_get_version()
1 call to epsacrop_jcrop_get_version()
epsacrop_requirements in ./epsacrop.install

File

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

Code

function epsacrop_jcrop_get_version() {
  $vresion = 0;
  if (file_exists(EPSACROP_JCROP_PATH . '/js/jquery.Jcrop.js')) {
    $lines = file(EPSACROP_JCROP_PATH . '/js/jquery.Jcrop.js');
    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, check your install'), 'error');
      $version = 0;
    }
  }
  return $version;
}