You are here

function _captcha_get_description in CAPTCHA 6

Same name and namespace in other branches
  1. 8 captcha.inc \_captcha_get_description()
  2. 5.3 captcha.module \_captcha_get_description()
  3. 6.2 captcha.inc \_captcha_get_description()
  4. 7 captcha.inc \_captcha_get_description()

Get the description which appears above the CAPTCHA in forms. If the locale module is enabled, an optional language code can be given

2 calls to _captcha_get_description()
captcha_admin_settings in ./captcha.admin.inc
Form builder function for the general CAPTCHA configuration
captcha_form_alter in ./captcha.module
Implementation of hook_form_alter().

File

./captcha.module, line 144
This module enables basic CAPTCHA functionality: administrators can add a CAPTCHA to desired forms that users without the 'skip CAPTCHA' permission (typically anonymous visitors) have to solve.

Code

function _captcha_get_description($lang_code = NULL) {
  $default = t('This question is for testing whether you are a human visitor and to prevent automated spam submissions.');
  if (module_exists('locale')) {
    if ($lang_code == NULL) {
      global $language;
      $lang_code = $language->language;
    }
    $description = variable_get("captcha_description_{$lang_code}", $default);
  }
  else {
    $description = variable_get('captcha_description', $default);
  }
  return $description;
}