2 # Start w/ mattype, fall back to item_type
5 FOR format_spec IN ['mattype', 'item_type'];
6 formats = ctx.search_ccvm('ctype', format_spec);
7 IF formats.size; BREAK; END;
9 name = name || "fi:" _ format_spec;
10 id = id || "format_selector";
11 values = values || CGI.param(name)
14 <select id='[% id %]' name='[% name %]'[%
15 multiple ? ' multiple="multiple"' : '';
16 size ? (' size="' _ size _ '"') : ''; %]>
17 <option value=''>[% l("All Formats") %]</option>
19 [% FOR o IN formats %]
20 <option value='[% o.code %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : ''%]>[% o.value %]</option>
23 <option value='at'>[% l("Books") %]</option>
24 <option value='at-d'>[% l("Large Print Books") %]</option>
25 <option value='i'>[% l("Audiobooks") %]</option>
26 <option value='g'>[% l("Video Recordings") %]</option>
27 <option value='j'>[% l("Music") %]</option>
28 <option value='m'>[% l("Electronic Resources") %]</option>