[geeklog-devel] Bug 0000775 - proposed solution

Dirk Haun dirk at haun-online.de
Sat Mar 21 20:24:30 EDT 2009


Sean Clark wrote:


>These links are all generated using COM_createlink.


Haven't checked myself, but there may be some more links lurking in the
templates.



>4) Insert an conditional statement COM_createfunction that will execute (3)

>if the $url contains /calendar/.


That sounds wrong. You're proposing to introduce code specific to one
plugin into a generic function.



>Using

>/calendar/ is the best way I can think of to ensure this is being applied

>only to calendar links, unless they universally have a $content that could

>be checked (I didn't see one).


The idea with the test is a good one. However, assuming that really all
the links in question are generated by COM_createLink, I would write a
wrapper function in the Calendar that does the test and calls
COM_createLink accordingly. Then change all the calls to COM_createLink
in the Calendar to calls to that wrapper function.

Or, for a more generic approach, change COM_createLink so that it
accepts a callback function for the attributes (instead of passing them
as an array). Then implement that callback function in the Calendar and
again do the test there.



>If these sorts of things aren't discussed on this mailing list, my apologies


No worries. This is our development list after all :-)

bye, Dirk


--
http://www.haun-online.de/
http://geeklog.info/



More information about the geeklog-devel mailing list