You are here

zurb_twentytwenty.install in ZURB TwentyTwenty 8

Same filename and directory in other branches
  1. 7 zurb_twentytwenty.install
  2. 2.0.x zurb_twentytwenty.install

File

zurb_twentytwenty.install
View source
<?php

use Drupal\Core\Url;
use Drupal\Core\Link;

/**
 * Implementation of hook_requirements().
 * @param $phase
 * @return array
 */
function zurb_twentytwenty_requirements($phase) {
  $requirements = array();
  switch ($phase) {
    case 'install':
    case 'runtime':
      $file_exists = file_exists(DRUPAL_ROOT . '/libraries/twentytwenty/js/jquery.twentytwenty.js');
      if ($file_exists) {
        $message = t('Zurb TwentyTwenty plugin detected in %path', [
          '%path' => '/libraries/twentytwenty.',
        ]);
      }
      else {
        $message = t('The Zurb TwentyTwenty plugin was not found. Please <a href=":repository_url" target="_blank">download it</a> into the libraries folder in the root (/libraries/twentytwenty).', [
          ':repository_url' => 'https://github.com/zurb/twentytwenty',
        ]);
      }
      $requirements['zurb_twentytwenty'] = [
        'title' => t('ZURB TwentyTwenty Plugin'),
        'value' => $message,
        'severity' => $file_exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
      ];
      break;
  }
  return $requirements;
}

Functions

Namesort descending Description
zurb_twentytwenty_requirements Implementation of hook_requirements().