[%# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. #%] [%# INTERFACE: # name: mandatory; field name # id: optional; field id # value: optional; default field value/selection # classes: optional; an array of classes to be added # onchange: optional; onchange attribute value # disabled: optional; if true, the field is disabled # accesskey: optional; accesskey attribute value # add: optional; prepend menu option for value specified to start of select # dontchange: optional; prepend menu option for "dontchange" to start of select # multiple: optional; do multiselect box, value is size (height) of box # title: optional; extra information to display as a tooltip # products: optional; an array of custom product names # isselect: optional; whether the product list should be displayed as a [% IF add %] [% END %] [% IF dontchange %] [% END %] [% IF Param('useclassification') %] [% classifications = {} %] [% IF products %] [% FOREACH p = products %] [% IF NOT classifications.${p.classification.name}.defined %] [% classifications.${p.classification.name} = [] %] [% END %] [% classifications.${p.classification.name}.push(p) %] [% END %] [% ELSE %] [% FOREACH c = user.get_selectable_classifications %] [% classifications.${c.name} = [] %] [% FOREACH p = user.get_selectable_products(c.id) %] [% classifications.${c.name}.push(p) %] [% END %] [% END %] [% END %] [% FOREACH c = all_classifications %] [% NEXT UNLESS classifications.${c}.size %] [% FOREACH p = classifications.$c %] [% END %] [% END %] [% ELSE %] [% IF NOT products.defined %] [% products = user.get_selectable_products %] [% END %] [% FOREACH p = products %] [% END %] [% END %] [% ELSE %] [% value.join(', ') FILTER html %] [% END %]