You are here

imagelightbox.install in ImageLightbox 8

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

Install functions for the imagelightbox module.

File

imagelightbox.install
View source
<?php

/**
 * @file
 * Install functions for the imagelightbox module.
 */

/**
 * Implements hook_requirements().
 */
function imagelightbox_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    if (!file_exists('libraries/imagelightbox/imagelightbox.js') && !file_exists('modules/imagelightbox/libraries/imagelightbox.js')) {
      $requirements['imagelightbox_library'] = [
        'title' => t('ImageLightBox library'),
        'value' => t('Not found'),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('You need to install the imagelightbox library by executing the drush command "drush imagelightbox-download" or "drush ilb-dl". If you wish to manualy install the latest imagelightbox.js, download the <a href=":library_url">imagelightbox library</a> and extract the archive to the <em>libraries/imagelightbox</em> directory on your server.', [
          ':library_url' => 'https://github.com/osvaldasvalutis/imageLightbox.js',
        ]),
      ];
    }
  }
  return $requirements;
}

Functions