summaryrefslogtreecommitdiff
path: root/rt/webrt/Elements/SelectKeyword
blob: c4bd9e1aac73349c3f8a17df83d6fef3de7cec64 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<SELECT NAME=<%$Name%> <%$Size%> <%$Multiple%>>
<OPTION VALUE="">-</OPTION>
<OPTION VALUE="NULL">(empty)</OPTION>
%   foreach my $kid ( keys %{$Descendents} ) {
<OPTION VALUE="<% $kid %>" 
%if ($kid == $Default) {
SELECTED
%}
><% $Descendents->{$kid} %></OPTION>
% }
</SELECT>


<%INIT>

unless (defined $KeywordObj) {
    $KeywordObj = new RT::Keyword($session{'CurrentUser'});
    $KeywordObj->Load($Root);
}
my $Descendents = $KeywordObj->Descendents();

if ($Multiple) {
	$Multiple = "MULTIPLE";
}
if ($Size) {
	$Size="SIZE=$Size";
}	


</%INIT>
<%ARGS>
$Multiple => undef
$Size => undef
$Name => 'Keyword'
$KeywordObj => undef
$Root => 0
$Default => undef
</%ARGS>