You are here

bootstrap_quicktabs.install in Bootstrap Quick Tabs 7

Tests availability of module requirements at install.

File

bootstrap_quicktabs.install
View source
<?php

/**
 * @file
 * Tests availability of module requirements at install.
 */

/**
 * Implements hook_requirements().
 */
function bootstrap_quicktabs_requirements($phase) {

  // Get the current jquery version, if any:
  $jquery_version = variable_get('jquery_update_jquery_version', '1.4.4');

  // Get the available themes:
  $themes = list_themes();

  // Figure and return the requirements:
  $t = get_t();
  $jq_title = $t('jQuery version');
  $jq_descript = $t('Bootstrap Quicktabs relies on jQuery 1.7 or higher.');
  $boot_title = $t('Bootstrap Theme');
  $boot_descript = $t('Bootstrap Quicktabs is intended for use with the Bootstrap theme.');
  $boot_exists = $t('Installed');
  $boot_notexist = $t('Not found');
  return array(
    // jQuery version:
    //
    // We're only testing here for the VERSION of jquery since
    //    -- this module lists jquery_update as a requirement, so we don't need
    //       module_exists() etc, and
    //    -- the variable we're checking just can't exist without the module in
    //       any case.
    'jquery version' => array(
      'title' => $jq_title,
      'value' => $jquery_version,
      'description' => $jq_descript,
      'severity' => version_compare($jquery_version, '1.7', '>=') ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    ),
  );
}

// bootstrap_quicktabs_requirements()

Functions