You are here

function mvf_requirements in Measured Value Field 6

Implementation of hook_requirements().

File

./mvf.install, line 11
Module installation/uninstallation hooks.

Code

function mvf_requirements($phase) {
  if ($phase == 'install') {
    $requirements = array();
    $t = get_t();
    drupal_load('module', 'format_number');
    if (!function_exists('format_number_get_options')) {
      $requirements['format_number'] = array(
        'title' => $t('Format Number API'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('%module-name requires, at least, version 6.x-1.1 of the <a href="@format-number">Format Number API</a> module.', array(
          '%module-name' => $t('Measured Value Field'),
          '@format-number' => 'http://drupal.org/project/format_number',
        )),
      );
    }
    drupal_load('module', 'formatted_number');
    if (!function_exists('formatted_number_widget_validate')) {
      $requirements['formatted_number'] = array(
        'title' => $t('Formatted Number CCK'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('%module-name requires, at least, version 6.x-1.0 of the <a href="@formatted-number">Formatted Number CCK</a> module.', array(
          '%module-name' => $t('Measured Value Field'),
          '@formatted-number' => 'http://drupal.org/project/formatted_number',
        )),
      );
    }
    return $requirements;
  }
}