You are here

datatables.install in DataTables 6

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

Installation file for Datatables module.

File

datatables.install
View source
<?php

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

/**
 * Implementation of hook_requirements().
 */
function datatables_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $requirements['datatables']['title'] = 'DataTables';
  if (file_exists(drupal_get_path('module', 'datatables') . '/dataTables/media/js/jquery.dataTables.js')) {
    $requirements['datatables']['severity'] = REQUIREMENT_OK;
  }
  else {

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

    // Provide a download link to the DataTables jQuery Plugin.
    $requirements['datatables']['description'] = $t('The <a href="@datatables">DataTables</a> plugin is missing. <a href="@download">Download</a> and extract it to your <em>datatables</em> module directory. See <a href="@readme">README.txt</a> for more info.', array(
      '@datatables' => 'http://plugins.jquery.com/project/DataTables',
      '@download' => 'http://plugins.jquery.com/files/dataTables-1.6.2.zip',
      '@readme' => url(drupal_get_path('module', 'datatables') . '/README.txt'),
    ));
    $requirements['datatables']['severity'] = REQUIREMENT_ERROR;
  }
  return $requirements;
}

Functions

Namesort descending Description
datatables_requirements Implementation of hook_requirements().