Revision 469 (by ahitrov, 2014/12/24 13:57:26) |
Moving Contenido to Apache 2
|
<%DOC>
���������� �������� ������ � ���������� ��� � ����������.
</%DOC>
<%ARGS>
$doc
</%ARGS>
<%INIT>
return unless ref($doc);
my @properties = $doc->structure();
my $images = {};
for (0..$#properties)
{
my $prop = $properties[$_];
my $name = $prop->{attr};
if ($prop->{type} eq 'image')
{
my $IMAGE = undef;
if (length($doc->{ $name }) > 8)
{
$IMAGE = eval ('use vars qw($VAR1); '.$doc->{ $name });
if (ref($IMAGE) ne 'HASH') { $IMAGE = {} };
}
$images->{$name} = $IMAGE;
}
elsif ( $prop->{type} =~ /^images/ )
{
my $IMAGES = {};
if (length($doc->{ $name }) > 10)
{
$IMAGES = eval ('use vars qw($VAR1); '.$doc->{ $prop->{attr} });
if (ref($IMAGES) ne 'HASH')
{
$IMAGES = {};
$IMAGES->{maxnumber} = 0;
};
}
foreach my $li (keys(%{ $IMAGES }))
{
if ($li =~ /^image_(\d+)/)
{
$images->{$name.'_'.$1} = $IMAGES->{$li};
}
}
}
}
return $images;
</%INIT>