Handle position in forms better (Contact, CCK forms)
Benj — Sat, 02/06/2007 - 12:57
Hi,
on cck content add/edit forms, the mycaptcha field seems randomly placed: it can appear in the middle of the form instead of being at the very bottom.
It would be good if you could fix this so the catcha field would systematically be displayed at the bottom of cck add/edit forms.
Cordially,
Benj
I'll see what I can do about it
Heine — Mon, 04/06/2007 - 21:26Thanks Benj,
The very bottom would indeed be a preferable location. I'll see what I can do about it, but I can't promise it will be done before the next weekend.
Kind regards,
Heine
patch for the mycaptcha form weight problem
Anonymous (not verified) — Thu, 02/08/2007 - 19:47here's a patch for mycap.module which enables a "weight" option in the mycaptcha admin area.
);
}
}
+
+ $form['captcha_weight'] = array(
+ '#title' => t('Captcha weight'),
+ '#type' => 'weight',
+ '#default_value' => variable_get('mycap_captcha_weight', '0'),
+ );
+
$form['button']['save'] = array(
'#type' => 'submit',
'#value' => t('Save'),
@@ -158,6 +165,7 @@
*/
function mycap_settings_form_submit($form_id, $form_values) {
variable_set('mycap_captcha_type', $form_values['captcha_type']);
+ variable_set('mycap_captcha_weight', $form_values['captcha_weight']);
$captcha_setting = $form_values['captcha_setting'];
foreach ($captcha_setting as $rid => $settings) {
foreach ($settings as $variable => $enabled) {
@@ -275,6 +283,8 @@
$form['#validate']['mycap_validate_captcha'] = array();
$form['#pre_render'][] = 'mycap_prerender_captcha';
$form['#submit']['mycap_unset_captcha'] = array();
+
+ $form['captcha']['#weight'] = variable_get('mycap_captcha_weight', '0');
// Prevent caching of this page.
$GLOBALS['conf']['cache'] = FALSE;
@@ -680,4 +690,4 @@
}
$x += $char_width + mt_rand(-1, $max_delta_x);
}
-}
COmmit
Benj — Sun, 05/08/2007 - 11:08Hi,
can this be commited to mycaptcha ?
I'm a bit disapointed that this module isn't updated more often.
Cordially,
Benj
My spare time is
Heine — Sun, 05/08/2007 - 19:08My spare time is limited.
The patch above is not a good solution IMO, because the weight the captcha should get depends on the form.
Post new comment