Line # Revision Author
1 296 ahitrov % ### Все промоблоки
2 % ################################
3 % if ( ref $promos eq 'ARRAY' && scalar @$promos && !$nopromo ) {
4 % foreach my $promo ( @$promos ) {
5 % if ( $m->comp_exists ("/comps/$prj/block_promo.msn") ) {
6 <& "/comps/$prj/block_promo.msn", doc => $promo &>
7 % } else {
8 <& "/comps/block_promo.msn", doc => $promo &>
9 % }
10 <div class="mt10"></div>
11 % }
12 % }
13 % ### /Все промоблоки
14 %
15 %
16 <div class="mt10"></div>
17 %
18 %
19 % ### Блок новостей
20 % ################################
21 % if ( $profile->news && !$nonews ) {
22 % if ( $m->comp_exists ("/comps/$prj/block_news.msn") ) {
23 <& "/comps/$prj/block_news.msn" &>
24 % } else {
25 <& /comps/block_news.msn &>
26 % }
27 % }
28 % ### /Блок новостей
29 %
30 %
31 <%args>
32
33 $nopromo => undef
34 $nonews => undef
35
36 </%args>
37 <%init>
38
39 my $prj = $request->{project};
40 my $profile = $request->{project_profile};
41 my $root = $request->{project_section};
42
43 my $promos;
44 my ($section) = $keeper->get_sections (
45 s => $root->id,
46 class => 'promosuite::PromoSection',
47 limit => 1,
48 status => 1,
49 );
50 if ( ref $section ) {
51 if ( $section->_sorted ) {
52 $promos = $keeper->get_sorted_documents (
53 s => $section->id,
54 class => 'promosuite::Promoblock',
55 status => 1,
56 return_mode => 'array_ref',
57 );
58 }else{
59 $promos = $keeper->get_documents (
60 s => $section->id,
61 class => 'promosuite::Promoblock',
62 status => 1,
63 return_mode => 'array_ref',
64 );
65 }
66 }
67
68 </%init>