You are here

function zurb_twentytwenty_requirements in ZURB TwentyTwenty 7

Same name and namespace in other branches
  1. 8 zurb_twentytwenty.install \zurb_twentytwenty_requirements()
  2. 2.0.x zurb_twentytwenty.install \zurb_twentytwenty_requirements()

Implementation of hook_requirements().

Parameters

$phase:

Return value

array

File

./zurb_twentytwenty.install, line 8

Code

function zurb_twentytwenty_requirements($phase) {
  $requirements = array();
  switch ($phase) {
    case 'install':
    case 'runtime':
      $file_exists = file_exists(libraries_get_path('twentytwenty') . '/js/jquery.twentytwenty.js');
      $requirements['zurb_twentytwenty'] = array(
        'title' => t('ZURB TwentyTwenty Plugin'),
        'value' => t('!msg', array(
          '!msg' => $file_exists ? 'Installed' : 'The ' . l('ZURB TwentyTwenty', 'https://github.com/zurb/twentytwenty') . ' was not found. Please ' . l('download', 'https://github.com/zurb/twentytwenty') . ' it into the Libraries folder (sites/all/libraries/twentytwenty).',
        )),
        'severity' => $file_exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
      );
      break;
  }
  return $requirements;
}