diff options
author | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-08-31 18:04:21 +0300 |
---|---|---|
committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-08-31 18:04:21 +0300 |
commit | 0b6664e8f9d19df025739bc4a0cf1821563d6b3d (patch) | |
tree | 5b1de2331d4a9d0eb8d97bbb74be6d794d6260a1 /modules/recaptcha/helpers | |
parent | 0a128bab0a788288c5291491a68bd1c9ab432825 (diff) | |
parent | 23d59dec7240dfa4bffe9d88f46a848e76ce0134 (diff) |
Merge remote branch 'gallery3/master'
Diffstat (limited to 'modules/recaptcha/helpers')
-rw-r--r-- | modules/recaptcha/helpers/recaptcha_event.php | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/modules/recaptcha/helpers/recaptcha_event.php b/modules/recaptcha/helpers/recaptcha_event.php index fda998e1..f185f92b 100644 --- a/modules/recaptcha/helpers/recaptcha_event.php +++ b/modules/recaptcha/helpers/recaptcha_event.php @@ -18,21 +18,17 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class recaptcha_event_Core { - static function user_profile_contact_form($form) { + static function captcha_protect_form($form) { if (module::get_var("recaptcha", "public_key")) { - $form->message->recaptcha("recaptcha")->label("")->id("g-recaptcha"); - } - } + foreach ($form->inputs as $input) { + if ($input instanceof Form_Group) { + $input->recaptcha("recaptcha")->label("")->id("g-recaptcha"); + return; + } + } - static function comment_add_form($form) { - if (module::get_var("recaptcha", "public_key")) { - $form->add_comment->recaptcha("recaptcha")->label("")->id("g-recaptcha"); - } - } - - static function register_add_form($form) { - if (module::get_var("recaptcha", "public_key")) { - $form->register_user->recaptcha("recaptcha")->label("")->id("g-recaptcha"); + // If we haven't returned yet, then add the captcha at the end of the form + $form->recaptcha("recaptcha")->label("")->id("g-recaptcha"); } } |