You are here

function nodewords_requirements in Nodewords: D6 Meta Tags 6

Same name and namespace in other branches
  1. 6.3 nodewords.install \nodewords_requirements()
  2. 6.2 nodewords.install \nodewords_requirements()

Implements hook_requirements().

File

./nodewords.install, line 10
Installation file for nodewords.module.

Code

function nodewords_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    drupal_load('module', 'nodewords');
    if (!count(nodewords_get_possible_tags())) {
      if (!count(module_implements('nodewords_tags_info'))) {
        $requirements['nodewords'] = array(
          'title' => t('Nodewords'),
          'description' => t('There are no modules enabled that implement meta tags.'),
          'severity' => REQUIREMENT_ERROR,
          'value' => t('Enable at least one module listed under the <em>Meta tags</em> category on the <a href="@modules-page">modules page</a>.', array(
            '@modules-page' => url('admin/build/modules'),
          )),
        );
      }
      else {
        $requirements['nodewords'] = array(
          'title' => t('Nodewords'),
          'description' => t('There are no modules that support the current API version.'),
          'severity' => REQUIREMENT_ERROR,
          'value' => t('There should be at least one module that supports the current API version. Verify you correctly copied the files in the server.'),
        );
      }
    }
    elseif (module_exists('nodewords_bypath')) {
      $requirements['nodewords'] = array(
        'title' => t('Nodewords'),
        'description' => t('The feature implemented in <q>Meta Tags by Path</q> is now included in Nodewords; there is not need to use <q>Meta Tags by Path</q>, and the module should be disabled to avoid possible conflicts.'),
        'severity' => REQUIREMENT_ERROR,
        'value' => t('Disable the module in the<a href="@url">modules page</a>.', array(
          '@url' => url('admin/build/modules'),
        )),
      );
    }
  }
  return $requirements;
}