You are here

function cloud_zoom_requirements in Cloud Zoom 6

Same name and namespace in other branches
  1. 8 cloud_zoom.install \cloud_zoom_requirements()
  2. 7 cloud_zoom.install \cloud_zoom_requirements()

Implementation of hook_requirements().

File

./cloud_zoom.install, line 11
cloud_zoom.install Contains all the install hooks required - such as schema, install and uninstall

Code

function cloud_zoom_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {
    case 'runtime':
    case 'install':
      $requirements['cloud_zoom'] = array(
        'title' => $t('Cloud Zoom'),
      );

      // Load the common include for the dependency check
      module_load_include('inc', 'cloud_zoom', 'cloud_zoom.common');
      if (($check = cloud_zoom_dependency_check()) && $check['exists']) {
        $requirements['cloud_zoom'] += array(
          'description' => $t('The JQuery Cloud Zoom library is required for this module to work and has been found in %path', array(
            '!link' => l($t('JQuery Cloud Zoom'), 'http://www.professorcloud.com/mainsite/cloud-zoom.htm', array(
              'absolute' => TRUE,
            )),
            '%path' => $check['path'],
          )),
          'value' => $t('Found (Version: %version)', array(
            '%version' => cloud_zoom_get_jquery_cycle_version($check['filepath']),
          )),
          'severity' => REQUIREMENT_OK,
        );
      }
      else {
        $requirements['cloud_zoom'] += array(
          'description' => $t("The !link library is required for this module to work.<br />\n" . "Please download and unzip into: %path<br />\n" . 'The cloud-zoom.1.0.2.min.js file should be found at: %filepath', array(
            '!link' => l($t('JQuery Cloud Zoom'), 'http://www.professorcloud.com/mainsite/cloud-zoom.htm', array(
              'absolute' => TRUE,
            )),
            '%path' => url($check['path']),
            '%filepath' => url($check['filepath']),
          )),
          'value' => $t('Not Found'),
          'severity' => REQUIREMENT_ERROR,
        );
      }
      break;
  }
  return $requirements;
}