You are here

function charts_c3_requirements in Charts 5.0.x

Implements hook_requirements().

File

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

Code

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