| 1 | 3 | ahitrov@rambler.ru | % if ($save == 1) { | 
   
        | 2 |  |  | <script> | 
   
        | 3 |  |  | self.opener.location.reload(); | 
   
        | 4 |  |  | window.close(); | 
   
        | 5 |  |  | </script> | 
   
        | 6 |  |  | % } else { | 
   
        | 7 |  |  |  | 
   
        | 8 |  |  | <& "/contenido/components/header.msn" &> | 
   
        | 9 |  |  | %#<& "/contenido/components/naviline.msn", sect_id => $owner->id &> | 
   
        | 10 |  |  |  | 
   
        | 11 |  |  | % if ( (length($class) <= 0) && (! ref($link)) ) { | 
   
        | 12 |  |  |  | 
   
        | 13 |  |  | %	if ($id) { | 
   
        | 14 |  |  | <div align="center" style="font-size:110%; color:red;"> | 
   
        | 15 |  |  | ����� � ��������������� <% $id %> �� ������� | 
   
        | 16 |  |  | </div> | 
   
        | 17 |  |  | <br><br> | 
   
        | 18 |  |  | %	} else { | 
   
        | 19 |  |  | <!-- ���� � ������� ����� ����� ��� �������� --> | 
   
        | 20 |  |  | <table width="50%" border="0"><tr><td> | 
   
        | 21 |  |  | <fieldset> | 
   
        | 22 |  |  | <legend>�������� ��� ����� ��� ��������</legend> | 
   
        | 23 |  |  | <& "/contenido/components/new_objects_form.msn", proto => 'links' &> | 
   
        | 24 |  |  | </fieldset> | 
   
        | 25 |  |  | </td></tr></table> | 
   
        | 26 |  |  | %	} | 
   
        | 27 |  |  |  | 
   
        | 28 |  |  | % } else { | 
   
        | 29 |  |  | <& "/contenido/components/obj_list_js.msn", object => $link, links_code => 0 &> | 
   
        | 30 |  |  | <& "/contenido/components/object_form.msn", object => $link, proto => 'links' &> | 
   
        | 31 |  |  | % } | 
   
        | 32 |  |  |  | 
   
        | 33 |  |  | </body> | 
   
        | 34 |  |  | </html> | 
   
        | 35 |  |  |  | 
   
        | 36 |  |  | % } ## else save == 1 | 
   
        | 37 |  |  |  | 
   
        | 38 |  |  | <%ARGS> | 
   
        | 39 |  |  | $class => undef | 
   
        | 40 |  |  | $source_id => undef | 
   
        | 41 |  |  | $source_class => undef | 
   
        | 42 |  |  | $id => undef | 
   
        | 43 |  |  | $delete => undef | 
   
        | 44 |  |  | $save => undef | 
   
        | 45 |  |  | </%ARGS> | 
   
        | 46 |  |  |  | 
   
        | 47 |  |  | <%INIT> | 
   
        | 48 |  |  | # �������� ���������� ������ - �� ������ ���� ����� ����... | 
   
        | 49 |  |  | if ($class) | 
   
        | 50 |  |  | { | 
   
        | 51 |  |  | my @correct_classes = @{ $state->{available_links} }; | 
   
        | 52 |  |  | if (! (grep { $_ eq $class } @correct_classes)) | 
   
        | 53 |  |  | { | 
   
        | 54 |  |  | # ����� �����, �� �� �� ���������� | 
   
        | 55 |  |  | $class = undef; | 
   
        | 56 |  |  | } | 
   
        | 57 |  |  | } | 
   
        | 58 |  |  |  | 
   
        | 59 |  |  | my $link; | 
   
        | 60 |  |  | if ($id && ($id !~ /\D/) && ($id > 0)) { | 
   
        | 61 |  |  | $link = $keeper->get_link_by_id($id, class => $class); | 
   
        | 62 |  |  | } else { | 
   
        | 63 |  |  | $link = new $class ($keeper); | 
   
        | 64 |  |  | } | 
   
        | 65 |  |  |  | 
   
        | 66 |  |  |  | 
   
        | 67 |  |  |  | 
   
        | 68 |  |  | #	# ��������... | 
   
        | 69 |  |  | #	if ( defined($id) && ($id > 0) && ($delete == 1) ) | 
   
        | 70 |  |  | #	{ | 
   
        | 71 |  |  | #		$link = $keeper->get_link_by_id($id); | 
   
        | 72 |  |  | #		$link->delete(); | 
   
        | 73 |  |  | # | 
   
        | 74 |  |  | #		$r->header_out("Location", "sections.html?id=".$owner->id); | 
   
        | 75 |  |  | #		$r->status(302); | 
   
        | 76 |  |  | #		$r->send_http_header(); | 
   
        | 77 |  |  | #		$m->abort(); | 
   
        | 78 |  |  | #	} | 
   
        | 79 |  |  |  | 
   
        | 80 |  |  | # ���������� ������������� ��������� ��� �������� ������... | 
   
        | 81 |  |  | # ������, ���� ����� �� �������������� �����... | 
   
        | 82 |  |  | # | 
   
        | 83 |  |  | if ( $save == 1 ) { | 
   
        | 84 |  |  | if ($m->comp('/contenido/components/set_properties.msn', object => $link, SETS => \%ARGS) != 1) { | 
   
        | 85 |  |  | # ������, ���� �� ����������... | 
   
        | 86 |  |  | } | 
   
        | 87 |  |  | $link->store(); | 
   
        | 88 |  |  | } | 
   
        | 89 |  |  | if ($ARGS{_save_auto}) { | 
   
        | 90 |  |  | $m->redirect("./document_links.html?id=".$source_id); | 
   
        | 91 |  |  | } | 
   
        | 92 |  |  |  | 
   
        | 93 |  |  | </%INIT> | 
   
        | 94 |  |  |  |