You are here

views_galleriffic.install in Views Galleriffic 6

Same filename and directory in other branches
  1. 7 views_galleriffic.install

Installation file for views galleriffic. Checks if .js file is installed.

File

views_galleriffic.install
View source
<?php

/**
 * @file
 * Installation file for views galleriffic.
 * Checks if .js file is installed.
 */

/**
 * Implementation of hook_requirements().
 * Added to be sure that user has galleriffic.js is installed
 *
 */
function views_galleriffic_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $file_path = drupal_get_path('module', 'views_galleriffic') . '/js/jquery.galleriffic.js';
  switch ($phase) {
    case 'runtime':
      if (!file_exists($file_path)) {
        $requirements['views_galleriffic_js'] = array(
          'title' => $t('Views Galleriffic requirements'),
          'value' => $t('The Views Galleriffic module requires the <a href="http://www.twospy.com/galleriffic/js/jquery.galleriffic.js">Galleriffic JS</a> file. Download and place in the \'modules/views_galleriffic/js/\' folder.'),
          'severity' => REQUIREMENT_WARNING,
        );
      }
      break;
  }
  return $requirements;
}

Functions

Namesort descending Description
views_galleriffic_requirements Implementation of hook_requirements(). Added to be sure that user has galleriffic.js is installed