1 |
3 |
ahitrov@rambler.ru |
<%DOC> |
2 |
|
|
|
3 |
|
|
���������� �������� ������ � ���������� ��� � ����������. |
4 |
|
|
|
5 |
|
|
</%DOC> |
6 |
|
|
<%ARGS> |
7 |
|
|
|
8 |
|
|
$doc |
9 |
|
|
|
10 |
|
|
</%ARGS> |
11 |
|
|
<%INIT> |
12 |
|
|
|
13 |
|
|
return unless ref($doc); |
14 |
|
|
|
15 |
|
|
my @properties = $doc->structure(); |
16 |
|
|
my $images = {}; |
17 |
|
|
for (0..$#properties) |
18 |
|
|
{ |
19 |
|
|
my $prop = $properties[$_]; |
20 |
|
|
my $name = $prop->{attr}; |
21 |
|
|
if ($prop->{type} eq 'image') |
22 |
|
|
{ |
23 |
|
|
my $IMAGE = undef; |
24 |
|
|
if (length($doc->{ $name }) > 8) |
25 |
|
|
{ |
26 |
|
|
$IMAGE = eval ('use vars qw($VAR1); '.$doc->{ $name }); |
27 |
|
|
if (ref($IMAGE) ne 'HASH') { $IMAGE = {} }; |
28 |
|
|
} |
29 |
|
|
$images->{$name} = $IMAGE; |
30 |
|
|
} |
31 |
|
|
elsif ( $prop->{type} =~ /^images/ ) |
32 |
|
|
{ |
33 |
|
|
my $IMAGES = {}; |
34 |
|
|
if (length($doc->{ $name }) > 10) |
35 |
|
|
{ |
36 |
|
|
$IMAGES = eval ('use vars qw($VAR1); '.$doc->{ $prop->{attr} }); |
37 |
|
|
if (ref($IMAGES) ne 'HASH') |
38 |
|
|
{ |
39 |
|
|
$IMAGES = {}; |
40 |
|
|
$IMAGES->{maxnumber} = 0; |
41 |
|
|
}; |
42 |
|
|
} |
43 |
|
|
foreach my $li (keys(%{ $IMAGES })) |
44 |
|
|
{ |
45 |
|
|
if ($li =~ /^image_(\d+)/) |
46 |
|
|
{ |
47 |
|
|
$images->{$name.'_'.$1} = $IMAGES->{$li}; |
48 |
|
|
} |
49 |
|
|
} |
50 |
|
|
} |
51 |
|
|
} |
52 |
|
|
return $images; |
53 |
|
|
|
54 |
|
|
</%INIT> |
55 |
|
|
|