source: LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Sites.pm @ 240

Last change on this file since 240 was 240, checked in by nanardon, 15 years ago
  • cleanup filter code
  • Property svn:keywords set to Id Rev
File size: 1.1 KB
Line 
1package LATMOS::Accounts::Web::Controller::Sites;
2
3use strict;
4use warnings;
5use base 'LATMOS::Accounts::Web::Controller';
6
7=head1 NAME
8
9LATMOS::Accounts::Web::Controller::Site - Catalyst Controller
10
11=head1 DESCRIPTION
12
13Catalyst Controller.
14
15=head1 METHODS
16
17=cut
18
19
20=head2 index
21
22=cut
23
24sub index : Private {
25    my ( $self, $c ) = @_;
26
27    $c->stash->{ofilter} = $c->model('AttrFilter', 'site');
28    $c->stash->{siteslist} = [  map { $_->id } @{ $c->stash->{objectslist} } ];
29}
30
31sub default : LocalPath {
32    my ( $self, $c, undef, $sitename, $subform ) = @_;
33
34    my $base = $c->model('Accounts')->db;
35
36    $c->stash->{sitename} = $sitename;
37    $c->stash->{site} = $base->get_object('site', $sitename);
38    $c->stash->{subform} = $subform || '';
39
40    for ($subform) {
41        # Exceptions...
42        # /^$/ $c->stash->{template} =
43
44        $c->stash->{form} = $c->model('AttrForms', 'site' . $c->stash->{subform}, $c->stash->{site});
45        $c->stash->{form}->set_attrs;
46    }
47}
48
49=head1 AUTHOR
50
51Thauvin Olivier
52
53=head1 LICENSE
54
55This library is free software, you can redistribute it and/or modify
56it under the same terms as Perl itself.
57
58=cut
59
601;
Note: See TracBrowser for help on using the repository browser.