Revision 296 (by ahitrov, 2013/03/26 17:59:01) |
Promosite (anthill) project source
|
% ### Все промоблоки
% ################################
% if ( ref $promos eq 'ARRAY' && scalar @$promos && !$nopromo ) {
% foreach my $promo ( @$promos ) {
% if ( $m->comp_exists ("/comps/$prj/block_promo.msn") ) {
<& "/comps/$prj/block_promo.msn", doc => $promo &>
% } else {
<& "/comps/block_promo.msn", doc => $promo &>
% }
<div class="mt10"></div>
% }
% }
% ### /Все промоблоки
%
%
<div class="mt10"></div>
%
%
% ### Блок новостей
% ################################
% if ( $profile->news && !$nonews ) {
% if ( $m->comp_exists ("/comps/$prj/block_news.msn") ) {
<& "/comps/$prj/block_news.msn" &>
% } else {
<& /comps/block_news.msn &>
% }
% }
% ### /Блок новостей
%
%
<%args>
$nopromo => undef
$nonews => undef
</%args>
<%init>
my $prj = $request->{project};
my $profile = $request->{project_profile};
my $root = $request->{project_section};
my $promos;
my ($section) = $keeper->get_sections (
s => $root->id,
class => 'promosuite::PromoSection',
limit => 1,
status => 1,
);
if ( ref $section ) {
if ( $section->_sorted ) {
$promos = $keeper->get_sorted_documents (
s => $section->id,
class => 'promosuite::Promoblock',
status => 1,
return_mode => 'array_ref',
);
}else{
$promos = $keeper->get_documents (
s => $section->id,
class => 'promosuite::Promoblock',
status => 1,
return_mode => 'array_ref',
);
}
}
</%init>