![]() |
![]()
| ![]() |
![]()
NAMEGantry::Plugins::Calendar - Calendar SYNOPSISuse Gantry::Plugins::Calendar; or use Gantry qw/... Calendar/; DESCRIPTIONIf you have a date field on a web form, which the user must supply, you can use this module to help them. When you've got it set up, your form will have a link sitting next to the date's text entry box. If the user clicks the link, a calendar pops up. It allows for navigation by time period. Each date is just linked text. When the user presses one of the links, that date is entered into the text field as if they had typed it. To make this happen do the following.
That's all. HOW IT WORKSThe three steps above are simple, but they conceal quite a bit of careful Perl and Javascript code. This section explains what is actually happening behind the scenes. When you use the Calendar template, methods are exported into the site object. The important ones are calendar_month_js and do_calendar_month. The global handler will call do_calendar_month for you. calendar_month_js creates two Javascript functions:
You must pass the name of the form to calendar_month_js, otherwise its Javascript won't be able to tell the name to the popup window, which will then be unable to set any dates on your form. do_calendar_month is the method called by the handler when the window pops up. It generates the calendar and manages user interaction with it. It relies on the internal _calendar_month to make the actual output. When the user clicks on a date, its Javascript first calls SetDate with the field name and the date value and then closes the popup window. FUNCTIONSThe other functions are not directly useful to normal callers but here is a complete list. Method you call
Methods called by global handler
Functions used internatlly
SEE ALSOGantry(3) LIMITATIONS and BUGSOnly do_calendary_month has been tested, the other do_* methods are unlikely to work. AUTHORTim Keefer <tkeefer@gmail.com> Phil Crow <philcrow2000@yahoo.com> Nicholas Studt <nstudt@angrydwarf.org> COPYRIGHT and LICENSEThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
|