Skip to content
Snippets Groups Projects
Commit 465def89 authored by Fabiano Sant'Ana's avatar Fabiano Sant'Ana
Browse files

Fixed #102755, thanks Drumm.

Fixed #102271, thanks incrn8.
parent bd813a19
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,21 @@ function captcha_settings() {
'#description' => t('Select what kind of challenge you want to pose to the user')
);
$form['captcha_description'] = array(
'#type' => 'textfield',
'#title' => t('Additional response description text'),
'#default_value' => variable_get('captcha_description', ''),
'#description' => t('This text will be added below the captcha response field.'),
);
$form['captcha_override_module_description'] = array(
'#type' => 'checkbox',
'#title' => t('Override module's form item description?'),
'#default_value' => variable_get('captcha_override_module_description', 0),
'#description' => t('Override the captcha module's form item description to the one set above.'),
);
return $form;
}
......@@ -93,6 +108,17 @@ function captcha_form_alter($formid, &$form) {
//use call_func because module_invoke does not allow call by reference.
if (module_hook($captcha_type, 'captchachallenge')) {
call_user_func_array($captcha_type.'_captchachallenge', array(&$form, &$_SESSION['captcha']));
if(variable_get('captcha_override_module_description', 0)) {
unset($form['captcha_response']['#description']);
}
if (strlen(variable_get('captcha_description', '')) > 0) {
if (isset($form['captcha_response']['#description'])) {
$form['captcha_response']['#description'] .= ' '. variable_get('captcha_description', '');
}
else {
$form['captcha_response']['#description'] = variable_get('captcha_description', '');
}
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment