You are here

function supersized_requirements in Supersized 7

Same name and namespace in other branches
  1. 8 supersized.install \supersized_requirements()

Implements hook_requirements().

File

./supersized.install, line 95
Install, update and uninstall functions for Supersized module.

Code

function supersized_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break during installation.
  $t = get_t();
  if ($phase === 'runtime') {

    // Test supersized JQuery plugin.
    $library = libraries_detect('supersized');
    if (!empty($library)) {
      $requirements['supersized'] = array(
        'title' => $t('Supersized'),
        'value' => $t('Supersized 3.2.8 installed.'),
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $url = l(t('here'), $library['download url']);
      $value = $t('Install version 3.2.8 of the Supersized (from !url) in a libraries directory such as "sites/all/libraries."', array(
        '!url' => $url,
      ));
      $requirements['supersized'] = array(
        'title' => $t('Supersized'),
        'value' => $value,
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}