More themeability

stBorchert - May 30, 2009 - 12:10
Project:Mollom
Version:6.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Hey.
I've tried to theme the "play audio CAPTCHA" link and put the image (and the link) into a custom HTML structure but without any theme functions there is no chance to do this.
So here you are: 4 tiny theme functions to output the links and the image.

Stefan

AttachmentSize
mollom_more-themeability.patch3.44 KB

#1

Dave Reid - June 10, 2009 - 04:24

Seems like it would be a good improvement. The only problem I would have is that in theme_mollom_captcha(), the <div id="captcha"> is required for the JavaScript switching to work. To me having this entire thing themed implies that it isn't a required, and this could cause problems if it is not properly override without the div.

#2

Dries - June 10, 2009 - 06:43

1. If the ID is required, we could write #prefix => '<div id="captcha">' . theme('mollom_captcha', $response) .'</div>', or would that be blasphemy for designers? Still sounds better than hard-coding everything so certainly a step forward.

2. I'd remove theme_mollom_audio_captcha_link and theme_mollom_image_captcha_link and just go with their parent theme function: theme_mollom_captcha. Too many small theme functions can be a pain too, IMO.

3. The next step would be to make actual template files, of course, instead of theme functions. :-)

#3

Dries - June 10, 2009 - 07:09
Status:needs review» needs work

#4

stBorchert - June 22, 2009 - 22:05
Status:needs work» needs review

Hey.
I've reworked the patch and introduced 2 template files:
* mollom-audio-captcha.tpl.php
* mollom-image-captcha.tpl.php

Stefan

AttachmentSize
mollom-477298-themeability.patch 4.37 KB

#5

jenlampton - September 22, 2009 - 16:33

It would be great to get these re-rolled against the latest version :-)
pretty please?
Jen

#6

stBorchert - September 22, 2009 - 21:20

I've tested it right now and it still applies without any problems to latest HEAD.
No need to reroll, only "committed to head" is missing :-)

#7

Dave Reid - October 14, 2009 - 03:02
Status:needs review» needs work

Do we *really* need template files for a link? Isn't using theme() enough to be able to override how it is displayed?

#8

jcmarco - December 1, 2009 - 13:23
Status:needs work» needs review

Just theming the link title

AttachmentSize
mollom_link_theming.patch 1.48 KB
 
 

Drupal is a registered trademark of Dries Buytaert.