Revision 296 (by ahitrov, 2013/03/26 17:59:01) Promosite (anthill) project source
% if ( $m->comp_exists ("/comps/$prj/header.msn") ) {
<& "/comps/$prj/header.msn" &>
% } else {
<& "/comps/header.msn" &>
% }

<table border="0" cellspacing="0" cellpadding="10" width="100%">
<tr valign="top">
<td width="80%">
%
% if ( $id && ref $document ) {
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="infoblock" style="z-index:1" >
<tr>
<td class="cc" width="100%">

<div class="text">
%       ### Текст новости
%       #######################################################
%	if ( $m->comp_exists ("/comps/$prj/article.msn") ) {
<& "/comps/$prj/article.msn", document => $document &>
%	} else {
<& "/comps/article.msn", document => $document &>
%	}
</div>
</td>
</tr>
</table>
<div class="mt10"></div>
%
% } ### /Одна Новость
% 
% ### Список новостей
% #######################################################
% if ( ref $section ) {
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top"><td class="infoblock">
<table border="0" cellspacing="0" cellpadding="10" width="100%" >
<tr valign="top">
<td>
%	if ( $m->comp_exists ("/comps/$prj/news_list.msn") ) {
<& "/comps/$prj/news_list.msn", id => $id, p => $p, size => $profile->news_count || 10  &>
%	} else {
<& "/comps/news_list.msn", id => $id, p => $p, size => $profile->news_count || 10 &>
%	}
</td>
</tr>
</table>
</td>
</tr>
</table>
% }

</td>

% ### Правая колонка
% ###############################################
<td width="20%">
% if ( $m->comp_exists ("/comps/$prj/right.msn") ) {
<& "/comps/$prj/right.msn", nonews => 1 &>
% }else{
<& /comps/right.msn, nonews => 1 &>
% }
</td>
% ### /Правая колонка

</tr>
</table>

% ### Футер
% ##############################################
% if ( $m->comp_exists ("/comps/$prj/footer.msn") ) {
<& "/comps/$prj/footer.msn" &>
% } else {
<& "/comps/footer.msn" &>
% }
% ### /Футер
<%args>

        $p      => 1
        $id     => undef

</%args>
<%init>

  my $prj = $request->{project};
  my $profile = $request->{project_profile};
  my $root = $request->{project_section};
  &abort404     if $id && $id !~ /^\d+$/;

  my $document;
  my ($section) = $keeper->get_sections (
		s	=> $root->id,
		class	=> 'promosuite::NewsSection',
		limit	=> 1,
		status	=> 1,
	);
  if ( $id && ref $section ) {
	$document = $keeper->get_document_by_id ($id,
		s	=> $section->id,
#		class	=> 'promosuite::Article',
		class   => 'promosuite::News',
		status	=> [1,2],
        );
  }
</%init>