You are here

function seo_checker_requirements in SEO Compliance Checker 6.2

Same name and namespace in other branches
  1. 6 seo_checker.install \seo_checker_requirements()

Implementation of hook_requirements().

Parameters

string $phase:

File

./seo_checker.install, line 12
Installer for the SEO Compliance Checker

Code

function seo_checker_requirements($phase) {
  $t = get_t();
  $requirements = array();
  if ($phase == 'runtime') {
    $ok = false;
    foreach (node_get_types('names') as $type => $name) {
      $ok |= variable_get('seo_checker_' . $type, 0);
    }
    if (!$ok) {
      $requirements['content_types']['title'] = $t('SEO Compliance Checker');
      $requirements['content_types']['value'] = $t('No Content Types Enabled');
      $requirements['content_types']['description'] = $t("In order for the SEO Compliance Checker to work you have to enable it for at least one content type.");
      $requirements['content_types']['severity'] = REQUIREMENT_WARNING;
    }
  }
  return $requirements;
}