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", alias => 'main' &>
% } else {
<& "/comps/header.msn", alias => 'main' &>
% }
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td style="padding:0 32px 0 18px;" width="1%" nowrap>
<!--Menus-->
% if ( $m->comp_exists ("/comps/$prj/left.msn") ) {
<& "/comps/$prj/left.msn", place => $place, id => (ref $document ? $document->id : undef) &>
% }
<!--/Menus-->
</td>
<td width="1%"><img src="/i/<% $prj %>/diaton_device.png" width="84" height="334" alt="DIATON tonometer"></td>
<td style="padding:0 30px 20px;" width="98%">
<!--Information-->
% if ( ref $document ) {
<h2><% $document->name %></h2>
% if ( $document->author ) {
<p class="quot">by <% $document->author %></p>
% }
<div class="contacts">
% if ( $document->body_html ) {
<% $document->body_html %>
% } else {
<% $document->body %>
% }
</div>
% if ( $document->source ) {
% my ($a1, $a2) = $document->url ? ('<a href="'.$document->url.'" target="_blank">','</a>') : ('','');
<p class="copy"><% $a1.$document->source.$a2 %></p>
% }
% }
<!--/Information-->
</td></tr>
</table>
% ### Футер
% ##############################################
% if ( $m->comp_exists ("/comps/$prj/footer.msn") ) {
<& "/comps/$prj/footer.msn" &>
% } else {
<& "/comps/footer.msn" &>
% }
% ### /Футер
<%args>
$document => undef
$id => undef
</%args>
<%init>
&abort404 unless ref $document || ( $id && $id =~ /^\d+$/ );
my $prj = $request->{project};
my $profile = $request->{project_profile};
my $root = $request->{project_section};
$document = $keeper->get_document_by_id ($id,
class => 'promosuite::Article',
status => 'positive',
) if !ref $document && $id;
&abort404 unless ref $document;
my @secs = $document->sections;
&abort404 unless @secs;
my $place;
unless ( $secs[0] == $root->id ) {
my $parent = $keeper->get_section_by_id( $secs[0] );
&abort404 unless ref $parent;
$place = $parent->alias;
&abort404 if $parent->pid != $root->id;
}
</%init>