You are here

function bootstrap_languages_requirements in Bootstrap Languages 7

Same name and namespace in other branches
  1. 8 bootstrap_languages.install \bootstrap_languages_requirements()

Implements hook_requirements().

File

./bootstrap_languages.install, line 29
Install, update, and uninstall functions for the bootstrap_languages module.

Code

function bootstrap_languages_requirements($phase) {
  $t = get_t();
  $requirements = array();
  $url = 'https://github.com/usrz/bootstrap-languages';
  switch ($phase) {
    case 'runtime':
      $bootstrap_languages_library = libraries_load('bootstrap-languages');
      if (!$bootstrap_languages_library['loaded']) {
        $requirements['bootstrap_languages'] = array(
          'title' => $t('Bootstrap languages library'),
          'value' => $t('Not installed'),
          'description' => $t('The bootstrap languages library could not be loaded. Please install <a href="@url" target="_blank">Bootstrap languages library</a>.', array(
            '@url' => $url,
          )),
          'severity' => REQUIREMENT_ERROR,
        );
      }
      break;
  }
  return $requirements;
}