You are here

function outdatedbrowser_requirements in Outdated Browser 7

Implements hook_requirements().

File

./outdatedbrowser.install, line 10
Install, update and uninstall functions for the Outdated Browser module.

Code

function outdatedbrowser_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $t = get_t();
    $library = libraries_detect('outdatedbrowser');
    if (empty($library['installed'])) {
      $requirements['outdatedbrowser'] = array(
        'title' => $t('Outdated Browser library'),
        'value' => isset($library['error message']) ? $library['error message'] : $t('Library not found'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('You need to download the !outdatedbrowser, extract the archive and place the outdatedbrowser directory in the %path directory on your server. Make sure the path to the plugin file becomes: %fullpath', array(
          '!outdatedbrowser' => l($t('Outdated Browser library'), $library['download url']),
          '%path' => 'sites/all/libraries',
          '%fullpath' => 'sites/all/libraries/outdatedbrowser/outdatedbrowser/outdatedbrowser.min.js',
        )),
      );
    }
    else {
      $requirements['outdatedbrowser'] = array(
        'title' => $t('Outdated Browser library'),
        'severity' => REQUIREMENT_OK,
        'value' => $library['version'],
      );
    }
  }
  return $requirements;
}