You are here

function _captcha_get_description in CAPTCHA 5.3

Same name and namespace in other branches
  1. 8 captcha.inc \_captcha_get_description()
  2. 6.2 captcha.inc \_captcha_get_description()
  3. 6 captcha.module \_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.module
Form builder function for the general CAPTCHA configuration
captcha_form_alter in ./captcha.module
Implementation of hook_form_alter().

File

./captcha.module, line 178
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 $locale;
      $lang_code = $locale;
    }
    $description = variable_get("captcha_description_{$lang_code}", $default);
  }
  else {
    $description = variable_get('captcha_description', $default);
  }
  return filter_xss_admin($description);
}