Line # Revision Author
1 296 ahitrov % if ( $m->comp_exists ("/comps/$prj/header.msn") ) {
2 <& "/comps/$prj/header.msn", alias => 'news' &>
3 % } else {
4 <& "/comps/header.msn", alias => 'news' &>
5 % }
6 <div style="background: url(/i/<% $prj %>/f_news.gif) repeat-x top left; height:86px; clear:both;"><spacer type="block"></div>
7 %
8 % if ( $id && ref $document ) {
9 % ### Текст новости
10 % #######################################################
11 % if ( $m->comp_exists ("/comps/$prj/article.msn") ) {
12 <& "/comps/$prj/article.msn", document => $document &>
13 % } else {
14 <& "/comps/article.msn", document => $document &>
15 % }
16 %
17 % } ### /Одна Новость
18 %
19 % ### Список новостей
20 % #######################################################
21 % if ( ref $section ) {
22 % if ( $m->comp_exists ("/comps/$prj/news_list.msn") ) {
23 <& "/comps/$prj/news_list.msn", id => $id, p => $p, size => $profile->news_count || 10 &>
24 % } else {
25 <& "/comps/news_list.msn", id => $id, p => $p, size => $profile->news_count || 10 &>
26 % }
27 % }
28
29 % ### Футер
30 % ##############################################
31 % if ( $m->comp_exists ("/comps/$prj/footer.msn") ) {
32 <& "/comps/$prj/footer.msn" &>
33 % } else {
34 <& "/comps/footer.msn" &>
35 % }
36 % ### /Футер
37 <%args>
38
39 $p => 1
40 $id => undef
41
42 </%args>
43 <%init>
44
45 my $prj = $request->{project};
46 my $profile = $request->{project_profile};
47 my $root = $request->{project_section};
48 &abort404 if $id && $id !~ /^\d+$/;
49
50 my $document;
51 my ($section) = $keeper->get_sections (
52 s => $root->id,
53 class => 'promosuite::NewsSection',
54 limit => 1,
55 status => 1,
56 );
57 if ( $id && ref $section ) {
58 $document = $keeper->get_document_by_id ($id,
59 s => $section->id,
60 # class => 'promosuite::Article',
61 class => 'promosuite::News',
62 status => [1,2],
63 );
64 }
65 </%init>