Re: HTML::HTML_QuickForm2_Captcha

[email protected] (Christian Weiske) Tue, 26 Mar 2013 12:49:13 +0100
Newsgroups php.pear.dev
Message-ID <20130326124913.0c87f1dd@bogo>
Hello Bertrand,




> Bertrand Mansion (http://pear.php.net/user/mansion) has voted +1 on
> the proposal for HTML::HTML_QuickForm2_Captcha.

> The question should probably be the label ->setLabel()
But then I would need to adjust the rendering of the element, because
the label would be the captcha then. This might be ok for numeral
captchas, but not for image, figlet or recaptcha ones that are very
large. This would break all layouts.

Also, people expect that labels don't contain HTML apart from the
required * markers.


> Or maybe you should extend Container instead (my recommandation if
> you find a way to do that, it's more flexible because then you can
> use the dom like api to change the elements) and use
> $this->addStatic() and $this->addText() depending on the elements you
> want to add.
So like

> $captcha = new HTML_QuickForm2_Element_Captcha_Figlet();

This class extends the captcha-container, which has a
->addQuestion() method that gets called internally by the figlet
captcha class?


> I don't think it is a very good idea to add a div around
> these elements, this should probably be left to the renderer.
I did not want to make people touch the renderers at all, since that's
something my elements cannot influence. Or am I wrong? 


> If you use a Container, you can also use $attributes in the
> constructor instead of $this->data['captchaHtmlAttributes']. Remember
> that all the elements extend HTML_Common2 that has utility methods to
> deal with attributes.
Right.


> Recaptcha doesn't seem to need a session, maybe you should treat it
> as a totally different element on its own instead of a subclass of
> Captcha.
Oh, it uses the session to keep track of the "solved" state so you
don't have to solve the captcha again and again when other fields on
the form are invalid.

-- 
Regards/Mit freundlichen Grüßen
Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlFRizkACgkQFMhaCCTq+COabACdEWG+560TePUsUeE/zdIQxBAJ
seUAoLKhLVJDvJnhpCyST+iurnTaZ50O
=3PHJ
-----END PGP SIGNATURE-----