You are here

function workbench_email_requirements in Workbench Email 7.3

Implements hook_requirements().

File

./workbench_email.install, line 79
Install file for the Workbench Email module.

Code

function workbench_email_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    $description = array();
    if (!module_exists('token')) {
      $url = l($t('Token'), 'http://drupal.org/project/token');
      $description[] = $t('!token is not installed on the site.
      Please download the module to fully support email capabilities.', array(
        '!token' => $url,
      ));
    }
    if (!module_exists('workbench_moderation')) {
      $url = l($t('Workbench Moderation'), 'http://drupal.org/project/workbench_moderation');
      $description[] = $t('!workbench_moderation is not installed on the site.
      Please download the module to begin using Workbench Email.', array(
        '!workbench_moderation' => $url,
      ));
    }
    if (!empty($description)) {
      $requirements['workbench_email'] = array(
        'title' => $t('Workbench Email'),
        'value' => $t('Not configured'),
        'severity' => REQUIREMENT_ERROR,
        'description' => theme('item_list', array(
          'items' => $description,
        )),
      );
    }
    else {
      $requirements['workbench_email'] = array(
        'title' => $t('Workbench Email'),
        'value' => $t('Configured'),
        'severity' => REQUIREMENT_OK,
        'description' => $t('Workbench Email is configured properly.'),
      );
    }
  }
  return $requirements;
}