check ids
[sgn.git] / lib / SGN / Controller / Help.pm
blob03a9c3e16402c147e1e336fa14dcc43c8f66d0f3
2 package SGN::Controller::Help;
4 use Moose;
6 BEGIN { extends "Catalyst::Controller"; }
8 sub about: Path('/about') Args(0) {
9 my $self = shift;
11 $self->help(@_);
14 sub help : Path('/help') Args(0) {
15 my $self = shift;
16 my $c = shift;
18 $c->stash->{template} = '/help/index.mas';
21 sub help_section : Path('/help') Args(1) {
22 my $self = shift;
23 my $c = shift;
24 my $section = shift;
25 $section =~ s/\.\.//g; # prevent shenanigans
28 my $component = '/help/'.$section.".mas";
29 if ($c->view("Mason")->interp->comp_exists($component)) {
30 $c->stash->{basepath} = $c->config->{basepath};
31 $c->stash->{documents_subdir} = $c->config->{documents_subdir};
32 $c->stash->{template} = '/help/'.$section.".mas";
36 else {
37 $c->stash->{template} = '/generic_message.mas';
38 $c->stash->{message} = 'The requested page could not be found. <br /><a href="/help">Help page</a>';