1 |
296 |
ahitrov |
<& @call &> |
2 |
|
|
%#<pre><% Dumper(\@path) %></pre> |
3 |
|
|
%#<pre><% Dumper($request->{project_profile}) %></pre> |
4 |
|
|
<%args> |
5 |
|
|
</%args> |
6 |
|
|
<%init> |
7 |
|
|
|
8 |
|
|
my @path = split('/', $m->dhandler_arg); |
9 |
|
|
my @call; |
10 |
|
|
|
11 |
|
|
my $prj = $request->{project}; |
12 |
|
|
my $profile = $request->{project_profile}; |
13 |
|
|
my $root = $request->{project_section}; |
14 |
|
|
|
15 |
|
|
my $param = shift @path; |
16 |
|
|
if ( $param =~ /(\w+)\.html$/ ) { |
17 |
|
|
my $alias = $1; |
18 |
|
|
my ($doc) = $keeper->get_documents( |
19 |
|
|
s => $root->id, |
20 |
|
|
class => 'promosuite::Article', |
21 |
|
|
alias => $alias, |
22 |
|
|
limit => 1, |
23 |
|
|
); |
24 |
|
|
if ( ref $doc ) { |
25 |
|
|
$ARGS{document} = $doc; |
26 |
|
|
@call = ('article.html', %ARGS); |
27 |
|
|
} else { |
28 |
|
|
&abort404; |
29 |
|
|
} |
30 |
|
|
} elsif ( $param eq 'css' && $path[0] eq 'styles.css' ) { |
31 |
|
|
@call = ('/www/css/styles.css', %ARGS); |
32 |
|
|
} else { |
33 |
|
|
&abort404; |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
&abort404 unless $m->comp_exists($call[0]); |
37 |
|
|
|
38 |
|
|
</%init> |