function _random_captcha_type_get_all_types in CAPTCHA Pack 6
Same name and namespace in other branches
- 8 random_captcha_type/random_captcha_type.module \_random_captcha_type_get_all_types()
- 5 random_captcha_type/random_captcha_type.module \_random_captcha_type_get_all_types()
- 7 random_captcha_type/random_captcha_type.module \_random_captcha_type_get_all_types()
Function for getting all the possible CAPTCHA types to switch between. For use as #options entry of a checkboxes widget.
2 calls to _random_captcha_type_get_all_types()
- random_captcha_type_settings_form in random_captcha_type/
random_captcha_type.admin.inc - Configuration form
- _random_captcha_type_get_enabled_types in random_captcha_type/
random_captcha_type.inc - Function for getting the enabled CAPTCHA types. Alternative of variable_get('random_captcha_type_enabled_types', ...) with sensible default value. For use as #default_value of checkboxes widget. Returns an array mapping…
File
- random_captcha_type/
random_captcha_type.inc, line 7
Code
function _random_captcha_type_get_all_types() {
$captcha_types = array();
foreach (module_implements('captcha') as $module) {
// skip random_captcha_type module
if ($module == 'random_captcha_type') {
continue;
}
// get available types
$result = module_invoke($module, 'captcha', 'list');
if (is_array($result)) {
foreach ($result as $type) {
$captcha_types["{$module}/{$type}"] = "{$type} ({$module})";
}
}
}
return $captcha_types;
}