You are here

footable.install in FooTable 7

Same filename and directory in other branches
  1. 8.2 footable.install
  2. 7.2 footable.install

Installation file for FooTable module.

File

footable.install
View source
<?php

/**
 * @file
 * Installation file for FooTable module.
 */

/**
 * Implements hook_requirements().
 */
function footable_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $requirements['footable']['title'] = 'FooTable';
  $requirements['footable']['value'] = NULL;
  if (file_exists(dirname(__FILE__) . '/FooTable/js/footable.js')) {
    $requirements['footable']['severity'] = REQUIREMENT_OK;
  }
  elseif (module_exists('libraries') && file_exists(libraries_get_path('FooTable') . '/js/footable.js')) {
    $requirements['footable']['severity'] = REQUIREMENT_OK;
  }
  elseif (!drupal_installation_attempted()) {

    // Required footable library wasn't found; abort installation.
    $requirements['footable']['value'] = $t('Not found');

    // Provide a download link to the FooTable jQuery plugin.
    $requirements['footable']['description'] = $t('The <a href="!footable">FooTable</a> jQuery plugin is missing. See !readme for instructions on how to download and extract it.', array(
      '!footable' => 'http://themergency.com/footable/',
      '!readme' => l(t('README.md'), drupal_get_path('module', 'footable') . "/README.md"),
    ));
    $requirements['footable']['severity'] = REQUIREMENT_ERROR;
  }
  return $requirements;
}

Functions

Namesort descending Description
footable_requirements Implements hook_requirements().