There's no very good documentation, unfortunately - there's the page in the SF documentation, which you've probably seen, and which I just updated:


There's also the Semantic Google Maps code, which you noted, although looking at it now, it looks quite buggy - there are references to $gTabIndex that should be $sfgTabIndex, for instance, and $sfgFieldNum isn't there at all, even though it should be; which makes me glad that the code is now obsolete. :)

I would recommend instead following the code in SF itself, such as, as you note, the function dateEntryHTML() in /includes/SF_FormInputs.inc. If you use that as the model for your function, you should be alright. Note that global variables will still be accessible in your function, even though it's in a different extension.


On Wed, Jul 22, 2009 at 11:38 PM, Patrick Nagel <mail@patrick-nagel.net> wrote:
Hi Yaron,

On 2009-07-22 22:06, Yaron Koren wrote:
> My personal opinion is that this doesn't seem like a useful feature -
> first, because I've never seen such a thing on a web date input; and
> second, because the SF date input already presets the current month and
> year, so (unless you're on the 1st of the month) it just saves you the
> trouble of writing the day. If anyone disagrees, feel free to chime in.

Fair enough.

> Having to maintain a patch for an extension is not good, though, so, if
> you want to keep this functionality even if it doesn't get added to SF,
> I would suggest creating a new mini-extension that defines this as a new
> form input, using SF's hook to add it to the system.

Sounds like a good solution. I had a look at SemanticGoogleMaps' code [1], but
I'm not clear about how to put everything together. How would I get
$sfgFieldNum just at the time when a dateEntryHTML had been called? Is there
some documentation on how everything works together that you could recommend?



Key ID: 0x86E346D4            http://patrick-nagel.net/key.asc
Fingerprint: 7745 E1BE FA8B FBAD 76AB 2BFC C981 E686 86E3 46D4

Semediawiki-devel mailing list