You are here

function footable_requirements in FooTable 7.2

Same name and namespace in other branches
  1. 8.2 footable.install \footable_requirements()
  2. 7 footable.install \footable_requirements()

Implements hook_requirements().

File

./footable.install, line 11
Install, update, and uninstall functions for the FooTable module.

Code

function footable_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $t = get_t();
    $plugin = libraries_detect('footable');
    if (!$plugin['installed']) {
      $requirements['footable'] = array(
        'title' => $t('FooTable plugin'),
        'value' => $t('Not found'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('You need to download the !footable and extract the contents of the "compiled" directory into the %path directory.', array(
          '!footable' => l($t('FooTable plugin'), 'https://github.com/fooplugins/FooTable', array(
            'target' => '_blank',
          )),
          '%path' => FOOTABLE_PLUGIN_PATH,
        )),
      );
    }
    elseif (version_compare($plugin['version'], FOOTABLE_PLUGIN_VERSION_MIN, '>=')) {
      $requirements['footable'] = array(
        'title' => $t('FooTable plugin'),
        'value' => $plugin['version'],
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['footable'] = array(
        'title' => $t('FooTable plugin'),
        'value' => $plugin['version'],
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('The FooTable module minimally requires the @version version of the FooTable plugin.', array(
          '@version' => FOOTABLE_PLUGIN_VERSION_MIN,
        )),
      );
    }
  }
  return $requirements;
}