You are here

function pmorganization_requirements in Drupal PM (Project Management) 7.3

Same name and namespace in other branches
  1. 8 pmorganization/pmorganization.install \pmorganization_requirements()
  2. 7.2 pmorganization/pmorganization.install \pmorganization_requirements()

Implements hook_requirements().

File

pmorganization/pmorganization.install, line 208
PM Organization install file.

Code

function pmorganization_requirements($phase) {
  $requirements = array();
  if ($phase == 'update') {
    $enabled = module_enable(array(
      'link',
      'email',
      'addressfield',
    ));
    if (!$enabled) {
      $t = get_t();
      $requirements['pmorganization_migrate'] = array(
        'title' => $t('PM Organization Migrate Issues'),
        'value' => $t('One or more of the required modules cannot be enabled.
          If you download the modules from Drupal.org those would be enabled automatically when update script is run.
          So Please make sure following modules are present: !link, !email & !addressfield', array(
          '!link' => l($t('link'), 'https://drupal.org/project/link'),
          '!email' => l($t('email'), 'https://drupal.org/project/email'),
          '!addressfield' => l($t('addressfield'), 'https://drupal.org/project/addressfield'),
        )),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}