You are here

function manualcrop_requirements in Manual Crop 7

Implements hook_requirements().

File

./manualcrop.install, line 10
Install, update and uninstall functions for the Manual Crop module.

Code

function manualcrop_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $libraries = array(
      'jquery.imagesloaded',
      'jquery.imgareaselect',
    );
    $t = get_t();
    foreach ($libraries as $name) {
      $info = libraries_detect($name);
      if ($info['installed']) {
        $requirements[$name] = array(
          'title' => $info['name'],
          'value' => $info['version'],
          'severity' => REQUIREMENT_OK,
        );
      }
      else {
        $requirements[$name] = array(
          'title' => $info['name'],
          'value' => $t('Not installed'),
          'description' => $t('Download and copy the <a href="@link">@name</a> library to %path.', array(
            '@link' => $info['vendor url'],
            '@name' => $info['name'],
            '%path' => 'sites/all/libraries/' . $name,
          )),
          'severity' => REQUIREMENT_ERROR,
        );
      }
    }
  }
  return $requirements;
}