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

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, %params, $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> $show => 'name' $nf => undef $vf => undef $p => 1 <%init> return unless $nf && $vf; my ($docs, $total); my $size = 20; my %params = %ARGS; delete $params{nf}; delete $params{vf}; delete $params{show}; delete $params{p}; my $search_by = delete $params{search_by}; my $search = delete $params{search}; 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]+)$/;