Koha/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc
Galen Charlton ea543fdee0 Bug 766: (follow-up) improve usage comments in new TT include
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-04 23:11:34 +00:00

29 lines
955 B
HTML

[% USE AuthorisedValues %]
[%#
Parameters:
name: the name of the select element
category: the authorised value category
default: the default authorised value to select
class: the CSS class of the select element
size: the size to use for the input (generated if the authorised value category does not exist).
%]
[% SET avs = AuthorisedValues.GetAuthValueDropbox( category, default ) %]
[% DEFAULT
class = ''
size = 20
%]
[% IF avs %]
<select id="[% name %]" name="[% name %]" class="[% class %]" >
[% FOR av IN avs %]
[% IF av.default %]
<option value="[% av.value %]" selected="selected">[% av.label | html_entity %]</option>
[% ELSE %]
<option value="[% av.value %]">[% av.label | html_entity %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
<input type="text" id="[% name %]" name="[% name %]" size="[% size %]" value="[% default | html_entity %]" class="[% class %]" />
[% END %]