Revision 296 (by ahitrov, 2013/03/26 17:59:01) Promosite (anthill) project source
<& @call &>
%#<pre><% Dumper(\@path) %></pre>
%#<pre><% Dumper($request->{project_profile}) %></pre>
<%args>
</%args>
<%init>

  my @path = split('/', $m->dhandler_arg);
  my @call;

  my $prj = $request->{project};
  my $profile = $request->{project_profile};
  my $root = $request->{project_section};

  my $param = shift @path;
  if ( $param =~ /(\w+)\.html$/ ) {
	my $alias = $1;
	my ($doc) = $keeper->get_documents(
			s	=> $root->id,
			class	=> 'promosuite::Article',
			alias	=> $alias,
			limit	=> 1,
		);
	if ( ref $doc ) {
		$ARGS{document} = $doc;
		@call = ('article.html', %ARGS);
	} else {
		&abort404;
	}
  } elsif ( $param eq 'css' && $path[0] eq 'styles.css' ) {
	@call = ('/www/css/styles.css', %ARGS);
  } else {
	&abort404;
  }

  &abort404     unless $m->comp_exists($call[0]);

</%init>