You are here

emogrifier.install in Emogrifier 7

Same filename and directory in other branches
  1. 8 emogrifier.install
  2. 6 emogrifier.install
  3. 7.2 emogrifier.install

Provide Emogrifier requirements for the status page.

File

emogrifier.install
View source
<?php

/**
 * @file
 * Provide Emogrifier requirements for the status page.
 */

/**
 * Implements hook_requirements().
 */
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,
    ),
  );
}

Functions

Namesort descending Description
emogrifier_requirements Implements hook_requirements().