<%perl>
my @properties = $object->structure();
for (0..$#properties)
{
my $prop = $properties[$_];
my $name = $prop->{attr};
next if ($prop->{hidden} == 1) || ($prop->{type} eq 'external') || ($prop->{type} =~ /^array/i) || ($prop->{type} =~ /^image/) || ($prop->{type} eq 'multimedia') || ($prop->{type} eq 'multimedia_new') || ($prop->{type} eq 'multimedia_multi') || ($prop->{type} eq 'audio');
%perl>
|
% if ( $prop->{type} eq 'flag' || $prop->{type} eq 'checkbox' ) {
<& "/contenido/components/inputs/checkbox.msn", prop => $prop, object=>$object, options=>$options, name => $name, check => ($object->$name || $object->{$name}), id => $object->id() &> |
% }
<% $prop->{rusname} %> / |
name="<% $prop->{attr} %>" |
% if ( $prop->{readonly} ) {
/ Значение нельзя изменить |
% }
|
% if ($prop->{type} eq 'parent') {
<& "/contenido/components/inputs/$prop->{type}.msn", prop => $prop, object=>$object, options=>$options, name => $name, check => ($object->$name || $prop->{default} || $sect_id ), id => $object->id() &> |
% } elsif( ( $prop->{type} ne 'flag' ) && ($prop->{type} ne 'checkbox') ) {
% if ( $m->comp_exists( "/contenido/components/inputs/$prop->{type}.msn" ) ) {
<& "/contenido/components/inputs/$prop->{type}.msn", prop => $prop, object=>$object, options => $options, name => $name, check => ($object->$name || $object->{$name}), id => ($object->id() || 0) &> |
% } else {
Попытка вызвать компоненту неизвестного типа (<% Dumper $prop %>) |
% }
% }
% if ( exists $prop->{rem} && $prop->{rem} ) {
» <% $prop->{rem} %> |
% }
% }
% for (0..$#properties)
% {
% my $prop = $properties[$_];
% next if ($prop->{hidden} != 1);
% next if ($prop->{attr} eq 'id' && $clone);
% }
%#если класса в свойствах обьекта нет все равно надо его пробросить как hidden
% unless (grep {$_->{attr} eq 'class'} @properties) {
% }
% if ( $clone ) {
% }
|
|
Мультимедиа-объекты к <% $PROTOS->{$proto}->[2] %>
% for (0..$#properties)
% {
% my $prop = $properties[$_];
% next if exists $prop->{hidden} && $prop->{hidden};
%
% if ($prop->{type} eq 'image')
% {
% my $IMAGE = $object->get_image( $prop->{attr} );
% if (ref($IMAGE) ne 'HASH') { next };
<& "/contenido/components/inputs/image.msn",
IMAGE => $IMAGE,
rusname => $prop->{rusname},
prop => $prop, object=>$object,
attr => $prop->{attr},
options => $options,
&>
% } elsif ($prop->{type} eq 'images')
% {
% my $IMAGES = $object->get_image( $prop->{attr} );
% if (ref($IMAGES) ne 'HASH') { next };
% my $MN = $IMAGES->{maxnumber}+0;
% for my $mn (1..$MN)
% {
% my $IMAGE = $IMAGES->{'image_'.$mn};
<& "/contenido/components/inputs/image.msn",
rusname => $prop->{rusname},
prop => $prop, object=>$object,
attr => $prop->{attr}.'_'.$mn,
IMAGE => $IMAGE,
options => $options,
&>
% }
% my $ME = exists $prop->{empty_slots} ? $prop->{empty_slots} : 5;
% $ME = ($ME + $IMAGES->{maxnumber}) >= 100 ? 0 : (100 - $IMAGES->{maxnumber} < $ME ? 100 - $IMAGES->{maxnumber} : $ME );
% for my $mn (1..$ME)
% {
<& "/contenido/components/inputs/image.msn",
IMAGE => {},
rusname => $prop->{rusname},
prop => $prop, object=>$object,
attr => $prop->{attr}.'_'.($MN+$mn),
options => $options,
&>
% }
% } elsif ($prop->{type} eq 'multimedia') {
% my $MULTI = $object->get_image( $prop->{attr} );
<& "/contenido/components/inputs/multimedia.msn",
rusname => $prop->{rusname},
prop => $prop, object=>$object,
attr => $prop->{attr},
MULTI => $MULTI,
options => $options,
&>
% } elsif ($prop->{type} eq 'multimedia_new') {
% my $MULTI = $object->get_image( $prop->{attr} );
<& "/contenido/components/inputs/multimedia_new.msn",
rusname => $prop->{rusname},
prop => $prop, object=>$object,
attr => $prop->{attr},
MULTI => $MULTI,
options => $options,
&>
% } elsif ($prop->{type} eq 'multimedia_multi') {
% my $FILES = $object->get_image( $prop->{attr} );
% if (ref($FILES) ne 'HASH') { next };
% my $MN = $FILES->{maxnumber}+0;
% for my $mn (1..$MN) {
% my $MULTI = $FILES->{'file_'.$mn};
<& "/contenido/components/inputs/multimedia_new.msn",
rusname => $prop->{rusname},
prop => $prop, object=>$object,
attr => $prop->{attr}.'_'.$mn,
MULTI => $MULTI,
options => $options,
&>
% }
% my $ME = exists $prop->{empty_slots} ? $prop->{empty_slots} : 3;
% $ME = ($ME + $FILES->{maxnumber}) >= 100 ? 0 : (100 - $FILES->{maxnumber} < $ME ? 100 - $FILES->{maxnumber} : $ME );
% for my $mn (1..$ME) {
<& "/contenido/components/inputs/multimedia_new.msn",
rusname => $prop->{rusname},
prop => $prop, object=>$object,
attr => $prop->{attr}.'_'.($MN+$mn),
MULTI => {},
options => $options,
&>
% }
% } elsif ($prop->{type} eq 'audio') {
% my $MULTI = $object->get_image( $prop->{attr} );
<& "/contenido/components/inputs/audio.msn",
rusname => $prop->{rusname},
prop => $prop, object=>$object,
attr => $prop->{attr},
MULTI => $MULTI,
options => $options,
&>
% }
% }
|
|