| 1 | 3 | ahitrov@rambler.ru | <& "/contenido/components/title.msn" &> | 
   
        | 2 |  |  | <style> | 
   
        | 3 |  |  | <!-- | 
   
        | 4 |  |  | fieldset { font:11px Verdana; } | 
   
        | 5 |  |  | fieldset table { font:11px Verdana; } | 
   
        | 6 |  |  | fieldset table td { padding:1px 4px; } | 
   
        | 7 |  |  | fieldset table th { font:bold 10px Verdana; padding:1px 2px;  } | 
   
        | 8 |  |  | div.pad_active { font-weight:bold; padding:3px 4px; border-bottom:2px solid gray; float:left; | 
   
        | 9 |  |  | border-right:1px solid gray; background:#f0f0f0; border-top:1px solid #f0f0f0; border-left:1px solid #f0f0f0; } | 
   
        | 10 |  |  | div.pad_passive { padding:3px 4px; border-bottom:2px solid gray; float:left; | 
   
        | 11 |  |  | border-right:1px solid gray; background:#d0d0d0; border-top:1px solid #f0f0f0; border-left:1px solid #f0f0f0; }; | 
   
        | 12 |  |  | --> | 
   
        | 13 |  |  | </style> | 
   
        | 14 |  |  | <script type="text/javascript"> | 
   
        | 15 |  |  | <!-- | 
   
        | 16 |  |  | function switch_div (sName) { | 
   
        | 17 |  |  | var oDiv = document.getElementById(sName); | 
   
        | 18 |  |  | var oDivPrompt = document.getElementById(sName + '_hidden'); | 
   
        | 19 |  |  | if ( oDiv.style.display == 'block' ) { | 
   
        | 20 |  |  | oDiv.style.display = 'none'; | 
   
        | 21 |  |  | oDivPrompt.style.display = 'block'; | 
   
        | 22 |  |  | } else { | 
   
        | 23 |  |  | oDiv.style.display = 'block'; | 
   
        | 24 |  |  | oDivPrompt.style.display = 'none'; | 
   
        | 25 |  |  | } | 
   
        | 26 |  |  | } | 
   
        | 27 |  |  | //--> | 
   
        | 28 |  |  | </script> | 
   
        | 29 |  |  | % if ($document) { | 
   
        | 30 |  |  | %	if ( @sources ) { | 
   
        | 31 |  |  | %		my $show = (@sources && $link_class && grep { $_ eq $link_class } @sources) || ((@sources && @destinations) || !@destinations) ? 1 : 0; | 
   
        | 32 |  |  | %		my $lclass = $link_class; | 
   
        | 33 |  |  | %		if ( $link_class && grep { $_ eq $link_class } @destinations ) { | 
   
        | 34 | 371 | ahitrov | %			if ( grep { $_ eq $link_class } @sources ) { | 
   
        | 35 |  |  | %				$show = 1; | 
   
        | 36 |  |  | %			} else { | 
   
        | 37 |  |  | %				$show = 0; | 
   
        | 38 |  |  | %				$lclass = undef; | 
   
        | 39 |  |  | %			} | 
   
        | 40 | 3 | ahitrov@rambler.ru | %		} | 
   
        | 41 |  |  | <fieldset> | 
   
        | 42 |  |  | <legend>→ <a href="javascript:switch_div('div_source')" style="color:white;" | 
   
        | 43 |  |  | onclick="switch_div('div_source'); return false;">�����, ������� �� ����� ���������:</a></legend> | 
   
        | 44 |  |  | <div id="div_source" style="display:<% $show ? 'block' : 'none' %>"> | 
   
        | 45 |  |  | <& "/contenido/components/document_links_block.msn", | 
   
        | 46 |  |  | document => $document, lclasses => \@sources, class => $lclass, p => $p, | 
   
        | 47 |  |  | link_id_name => 'source_id', | 
   
        | 48 | 371 | ahitrov | link_class_name => 'source_class', | 
   
        | 49 |  |  | parent_url	=> $parent_url, | 
   
        | 50 | 3 | ahitrov@rambler.ru | &> | 
   
        | 51 |  |  | </div> | 
   
        | 52 |  |  | <div id="div_source_hidden" style="display:<% $show ? 'none' : 'block' %>; padding:5px;"><a href="javascript:switch_div('div_source')" | 
   
        | 53 |  |  | onclick="switch_div('div_source'); return false;">���������� ������</a></div> | 
   
        | 54 |  |  | </fieldset> | 
   
        | 55 |  |  | %	} | 
   
        | 56 |  |  | %	if ( @destinations ) { | 
   
        | 57 |  |  | %		my $show = (@destinations && $link_class && grep { $_ eq $link_class } @destinations ) || !@sources ? 1 : 0; | 
   
        | 58 |  |  | %		my $lclass = $link_class; | 
   
        | 59 |  |  | %		if ( $link_class && grep { $_ eq $link_class } @sources ) { | 
   
        | 60 | 371 | ahitrov | %			if ( grep { $_ eq $link_class } @destinations ) { | 
   
        | 61 |  |  | %				$show = 1; | 
   
        | 62 |  |  | %			} else { | 
   
        | 63 |  |  | %				$show = 0; | 
   
        | 64 |  |  | %				$lclass = undef; | 
   
        | 65 |  |  | %			} | 
   
        | 66 | 3 | ahitrov@rambler.ru | %		} | 
   
        | 67 |  |  | <fieldset> | 
   
        | 68 |  |  | <legend>← <a href="javascript:switch_div('div_destination')" style="color:white;" | 
   
        | 69 |  |  | onclick="switch_div('div_destination'); return false;">�����, ������� � ����� ���������:</a></legend> | 
   
        | 70 |  |  | <div id="div_destination" style="display:<% $show ? 'block' : 'none' %>"> | 
   
        | 71 |  |  | <& "/contenido/components/document_links_block.msn", | 
   
        | 72 |  |  | document => $document, lclasses => \@destinations, class => $lclass, p => $p, | 
   
        | 73 |  |  | link_id_name => 'dest_id', | 
   
        | 74 | 371 | ahitrov | link_class_name => 'dest_class', | 
   
        | 75 |  |  | parent_url	=> $parent_url, | 
   
        | 76 | 3 | ahitrov@rambler.ru | &> | 
   
        | 77 |  |  | </div> | 
   
        | 78 |  |  | <div id="div_destination_hidden" style="display:<% $show ? 'none' : 'block' %>; padding:5px;"><a href="javascript:switch_div('div_destination')" | 
   
        | 79 |  |  | onclick="switch_div('div_destination'); return false;">���������� ������</a></div> | 
   
        | 80 |  |  | </fieldset> | 
   
        | 81 |  |  | %	} | 
   
        | 82 |  |  | % } else { | 
   
        | 83 |  |  | <p><font color="red">�� ���� �������� �������� �� ������ id=<% $id %> � class=<% $class %></font></p> | 
   
        | 84 |  |  | % } | 
   
        | 85 |  |  | </body> | 
   
        | 86 |  |  | </html> | 
   
        | 87 |  |  |  | 
   
        | 88 |  |  | <%ARGS> | 
   
        | 89 |  |  |  | 
   
        | 90 |  |  | $p	=> 1 | 
   
        | 91 |  |  | $class	=> undef | 
   
        | 92 |  |  | $id	=> undef | 
   
        | 93 |  |  | $link_class	=> undef | 
   
        | 94 | 371 | ahitrov | $parent_url	=> undef | 
   
        | 95 | 3 | ahitrov@rambler.ru |  | 
   
        | 96 |  |  | </%ARGS> | 
   
        | 97 |  |  |  | 
   
        | 98 |  |  | <%INIT> | 
   
        | 99 | 371 | ahitrov |  | 
   
        | 100 | 3 | ahitrov@rambler.ru | return unless ($state->{available_links} and @{$state->{available_links}}); | 
   
        | 101 | 371 | ahitrov | $parent_url ||= $r->header_in("Referer"); | 
   
        | 102 | 3 | ahitrov@rambler.ru | my $document; | 
   
        | 103 |  |  | my (@sources, @destinations); | 
   
        | 104 |  |  | if ($id && ($id !~ /\D/) && ($id > 0)) { | 
   
        | 105 |  |  | $document = $keeper->get_document_by_id($id, class=>$class); | 
   
        | 106 |  |  | } | 
   
        | 107 |  |  | if ( ref $document ) { | 
   
        | 108 |  |  | foreach my $classlink ( @{ $state->{available_links} } ) { | 
   
        | 109 |  |  | my $sources = $classlink->available_sources; | 
   
        | 110 |  |  | if ( ref $sources eq 'ARRAY' && @$sources ) { | 
   
        | 111 |  |  | push @sources, $classlink	if grep { $document->class eq $_ } @$sources; | 
   
        | 112 |  |  | } | 
   
        | 113 |  |  | my $dests = $classlink->available_destinations; | 
   
        | 114 |  |  | if ( ref $dests eq 'ARRAY' && @$dests ) { | 
   
        | 115 |  |  | push @destinations, $classlink	if grep { $document->class eq $_ } @$dests; | 
   
        | 116 |  |  | } | 
   
        | 117 |  |  | } | 
   
        | 118 |  |  | } | 
   
        | 119 |  |  | </%INIT> | 
   
        | 120 |  |  |  |