4 # Use this include for flip open or shut a filter controlpanel/block.
5 # The source file must contain the BLOCK "filter_toggle_panel"
8 # If you want to use MORE THAN ONE filter controlpanel/block
9 # use the variable "block_name" with one of the block names
10 # before the include statement
12 # OPEN / CLOSED STATUS
13 # If you want to have the filter block flipped out (open)
14 # then use the optional statement ( SET display_status = 'open' )
15 # before the include statement
18 # At least a BLOCK like the default 'filter_toggle_panel'
19 # and the INCLUDE-Statement are required
21 # BLOCK filter_toggle_panel ; # mandatory, with variable block_name another block name is possible
23 # END ; # END of block filter_toggle_panel
24 # INCLUDE 'common/toggle_panel.html' #
25 # block_name = 'this_is_block_2' # optional / one of all the filter panels, default is 'filter_toggle_panel'
26 # toggle_class = 'panel_2' # optional / one of all the button/panel classes, default is 'toggle_panel'
27 # display_status = 'open' # optional / default/empty is 'closed'
28 # button_closed = 'Show Filter' # optional / Term in closed button / default/empty is 'Show Filter' (historical)
29 # button_open = 'Hide Filter' # optional / Term in opened button / default/empty is 'Hide Filter' (historical)
33 IF display_status && display_status == 'open' ;
34 SET display_off = 'style="display:none;"' ;
35 SET display_on = 'style="display:block;"' ;
36 ELSIF ( display_status && ( display_status == 'closed' || display_status == '' ) ) || !display_status ;
37 SET display_off = 'style="display:block;"' ;
38 SET display_on = 'style="display:none;"' ;
40 IF !button_closed || button_closed == '' ;
41 SET button_closed = LxERP.t8('Show Filter') ; # Default Term Filter is historical
43 IF !button_open || button_open == '' ;
44 SET button_open = LxERP.t8('Hide Filter') ; # Default Term Filter is historical
46 IF !toggle_class || toggle_class == '';
47 toggle_class = 'toggle_panel' ; # this is default for one toggle panel per page
51 <div class="toggle_panel control-panel [% toggle_class %]" [% display_off %]>
52 <a href="#" onClick='javascript:$(".[% toggle_class %]").toggle()' class="button toggle off neutral">[% button_closed %]</a>
53 [% IF SELF.filter_summary %]([% LxERP.t8("Current filter") %]: [% SELF.filter_summary | html %])[% END %]
56 <div class="toggle_panel control-panel [% toggle_class %]" [% display_on %]>
57 <a href="#" onClick='javascript:$(".[% toggle_class %]").toggle()' class="button toggle on neutral with-panel">[% button_open %]</a>
58 <div class="toggle_panel_block">
59 [% IF block_name && block_name != '' %]
61 #Dumper.dump_html(block_name) ;
62 IF block_name == 'panel_1' ;
64 ELSIF block_name == 'panel_2' ;
66 ELSIF block_name == 'panel_3' ;
71 [% PROCESS filter_toggle_panel %]
75 </div><!-- /.filter_toggle -->
77 # Reset in case of more than one toggle object
78 SET display_status = '' ; SET display_off = '' ; SET display_on = '' ;
80 SET button_closed = '' ;
81 SET button_open = '' ;