You are here

function antispam_requirements in AntiSpam 7

Same name and namespace in other branches
  1. 6 antispam.module \antispam_requirements()

Implements hook_requirement().

File

./antispam.install, line 10
Requirements, schema and related hooks for the Antispam module.

Code

function antispam_requirements($phase) {
  $t = get_t();
  if ($phase == 'runtime') {
    $provider = antispam_get_service_provider();
    if ($provider == ANTISPAM_AKISMET_SERVICE) {
      if (variable_get('antispam_wpapikey', '') == '') {
        $requirements['antispam_key'] = array(
          'title' => t('Akismet API key'),
          'value' => t('Not present'),
          'description' => t("Akismet spam protection service requires a <a href='!wpapikey'>Akismet API key</a> to function. Obtain a key by signing up for a free account at <a href='!akismet-com'>Akismet.com</a>, then enter the key on the <a href='!antispam-settings'>AntiSpam settings page</a>.", array(
            '!wpapikey' => url('http://akismet.com/signup/'),
            '!akismet-com' => url('http://akismet.com'),
            '!antispam-settings' => url('admin/config/spamprevention/antispam'),
          )),
          'severity' => REQUIREMENT_ERROR,
        );
        return $requirements;
      }
    }
  }
}