% if ( $m->comp_exists ("/comps/$prj/header.msn") ) { <& "/comps/$prj/header.msn", alias => 'main' &> % } else { <& "/comps/header.msn", alias => 'main' &> % }
% ### Футер % ############################################## % if ( $m->comp_exists ("/comps/$prj/footer.msn") ) { <& "/comps/$prj/footer.msn" &> % } else { <& "/comps/footer.msn" &> % } % ### /Футер <%args> $id => undef %args> <%init> &abort404 if $id && $id =~ /\D/; my $prj = $request->{project}; my $profile = $request->{project_profile}; my $root = $request->{project_section}; my %cookies = Apache::Cookie->fetch; my $cookie = $cookies{card_id}; my $expire = Contenido::DateTime->new->add( days => 7 ); # Вытаскиваем SID из куки # $id = $cookie->value() if !$id && $cookie; my $document; if ( $id ) { $document = $keeper->get_document_by_id ($id, class => 'promosuite::Postcard', ); &abort404 unless ref $document; } else { $r->header_out ('X-Accel-Expires', 0); $document = promosuite::Postcard->new ( $keeper ); $document->sections($root->id); $document->store; my $cookie = Apache::Cookie->new ($request->r(), -name => 'card_id', -expires=> '+7d', -value => $document->id, -path => '/', ); $cookie->bake(); } if ( $state->development ) { $r->content_type('text/html; charset=utf-8'); } else { $r->content_type('text/html; charset=utf-8'); } my $basedir = $state->development ? '/'.$prj : ''; %init>