You are here

views_mediatable.install in Views MediaTable 7

Installation file for Views MediaTable module.

File

views_mediatable.install
View source
<?php

/**
 * @file
 * Installation file for Views MediaTable module.
 */

/**
 * Implements hook_requirements().
 */
function mediatable_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $requirements['mediatable']['title'] = 'MediaTable';
  $requirements['mediatable']['value'] = NULL;
  if (file_exists(drupal_get_path('module', 'views_mediatable') . '/MediaTable/jquery.mediaTable.js')) {
    $requirements['mediatable']['severity'] = REQUIREMENT_OK;
  }
  else {

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

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

Functions

Namesort descending Description
mediatable_requirements Implements hook_requirements().