You are here

function emogrifier_requirements in Emogrifier 6

Same name and namespace in other branches
  1. 8 emogrifier.install \emogrifier_requirements()
  2. 7.2 emogrifier.install \emogrifier_requirements()
  3. 7 emogrifier.install \emogrifier_requirements()

Implements hook_requirements().

File

./emogrifier.install, line 11
Provide Emogrifier requirements for the status page.

Code

function emogrifier_requirements($phase) {
  $t = get_t();
  $dom = extension_loaded('dom');
  $emogrifier = drupal_load('module', 'libraries') && drupal_load('module', 'emogrifier') && _emogrifier_available();
  $args = array(
    '!help' => '/admin/help/emogrifier',
    '!emogrifier' => 'http://drupal.org/project/emogrifier',
    '%emogrifier' => 'Emogrifier',
    '!dom' => 'http://php.net/dom',
    '%dom' => 'DOM',
  );
  return array(
    'emogrifier_dom' => array(
      'title' => $t('<a href="!dom">%dom</a> extension', $args),
      'value' => $dom ? 'Enabled' : 'Disabled',
      'description' => $t('The <a href="!emogrifier">%emogrifier</a> module requires the PHP <a href="!dom">%dom</a> extension.', $args),
      'severity' => $dom ? REQUIREMENT_OK : REQUIREMENT_WARNING,
    ),
    'emogrifier_class' => array(
      'title' => $t('<a href="!help">%emogrifier</a> class library', $args),
      'value' => $emogrifier ? 'Available' : 'Unavailable',
      'description' => $emogrifier ? $t('The <a href="!help">%emogrifier</a> class library was found.', $args) : $t('The <a href="!help">%emogrifier</a> class library was not found.', $args),
      'severity' => $emogrifier ? REQUIREMENT_OK : REQUIREMENT_WARNING,
    ),
  );
}