You are here

cloud_zoom.install in Cloud Zoom 7

Same filename and directory in other branches
  1. 8 cloud_zoom.install
  2. 6 cloud_zoom.install

Install file - this currently houses the requirements hook, so its not loaded on ALL page loads.

File

cloud_zoom.install
View source
<?php

/**
 * @file
 * Install file - this currently houses the requirements hook, so its not loaded on ALL page loads.
 */

/**
 * Implementation of hook_requirements().
 */
function cloud_zoom_requirements($phase) {
  $t = get_t();
  $requirements = array();
  if ($phase == 'runtime') {
    $path = _cloud_zoom_get_path();
    if ($path) {

      // TODO - what if returned FALSE?
      $file = _cloud_zoom_check_path($path);
    }
    $requirements['cloud_zoom_sourcefiles'] = array(
      'title' => t('Cloud Zoom'),
      'value' => $path ? check_plain($file->cz_version) : t('Files Missing'),
      'description' => $path ? t('Source files found in %path.', array(
        '%path' => $path,
      )) : t('Have the sourcecode files for Cloud Zoom been downloaded from !link?', array(
        '!link' => l('Professor Cloud', CLOUD_ZOOM_DOWNLOAD_URI, array(
          'external' => TRUE,
        )),
      )),
      'severity' => $path ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}

Functions

Namesort descending Description
cloud_zoom_requirements Implementation of hook_requirements().