Revision 296 (by ahitrov, 2013/03/26 17:59:01) |
Promosite (anthill) project source
|
<table border="0" cellspacing="0" cellpadding="10" width="100%" >
<tr valign="top">
<td>
<h2><% $id ? 'Все новости' : 'Новости' %></h2>
<table cellpadding=0 cellspacing=0 border=0 width=100%>
% foreach my $doc (@news) {
<tr valign=top>
<td class=ppp><p><img src="/i/<% $prj %>/plus.gif" width="12" height="12" alt="" border="0" vspace=3 align=left></td>
<td width=100%><p>
% if ($id && $id == $doc->id) {
<b><% $doc->name %></b>
% }else{
<a href="news.html?id=<% $doc->id %>"><% $doc->name %></a>
% }
</td>
</tr>
% }
</table>
% if ($total > $n) {
<div align="center" class="pgs">Страница <& /inc/pages_.msn,
total => $total, n => $n, p => $p &></div>
% }
</td>
</tr>
</table>
<%args>
$n => 20
$p => 1
$id => undef
</%args>
<%init>
my $prj = $request->{project};
my $profile = $request->{project_profile};
my $root = $request->{project_section};
my ($section) = $keeper->get_sections (
s => $root->id,
class => 'promosuite::NewsSection',
status => 1,
limit => 1,
);
return unless ref $section;
my $total = $keeper->get_documents (
s => $section->id,
# class => 'promosuite::Article',
class => 'promosuite::News',
status => [1,2],
count => 1,
);
my @news = $keeper->get_documents (
s => $section->id,
# class => 'promosuite::Article',
class => 'promosuite::News',
status => [1,2],
limit => $n,
offset => $n*($p-1),
order => [qw|date direct|],
light => 1,
);
return unless @news;
</%init>