You are here

function _captcha_available_challenge_types in CAPTCHA 6

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

Return an array with the available CAPTCHA types, for use as options array for a select form elements. The array is an associative array mapping "$module/$type" to "$type ($module)" with $module the module name implementing the CAPTCHA and $type the name of the CAPTCHA type. (It also includes a 'none' => '<none>' option)

2 calls to _captcha_available_challenge_types()
captcha_admin_settings in ./captcha.admin.inc
Form builder function for the general CAPTCHA configuration
captcha_point_admin_form in ./captcha.admin.inc

File

./captcha.admin.inc, line 11

Code

function _captcha_available_challenge_types() {
  $captcha_types['none'] = '<' . t('none') . '>';
  foreach (module_implements('captcha') as $module) {
    $result = call_user_func_array($module . '_captcha', 'list');
    if (is_array($result)) {
      foreach ($result as $type) {
        $captcha_types["{$module}/{$type}"] = "{$type} ({$module})";
      }
    }
  }
  return $captcha_types;
}