You are here

field_tokens.install in Field tokens 7

Install functions for the Field tokens module.

File

field_tokens.install
View source
<?php

/**
 * @file
 * Install functions for the Field tokens module.
 */

/**
 * Implements hook_requirements().
 */
function field_tokens_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break during installation.
  $t = get_t();
  if (module_exists('formatted_field_tokens')) {
    $requirements['formatted_field_tokens'] = array(
      'title' => $t('Formatted Field tokens'),
      'value' => $t('Enabled'),
      'description' => $t('The Formatted Field tokens module is superseded by the Field tokens module, and should be disabled and deleted.'),
      'severity' => REQUIREMENT_WARNING,
    );
    if ($phase == 'install') {
      unset($requirements['formatted_field_tokens']['value']);
    }
  }
  return $requirements;
}

Functions