<& "/contenido/components/title.msn" &> % if ( ref $class eq 'ARRAY' ) {
Классы: % foreach my $cls ( @$class ) { <% $cls %> (создать) | % }
% } else {
Класс: <% $class %> (создать новый)
% } % if ( ref $docs eq 'ARRAY' && @$docs ) { % if ($total > $size) {
<& /inc/pages_.msn, p => $p, n => $size, total => $total, params => {%ARGS} &>
% } % my @props = sort { $a->{column} <=> $b->{column} } grep { exists $_->{column} && $_->{column} } $docs->[0]->structure; % foreach my $prop (@props) { % } % foreach my $doc (@$docs) { % my $document_access = $user->section_accesses($user, $doc->section); % my $color = $doc->contenido_status_style ? $doc->contenido_status_style : % $doc->status == 1 ? 'color:blue;' : % $doc->status == 0 ? 'color:gray;' : 'color:blue;'; % my ($a1, $a2) = $document_access == 2 ? ('', '') : ('',''); %# my ($stat) = grep { $_->{attr} eq 'status' } @props; %# my ($case) = grep { $_->[0] == $banner->status } @{ $stat->{cases} } if ref $stat eq 'HASH' && exists $stat->{cases}; % foreach my $prop (@props) { % my $attr = $prop->{attr}; % if ( $prop->{type} =~ /(datetime|date)/ ) { % } elsif ( $prop->{type} eq 'status' ) { % my ($case) = grep { $_->[0] == $doc->$attr } @{$prop->{cases}}; % } else { % } % } % }
<% exists $prop->{shortname} ? $prop->{shortname} : $prop->{rusname} %> 
<% $a1 %><& "/contenido/components/show_dtime.msn", dtime => $doc->$attr &><% $a2 %><% ref $case ? $case->[1] : 'неизвестно ['.$doc->$attr.']' %><% $a1.$doc->$attr.$a2 %>\ % if ($document_access == 2) { Удалить документ\ % }
% } %#
<% Dumper($docs->[0]->required_properties) %>
<%args> $id => undef $filter => undef $field => undef $from => undef $to => undef $class => undef $order_by => undef $p => 1 <%init> my ($docs, $total); my $defaults = ''; my $size = 15; if ( $id && $filter && $class ) { my %opts = (); $opts{$filter} = $id; $opts{order_by} = $order_by if $order_by; $docs = $keeper->get_documents ( class => $class, return_mode => 'array_ref', offset => ($p-1)*$size, limit => $size, %opts, ); delete $opts{order_by}; $total = $keeper->get_documents ( class => $class, count => 1, %opts, ); } else { return; } if ( defined $from && defined $to ) { if ( ref $from eq 'ARRAY' && ref $to eq 'ARRAY' && (scalar @$from == scalar @$to) ) { for ( 0..(scalar @$from - 1) ) { $defaults .= '&'.$from->[$_].'='.$to->[$_]; } } elsif ( !ref $from && !ref $to ) { $defaults .= '&'.$from.'='.$to; } }