You are here

jssor.install in Jssor Slider 7

Same filename and directory in other branches
  1. 8 jssor.install

File

jssor.install
View source
<?php

/**
 * Implements hook_requirements().
 */
function jssor_requirements($phase) {
  if ($phase == 'runtime') {

    // Detect if the external JSSOR slider library is installed.
    $requirements = array();
    $info = libraries_info('jssor-slider');
    $version = null;
    if ($info !== false) {
      $lib_path = libraries_get_path('jssor-slider', TRUE);
      if (!empty($lib_path)) {
        $info['library path'] = $lib_path;
        $version = libraries_get_version($info, $info['version arguments']);
      }
    }
    $requirements['jssor'] = array(
      'title' => 'JSSOR Library',
      'severity' => $version ? REQUIREMENT_OK : REQUIREMENT_ERROR,
      'description' => 'The JSSOR Slider library. Download from http://wwww.jssor.com',
      'value' => $version,
    );
    return $requirements;
  }
}

Functions

Namesort descending Description
jssor_requirements Implements hook_requirements().