1 |
296 |
ahitrov |
% if ( $m->comp_exists ("/comps/$prj/header.msn") ) { |
2 |
|
|
<& "/comps/$prj/header.msn", alias => 'main' &> |
3 |
|
|
% } else { |
4 |
|
|
<& "/comps/header.msn", alias => 'main' &> |
5 |
|
|
% } |
6 |
|
|
|
7 |
|
|
<script type="text/javascript"> |
8 |
|
|
<!-- |
9 |
|
|
function reset_cookie ( nID ) { |
10 |
|
|
ra.cookie.set('card_id', nID, { |
11 |
|
|
secure: false, |
12 |
|
|
path: '/', |
13 |
|
|
expires: new Date (<% $expire->epoch.'000' %>) |
14 |
|
|
} |
15 |
|
|
); |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
var flashvars = { |
19 |
|
|
basedir: '<% $basedir %>'\ |
20 |
|
|
% if ( $id && ref $document ) { |
21 |
|
|
, |
22 |
|
|
id: "<% $id %>" |
23 |
|
|
% } |
24 |
|
|
}; |
25 |
|
|
var params = { |
26 |
|
|
bgcolor: "#FFFFFF", |
27 |
|
|
allowScriptAccess: "always" |
28 |
|
|
}; |
29 |
|
|
|
30 |
|
|
swfobject.embedSWF("/i/<% $prj %>/swf/ice.swf", "myContent", "700", "550", "9.0.0", "/i/<% $prj %>/swf/expressInstall.swf",flashvars,params); |
31 |
|
|
//--> |
32 |
|
|
</script> |
33 |
|
|
|
34 |
|
|
<div id="myContent"> |
35 |
|
|
<h1 style="color:red;">Для просмотра открытки скачайте Flash плеер</h1> |
36 |
|
|
<p><a href="http://www.adobe.com/go/getflashplayer"><img |
37 |
|
|
src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" |
38 |
|
|
alt="Get Adobe Flash player" border="0" /></a></p> |
39 |
|
|
</div> |
40 |
|
|
|
41 |
|
|
|
42 |
|
|
% ### Футер |
43 |
|
|
% ############################################## |
44 |
|
|
% if ( $m->comp_exists ("/comps/$prj/footer.msn") ) { |
45 |
|
|
<& "/comps/$prj/footer.msn" &> |
46 |
|
|
% } else { |
47 |
|
|
<& "/comps/footer.msn" &> |
48 |
|
|
% } |
49 |
|
|
% ### /Футер |
50 |
|
|
<%args> |
51 |
|
|
|
52 |
|
|
$id => undef |
53 |
|
|
|
54 |
|
|
</%args> |
55 |
|
|
<%init> |
56 |
|
|
|
57 |
|
|
&abort404 if $id && $id =~ /\D/; |
58 |
|
|
|
59 |
|
|
my $prj = $request->{project}; |
60 |
|
|
my $profile = $request->{project_profile}; |
61 |
|
|
my $root = $request->{project_section}; |
62 |
|
|
|
63 |
|
|
my %cookies = Apache::Cookie->fetch; |
64 |
|
|
my $cookie = $cookies{card_id}; |
65 |
|
|
|
66 |
|
|
my $expire = Contenido::DateTime->new->add( days => 7 ); |
67 |
|
|
# Вытаскиваем SID из куки |
68 |
|
|
# $id = $cookie->value() if !$id && $cookie; |
69 |
|
|
|
70 |
|
|
my $document; |
71 |
|
|
if ( $id ) { |
72 |
|
|
$document = $keeper->get_document_by_id ($id, |
73 |
|
|
class => 'promosuite::Postcard', |
74 |
|
|
); |
75 |
|
|
&abort404 unless ref $document; |
76 |
|
|
} else { |
77 |
|
|
$r->header_out ('X-Accel-Expires', 0); |
78 |
|
|
$document = promosuite::Postcard->new ( $keeper ); |
79 |
|
|
$document->sections($root->id); |
80 |
|
|
$document->store; |
81 |
|
|
my $cookie = Apache::Cookie->new ($request->r(), |
82 |
|
|
-name => 'card_id', |
83 |
|
|
-expires=> '+7d', |
84 |
|
|
-value => $document->id, |
85 |
|
|
-path => '/', |
86 |
|
|
); |
87 |
|
|
$cookie->bake(); |
88 |
|
|
} |
89 |
|
|
if ( $state->development ) { |
90 |
|
|
$r->content_type('text/html; charset=utf-8'); |
91 |
|
|
} else { |
92 |
|
|
$r->content_type('text/html; charset=utf-8'); |
93 |
|
|
} |
94 |
|
|
my $basedir = $state->development ? '/'.$prj : ''; |
95 |
|
|
|
96 |
|
|
</%init> |