Skip to content
Snippets Groups Projects
Commit 286024a2 authored by Rob Loach's avatar Rob Loach
Browse files

#176909: Put CAPTCHA administration links in Field Sets

parent 9f70c0c5
No related branches found
Tags 5.x-3.1
Loading
......@@ -515,25 +515,24 @@ function captcha_form_alter($form_id, &$form) {
return;
}
$captcha_point = db_fetch_object($result);
$form['captcha'] = array(
'#type' => 'fieldset',
'#title' => 'CAPTCHA',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
if ($captcha_point && $captcha_point->type) {
$form['captcha'] = array(
'#type' => 'item',
'#title' => t('CAPTCHA administration'),
'#description' => t('The challenge "@type" (by module "@module") is enabled here for untrusted users: !edit, !disable or !general.', array(
'@type' => $captcha_point->type,
'@module' => $captcha_point->module,
'!edit' => l(t('edit challenge type'), "admin/user/captcha/$form_id", array(), drupal_get_destination()),
'!disable' => l(t('disable challenge'), "admin/user/captcha/$form_id/disable", array(), drupal_get_destination()),
'!general' => l(t('edit general challenge settings'), "admin/user/captcha"),
))
$form['captcha']['#description'] = t('The challenge "@type" (by module "@module") is enabled here for untrusted users: !edit, !disable or !general.', array(
'@type' => $captcha_point->type,
'@module' => $captcha_point->module,
'!edit' => l(t('edit challenge type'), "admin/user/captcha/$form_id", array(), drupal_get_destination()),
'!disable' => l(t('disable challenge'), "admin/user/captcha/$form_id/disable", array(), drupal_get_destination()),
'!general' => l(t('edit general challenge settings'), "admin/user/captcha"),
)
);
}
else {
$form['captcha'] = array(
'#type' => 'item',
'#title' => t('CAPTCHA administration'),
'#description' => l(t('Place a challenge here for untrusted users.'), "admin/user/captcha/$form_id/enable", array(), drupal_get_destination()),
);
$form['captcha']['#description'] = l(t('Place a challenge here for untrusted users.'), "admin/user/captcha/$form_id/enable", array(), drupal_get_destination());
}
// Add pre_render function for placing the CAPTCHA just above the submit button
$form['#pre_render'] = ((array) $form['#pre_render']) + array('captcha_pre_render_place_captcha');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment