You are here

function charts_google_requirements in Charts 5.0.x

Implements hook_requirements().

File

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

Code

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