You are here

function calendar_systems_requirements in Calendar Systems 7.3

Same name and namespace in other branches
  1. 8 calendar_systems.install \calendar_systems_requirements()
  2. 6.2 calendar_systems.install \calendar_systems_requirements()
  3. 7 calendar_systems.install \calendar_systems_requirements()
  4. 7.2 calendar_systems.install \calendar_systems_requirements()

Implements hook_requirements().

File

./calendar_systems.install, line 52
Contains Calendar Systems installation hooks.

Code

function calendar_systems_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();
  if ($phase == 'runtime' || $phase == 'install') {
    $requirements['calendar_systems_patch'] = array(
      'title' => $t('Calendar Systems core patch'),
      'value' => $t('Core patch is not applied, please follow the instructions in <a href="!readme-link">README.txt</a> file.', array(
        '!readme-link' => url(drupal_get_path('module', 'calendar_systems') . '/README.txt'),
      )),
      'description' => $t('Required core patch for calendar systems to fully work'),
      'severity' => REQUIREMENT_WARNING,
    );
    if (_calendar_systems_install_patch_applied() === TRUE) {
      $requirements['calendar_systems_patch']['value'] = $t('Core patch is applied');
      $requirements['calendar_systems_patch']['severity'] = REQUIREMENT_OK;
    }
    elseif (_calendar_systems_install_patch_applied() == 'outdated') {
      $requirements['calendar_systems_patch']['value'] = $t('Core patch is applied but it\'s outdated, please follow the instructions in <a href="!readme-link">README.txt</a> file.', array(
        '!readme-link' => url(drupal_get_path('module', 'calendar_systems') . '/README.txt'),
      ));
      $requirements['calendar_systems_patch']['severity'] = REQUIREMENT_ERROR;
    }
  }
  return $requirements;
}