You are here

lazyloader.install in Image Lazyloader 8

Same filename and directory in other branches
  1. 7.2 lazyloader.install
  2. 7 lazyloader.install

Contains installation methods for Lazyloader module.

File

lazyloader.install
View source
<?php

/**
 * @file
 * Contains installation methods for Lazyloader module.
 */

/**
 * Implements hook_requirements().
 */
function lazyloader_requirements() {
  $requirements = [];
  if (!file_exists('libraries/lazysizes/lazysizes.js') || !file_exists('libraries/lazysizes/lazysizes.min.js')) {
    $requirements = [
      'lazyloader.library' => [
        'title' => t('Lazyloader'),
        'value' => t('Lazysizes library missing'),
        'description' => t('The lazysizes library could not be located. We automatically fall back to a CDN hosted version of the library. If you wish to host your own version, please place it inside the <em>libraries/lazysizes</em> folder. The library can be downloaded from <a href="https://github.com/aFarkas/lazysizes/releases">https://github.com/aFarkas/lazysizes/releases</a>'),
        'severity' => REQUIREMENT_WARNING,
      ],
    ];
  }
  return $requirements;
}

Functions

Namesort descending Description
lazyloader_requirements Implements hook_requirements().