Подбор документа:

X
% if ( $search_by ) {
% } % ### Листалка % ###################################### % if ( $total > $size ) { %
<& /inc/pages_.msn, p => $p, n => $size, total => $total, size => 4, params => { nf => $nf, vf => $vf, show => $show, $class ? ( class => $class ) : (), $s ? ( s => $s ) : (), $search_by ? ( search_by => $search_by ) : (), $search ? ( search => $search ) : (), } &>
% } % % if ( ref $docs eq 'ARRAY' && @$docs ) { % my $i = 0; % foreach my $doc ( @$docs ) { % my $name = $doc->$show; % $name =~ s/'/\\'/g; > % }
»  <% $doc->$show %>
% } <%args> $search_by => undef $search => undef $class => undef $show => 'name' $s => undef $nf => undef $vf => undef $p => 1 <%init> return unless $nf && $vf; my ($docs, $total, %params); my $size = 20; $params{s} = $s if $s; $params{class} = $class if $class; if ( $search_by && $search ) { $params{$search_by} = '%'.$search.'%'; $params{ilike} = 1; } $docs = $keeper->get_documents ( %params, limit => $size, offset => $size*($p-1), return_mode => 'array_ref', ); $total = $keeper->get_documents ( %params, count => 1, ); my $func = $1 if $vf =~ /(\w+)_([A-Za-z]+)$/;