You are here

function charts_billboard_requirements in Charts 5.0.x

Implements hook_requirements().

File

modules/charts_billboard/charts_billboard.install, line 10
Installation and uninstallation functions.

Code

function charts_billboard_requirements($phase) {
  $requirements = [];
  switch ($phase) {
    case 'runtime':
      $library_path = charts_billboard_find_library();
      if (!$library_path) {
        $requirements['charts_billboard_js'] = [
          'title' => t('Billboard.js Library'),
          'value' => t('Not Installed'),
          'severity' => REQUIREMENT_ERROR,
          'description' => t('You are missing the Billboard.js library in your Drupal installation directory. Please see the README file inside charts_billboard for instructions to install the library.'),
        ];
      }
      else {
        $requirements['charts_billboard_js'] = [
          'title' => t('Billboard.js Library'),
          'severity' => REQUIREMENT_OK,
          'value' => t('Installed'),
        ];
      }
      break;
  }
  return $requirements;
}