% if ( ref $image && exists $image->{filename} ) { % my $img_dir = $state->images_directory; % $img_dir =~ s/\/$//; % } <% $document->name %> <%args> $id => undef $new => undef <%init> &abort404 if $id && $id =~ /\D/; my $prj = $request->{project}; my $profile = $request->{project_profile}; my $root = $request->{project_section}; if ( $new ) { # $r->header_out ('X-Accel-Expires', 0); } if ( !$new && !$id ) { my %cookies = Apache::Cookie->fetch; my $cookie = $cookies{card_id}; # Вытаскиваем SID из куки $id = $cookie->value() if $cookie; } my $document; if ( $id && !$new ) { $document = $keeper->get_document_by_id ( $id, class => 'promosuite::Postcard', ); } unless ( ref $document ) { # $r->header_out ('X-Accel-Expires', 0); $document = promosuite::Postcard->new ($keeper); $document->sections($root->id); $document->status(1); $document->store; my $cookie = Apache::Cookie->new ($request->r(), -name => 'card_id', -expires=> '+7d', -value => $document->id, -path => '/', ); $cookie->bake(); } my $image = $document->get_image('picture'); if ( $state->development ) { $r->content_type('text/xml; charset=utf-8'); } else { $r->content_type('text/xml; charset=utf-8'); }