+
+% if ($opt{'toggle_disabled'}) {
+% unless ($toggle_disabled_init) {
+% $toggle_disabled_init = 1;
+
+<SCRIPT>
+function toggle_disabled (id, disabled_on) {
+ var selectbox = document.getElementById(id);
+ for (var i = 0; i < selectbox.length; i++) {
+ var optionbox = selectbox.options[i];
+ if (optionbox.getAttribute('data-disabled')) {
+ optionbox.hidden = (disabled_on || optionbox.selected) ? false : true;
+ }
+ }
+ var switchlink = document.getElementById(id+'_switch');
+ switchlink.innerHTML = disabled_on ? '<% emt("hide disabled packages") %>' : '<% emt("show disabled packages") %>';
+ switchlink.onclick = function () { toggle_disabled(id, disabled_on ? 0 : 1) };
+}
+</SCRIPT>
+
+% } # unless $toggle_disabled_init
+
+<BR><A
+ HREF="javascript:void(0)"
+ STYLE="font-size: smaller"
+ ONCLICK="toggle_disabled('<% $opt{'id'} %>',1)"
+ ID="<% $opt{'id'} %>_switch"><% emt("show disabled packages") %></A>
+
+% } # if $opt{'toggle_disabled'}
+
+<%shared>
+my $toggle_disabled_init = 0;
+</%shared>