1 |
3 |
ahitrov@rambler.ru |
<%ARGS> |
2 |
|
|
|
3 |
|
|
$id => undef |
4 |
|
|
$class => undef |
5 |
|
|
$source_class => undef |
6 |
|
|
$dest_class => undef |
7 |
|
|
|
8 |
|
|
</%ARGS> |
9 |
|
|
|
10 |
|
|
|
11 |
|
|
<%init> |
12 |
|
|
if ($id) |
13 |
|
|
{ |
14 |
|
|
my $document = $keeper->get_document_by_id($id, class=>$class); |
15 |
|
|
|
16 |
|
|
my @link_args = (); |
17 |
|
|
if ( exists $ARGS{links} && ref $ARGS{links} eq 'ARRAY' ) { |
18 |
|
|
@link_args = @{ $ARGS{links} } |
19 |
|
|
} elsif ( exists $ARGS{links} ) { |
20 |
|
|
@link_args = ( $ARGS{links} ); |
21 |
|
|
} |
22 |
|
|
|
23 |
|
|
my %nlinks = (); |
24 |
|
|
foreach my $name (@link_args) |
25 |
|
|
{ |
26 |
|
|
if ($name =~ /^link_(\d+)_(\d+)_(.*)$/) |
27 |
|
|
{ |
28 |
|
|
my ($id, $dest_id, $lclass) = ($1, $2, $3); |
29 |
|
|
if ( $id && $lclass ) { |
30 |
|
|
my $link = $keeper->get_link_by_id ($id, |
31 |
|
|
class => $lclass, |
32 |
|
|
); |
33 |
|
|
$link->delete if ref $link; |
34 |
|
|
} |
35 |
|
|
} |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
# ������� �� ���������� ���������... |
39 |
|
|
if ( $source_class ) { |
40 |
|
|
$m->redirect ("document_links.html?id=$id&class=$class&source_class=$source_class"); |
41 |
|
|
} elsif ( $dest_class ) { |
42 |
|
|
$m->redirect ("document_links.html?id=$id&class=$class&dest_class=$dest_class"); |
43 |
|
|
} else { |
44 |
|
|
$m->redirect ("document_links.html?id=$id&class=$class"); |
45 |
|
|
} |
46 |
|
|
} |
47 |
|
|
|
48 |
|
|
</%init> |