% ### Все промоблоки % ################################ % 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 &> % }
% } % } % ### /Все промоблоки % %
% % % ### Блок новостей % ################################ % 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 <%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', ); } }