% if ($total > $size) {

Страницы:  <& /inc/pages_.msn, p => $p, n => $size, total => $total, delimiter => ' ' &>

% } % my $i=1; % foreach my $doc (@docs) { % my ($rate1, $rate2, $rate3); % if ($doc->rating) { % $rate3 = 10 % $doc->rating; % $rate2 = (10 - $rate3) % 2; % $rate1 = int ((10 - $rate2 - $rate3) / 2); % $rate3 = int ($rate3 / 2); % } % my $date = $3.'.'.$2.'.'.$1 if ($doc->dtime =~ /(\d+)-(\d+)-(\d+)/); % if ($i % 2) { % } % unless ($i++ % 2) { % } % } % unless ( $i % 2 ) { % }
\ % ##### Картинко % my $img = $doc->get_image('icon'); % if (ref $img && exists $img->{filename}) { <% $doc->name %> % } <% $doc->name %>
% if ( $doc->abstr ) { <% $doc->abstr %>
% } % if ( $doc->country ) { Страна: <% $doc->country %>
% } % if ($doc->rating) {
Рейтинг: 
\ % foreach (1 .. $rate1) { \ % } % foreach (1 .. $rate2) { \ % } % foreach (1 .. $rate3) { \ % }
% } ###/ Рейтинг % if ( $doc->url && $doc->url_label ) { <% $doc->url_label %>
% } подробнее >>
% if ( $total > $size ) {

Страницы:  <& /inc/pages_.msn, p => $p, n => $size, total => $total, delimiter => ' ' &>

% } <%args> $p => 1 $size => 4 $section => undef <%init> my $prj = $request->{project}; my $profile = $request->{project_profile}; my $root = $request->{project_section}; ($section) = $keeper->get_sections ( s => $root->id, class => 'promosuite::AnnoSection', limit => 1, status => 1, ) unless ref $section; my $total = $keeper->get_documents ( s => $section->id, class => 'promosuite::Anons', count => 1, ); my @docs; if ($p <= (int($total/$size) + ($total % $size ? 1 : 0)) ) { if ( $section->_sorted ) { @docs = $keeper->get_sorted_documents ( s => $section->id, class => 'promosuite::Anons', limit => $size, offset => ($p-1)*$size, ); }else{ @docs = $keeper->get_documents ( s => $section->id, class => 'promosuite::Anons', limit => $size, offset => ($p-1)*$size, ); } }