% if ( $m->comp_exists ("/comps/$prj/header.msn") ) { <& "/comps/$prj/header.msn" &> % } else { <& "/comps/header.msn" &> % } % ### контент
% if ( ref $document ) {
<% $document->name %>
% if ( $m->comp_exists ("/comps/$prj/block_rep_photos.msn") ) { <& "/comps/$prj/block_rep_photos.msn", doc => $document &> % } else { <& "/comps/block_rep_photos.msn", doc => $document &> % }
% } elsif ( ref $section &&ref $documents eq 'ARRAY' && @$documents ) { % foreach my $photorep ( @$documents ) {
<% $photorep->name %>
% if ( $m->comp_exists ("/comps/$prj/block_rep_photos.msn") ) { <& "/comps/$prj/block_rep_photos.msn", doc => $photorep, show => 'rubber', max => 10 &> % } else { <& "/comps/block_rep_photos.msn", doc => $photorep, show => 'rubber', max => 10 &> % }
% } % } % if ( ($total > $size) && !$id ) {
Страницы: <& /inc/pages_.msn, p => $p, total => $total, n => $size, delimiter => '  ' &>
% }
% ### Футер % ############################################## % if ( $m->comp_exists ("/comps/$prj/footer.msn") ) { <& "/comps/$prj/footer.msn" &> % } else { <& "/comps/footer.msn" &> % } % ### /Футер <%args> $id => undef $p => 1 <%init> my $prj = $request->{project}; my $profile = $request->{project_profile}; my $root = $request->{project_section}; &abort404 if $id && $id !~ /^\d+$/; my $size = 5; my ($documents, $document, $total) = ([], undef, 0); my ($section) = $keeper->get_sections ( s => $root->id, class => 'promosuite::MultimediaSection', limit => 1, status => 1, ); if ( ref $section ) { if ( $id ) { $document = $keeper->get_document_by_id ($id, s => $section->id, class => 'promosuite::Photorep', status => 1, ); &abort404 unless ref $document; }else{ $documents = $keeper->get_documents ( s => $section->id, class => 'promosuite::Photorep', status => 1, order => ['date', 'direct'], limit => $size, offset => $size * ($p-1), return_mode => 'array_ref', ); if ( @$documents ) { $request->{photorep} = $documents; } } $total = $keeper->get_documents ( s => $section->id, class => 'promosuite::Photorep', status => 1, count => 1, ); }