summaryrefslogtreecommitdiff
path: root/rt/webrt/Elements/yearMenu
blob: 4a0e7a77232f9c18d4f87d82540f3600f8ef8fff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<%doc>-------------------------------------------------------------------
yearMenu: Display a pulldown menu of years.

Optional arguments:
$menu_name - Name of menu, defaults to 'year'
$current - Selected year value
$min - Minimum year appearing in menu; defaults to current year
$max - Maximum year appearing in menus; defaults to $min plus 10.
-------------------------------------------------------------------</%doc>

<select name="<% $menu_name %>">
<option value="-1">-
% foreach my $year ($min..$max) {
<option value="<% $year %>" <% $year==$current ? "selected" : "" %>>
<% $year %>
% }
</select>

<%args>
$menu_name=>'year'
$current=>(localtime)[5]+1900
$min=>(localtime)[5]+1900-1
$max=>$min+10
</%args>