You are here

tablesorter.install in Tablesorter 7

Same filename and directory in other branches
  1. 8 tablesorter.install
  2. 7.2 tablesorter.install
  3. 3.0.x tablesorter.install

Tablesorter installation functions.

File

tablesorter.install
View source
<?php

/**
 * @file
 * Tablesorter installation functions.
 */

/**
 * Implements hook_requirements().
 */
function tablesorter_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time.
  $t = get_t();
  if ($phase == 'runtime') {
    $js = libraries_load('tablesorter');
    $requirements['tablesorter'] = array(
      'title' => t('Tablesorter library'),
      'value' => t('TableSorter %vs (<a href="@link">configure</a>)', array(
        '%vs' => $js['version'],
        '@link' => url('admin/config/user-interface/tablesorter'),
      )),
      'severity' => REQUIREMENT_OK,
    );
  }
  return $requirements;
}

/**
 * Implements hook_uninstall().
 */
function tablesorter_uninstall() {
  $variables = array(
    'tablesorter_theme',
    'tablesorter_zebra',
    'tablesorter_zebra_odd_class',
    'tablesorter_zebra_even_class',
  );
  foreach ($variables as $variable) {
    variable_del($variable);
  }
}

Functions