1 |
3 |
ahitrov@rambler.ru |
package Contenido::Link; |
2 |
|
|
|
3 |
|
|
# ---------------------------------------------------------------------------- |
4 |
|
|
# ����� ����� |
5 |
|
|
# ����� ����� �� �������� �� ��� �����������, ��� �� |
6 |
|
|
# ���������� ����� ������ �� ����� ����� �������������� �����. |
7 |
|
|
# ---------------------------------------------------------------------------- |
8 |
|
|
|
9 |
|
|
use strict; |
10 |
|
|
use warnings; |
11 |
|
|
use locale; |
12 |
|
|
|
13 |
|
|
use base 'Contenido::Object'; |
14 |
|
|
|
15 |
|
|
use Contenido::Globals; |
16 |
|
|
|
17 |
|
|
# ---------------------------------------------------------------------------- |
18 |
|
|
# ����� class_name() - ���������� ��� ������ |
19 |
|
|
# ---------------------------------------------------------------------------- |
20 |
|
|
sub class_name |
21 |
|
|
{ |
22 |
|
|
return '�����'; |
23 |
|
|
} |
24 |
|
|
|
25 |
|
|
sub class_description |
26 |
|
|
{ |
27 |
|
|
return '����� �� ���������'; |
28 |
|
|
} |
29 |
|
|
|
30 |
|
|
# ���� ���������� ������� |
31 |
|
|
sub class_table |
32 |
|
|
{ |
33 |
|
|
return 'SQL::LinkTable'; |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
# ---------------------------------------------------------------------------- |
37 |
|
|
# �����������. ������� ����� ������ �����... |
38 |
|
|
# |
39 |
|
|
# ������ �������������: |
40 |
|
|
# Contenido::Link->new() |
41 |
|
|
# Contenido::Link->new($keeper) |
42 |
|
|
# Contenido::Link->new($keeper,$id) |
43 |
|
|
# ---------------------------------------------------------------------------- |
44 |
|
|
sub new |
45 |
|
|
{ |
46 |
|
|
my ($proto, $keeper, $id) = @_; |
47 |
|
|
my $class = ref($proto) || $proto; |
48 |
|
|
my $self; |
49 |
|
|
|
50 |
|
|
if (defined($id) && ($id>0) && defined($keeper)) { |
51 |
|
|
$self=$keeper->get_link_by_id($id, class=>$class); |
52 |
|
|
} else { |
53 |
|
|
$self = {}; |
54 |
|
|
bless($self, $class); |
55 |
|
|
$self->init(); |
56 |
|
|
$self->class($class); |
57 |
|
|
|
58 |
|
|
$self->keeper($keeper) if (ref $keeper); |
59 |
|
|
} |
60 |
|
|
return $self; |
61 |
|
|
} |
62 |
|
|
|
63 |
|
|
#������� ������ available_sources (���������� ��� ������) |
64 |
|
|
sub available_sources { |
65 |
|
|
# return $state->{available_documents}; |
66 |
|
|
return []; |
67 |
|
|
} |
68 |
|
|
|
69 |
|
|
sub available_destinations { |
70 |
|
|
return []; |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
#sub _get_table { |
74 |
|
|
# return class_table->new(); |
75 |
|
|
#} |
76 |
|
|
|
77 |
|
|
1; |
78 |
|
|
|