Line # Revision Author
1 3 ahitrov@rambler.ru <style>
2 <!--
3 .tab { font:9pt Verdana; padding:1px 5px 2px 5px;
4 border-top:1px solid silver; border-left:1px solid silver; border-right:2px solid silver; }
5 .tab a { text-decoration:none; }
6 .tabi { font:9pt Verdana; padding:1px 5px 1px 5px; background: #d0d0d0;
7 border-top:1px solid #f0f0f0; border-left:1px solid #f0f0f0; border-right:2px solid silver; }
8 .tabi a { text-decoration:none; }
9 -->
10 </style>
11 <script language="javascript">
12 <!--
13 var Controls = [\
14 % if ( ref $links eq 'ARRAY' && scalar @$links ) {
15 % for ( 0 .. (scalar(@$links)-1) ) {
16 % if ( $_ ) { $m->out(',') }
17 'tab_<% $_ %>'\
18 % }
19 % }
20 ];
21 function SetActive ( sControl ) {
22 var oControl;
23 for (sC in Controls) {
24 oControl = document.getElementById(Controls[sC]);
25 oControl.style.backgroundColor = '#d0d0d0';
26 oControl.style.borderTop = '1px solid #f0f0f0';
27 oControl.style.borderLeft = '1px solid #f0f0f0';
28 }
29 oControl = document.getElementById(sControl);
30 oControl.style.backgroundColor = 'white';
31 oControl.style.borderTop = '1px solid silver';
32 oControl.style.borderLeft = '1px solid silver';
33 }
34 //-->
35 </script>
36 % if ( ref $links eq 'ARRAY' && scalar @$links ) {
37 % my $deflink = $links->[0];
38 187 ahitrov % my $id = exists $deflink->{source_field} ? $deflink->{source_field} : 'id';
39 3 ahitrov@rambler.ru % my $auto = '';
40 % if ( exists $deflink->{auto} && ref $deflink->{auto} eq 'HASH' ) {
41 % while ( my ($from, $to) = each %{ $deflink->{auto} } ) {
42 % $auto .= '&from='.$from.'&to='.$document->$to;
43 % }
44 % }
45 <fieldset style="width:97%;">
46 <legend>����������� ����� ���������</legend>
47 <div style="border-bottom:2px solid gray; padding:1px 0 2px;">
48 % my $i = 0;
49 % foreach my $link ( @$links ) {
50 187 ahitrov % my $id = exists $link->{source_field} ? $link->{source_field} : 'id';
51 3 ahitrov@rambler.ru % my $auto = '';
52 % if ( exists $link->{auto} && ref $link->{auto} eq 'HASH' ) {
53 % while ( my ($from, $to) = each %{ $link->{auto} } ) {
54 % $auto .= '&from='.$from.'&to='.$document->$to;
55 % }
56 % }
57 <span id="tab_<% $i %>" class="tab<% $i ? 'i' : '' %>"><a onclick="SetActive('tab_<% $i %>')"
58 187 ahitrov href="document_filter_list.html?class=<% $link->{class} %>&filter=<% $link->{filter} %>&field=<% $link->{field} %><% $auto %>&id=<% $document->$id %><% exists $link->{order_by} ? '&order_by='.$link->{order_by} : '' %>"
59 3 ahitrov@rambler.ru target="filtered"><% $link->{name} %></a></span>\
60 % $i++;
61 % }
62 </div>
63 187 ahitrov <iframe id="filtered" name="filtered" src="document_filter_list.html?class=<% $deflink->{class} %>&filter=<% $deflink->{filter} %>&field=<% $deflink->{field} %><% $auto %>&id=<% $document->$id %><% exists $deflink->{order_by} ? '&order_by='.$deflink->{order_by} : '' %>"
64 3 ahitrov@rambler.ru width="100%" height="470" frameborder="0"></iframe>
65 </fieldset>
66 % }
67 <%args>
68
69 $document => undef
70
71 </%args>
72 <%init>
73
74 return unless ref $document;
75 my $links = $document->table_links;
76
77 </%init>