|
From: Chris W. <la...@us...> - 2001-10-11 15:15:12
|
Update of /cvsroot/openinteract/OpenInteract/template
In directory usw-pr-cvs1:/tmp/cvs-serv17029
Added Files:
date_select
Log Message:
copied date selecting component from base_component
--- NEW FILE: date_select ---
[%########################################
date_select( year_list, year_value, month_value, day_value,
blank, year_field, month_field, day_field, field_prefix )
Display three dropdown boxes for inputting dates.
Parameters:
year_list = list of years
year_value = chosen year
month_value = chosen month (number)
day_value = chosen day (number)
blank = if true, start each SELECT with a blank option
year_field = name for year SELECT
month_field = name for month SELECT
day_field = name for day SELECT
field_prefix = use instead of specifying year/month/day_field;
prefix to put in front of '_year', '_month' and
'_day' (e.g, if field_prefix = 'birthdate', the
fields would be 'birthdate_year',
'birthdate_month', and 'birthdate_day')
comment = if true includes an HTML comment with values (debugging)
Defaults:
year_list = 2000 .. 2010
########################################-%]
[%- SET month_names = [ 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' ];
DEFAULT year_list = [ 2000..2010 ]; -%]
[%- IF field_prefix -%]
[%- month_field = "${field_prefix}_month";
day_field = "${field_prefix}_day";
year_field = "${field_prefix}_year"; -%]
[% END -%]
[% INCLUDE form_select( name = month_field, plain = 1, first_blank = is_blank,
value_list = [ 1..12 ], label_list = month_names,
picked = month_value ) -%]
[% INCLUDE form_select( name = day_field, plain = 1, first_blank = is_blank,
value_list = [ 1..31 ], picked = day_value ) -%]
[% INCLUDE form_select( name = year_field, plain = 1, first_blank = is_blank,
value_list = year_list, picked = year_value ) -%]
[% IF comment %]<!-- Date: [% year_value %] (y) [% month_value %] (m) [% day_value %] (d) -->[% END -%]
|