customized plugins offered: calendar, html_options, html_select_date, build_query, ulfirst
| From: | Jochem Maas | Date: | Fri, 13 Feb 2004 11:52:15 +0000 |
| Subject: | customized plugins offered: calendar, html_options, html_select_date, build_query, ulfirst | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10947@lists.php.net to get a copy of this message | ||
I have a few customized smarty plugins which others maybe interested in.
a zip file with the plugins and an example file can be found here:
http://iamjochem.com/smarty.zip
The one that others may find most useful is the calendar plugin which is an extension of Michael Yoons calendar plugin (http://michael.yoon.org/software/smarty-plugins/) - new features in my version:
1. can show multiple consecutive months (1 to n)
2. you can show an optional date selector
3. you can call the plugin directly with an extra parameter to have the plugin return its settings to you (e.g. so that you can do something with the date it has set itself to -- under certain circumstances the plugin will change its currently selected date, for instance if you have an unforced selected date which does not fall inside the select month(s) to display... a forced selected date will conversely reset the month(s) to display instead),
4. you can set which day should be the start of the week
5. the layout is styled using CSS (so you have to add a reference to a stylesheet in your output file with a <link> tag) - there is an alternative calendar_vertical.css file which allows a vertical stack of 'months' - but the CSS does not work very well. (I have also included a base.css file which contains some default styling so that my example look nicer ;-)
I want to add the following functionality (don't hold your breath):
1. allow passing an array of details info which will shows up when you mouse-over certain days (probably with use of the overlib.js functionality)
2. make it possible to select a date span (and what I really want is to get a version working where you click'n'drag to select a date range - but this is quite difficult + will only work on DOM compliant browser)
there are (a few) comments regarding usage with in the example file.
------
the plugins do the following:
calendar - creates a calendar view (with optional mutliple months and optional date selector), the calendar plugin comes with a set of file (calendar.tpl, calendar_wrapper.tpl, calendar.css) which need to be placed in the approriate directory (where Smarty can find them in the case of the templates!).
html_options - allows addition of blank && extra item (useful when the options are a selection from a DB but you also want to give a blank/none/other option)
html_select_date - changed URL param prefix to default to 'Date_' iso of '',
build_query - (wrapper around php build_query() function) builds a query string out of a an array (handy for me because I have custom data objects which can output an array of KeyField -names & -values which are used to reference a given dataobject with a URL GET string)
ulfirst - underline the first letter of a word - (i use this in conjunction with accesskeys for HTML <label> tags in order to given a visual hint to users of the access key for a given form element)
------
rgds,
Jochem.
------
PS - I'm on the mailing list - but I may not notice questions due to the volume of mail I receive! - if answers to questions remain unanswered for more than 48 hours please mail me direct!