Last change
on this file since 861 was
861,
checked in by nanardon, 13 years ago
|
- reimport missing files from previous svn
|
-
Property svn:keywords set to
Id Rev
|
File size:
1.3 KB
|
Line | |
---|
1 | package LATMOS::Accounts::Web::Controller::Sites; |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | use base 'LATMOS::Accounts::Web::Controller'; |
---|
6 | |
---|
7 | =head1 NAME |
---|
8 | |
---|
9 | LATMOS::Accounts::Web::Controller::Site - Catalyst Controller |
---|
10 | |
---|
11 | =head1 DESCRIPTION |
---|
12 | |
---|
13 | Catalyst Controller. |
---|
14 | |
---|
15 | =head1 METHODS |
---|
16 | |
---|
17 | =cut |
---|
18 | |
---|
19 | |
---|
20 | =head2 index |
---|
21 | |
---|
22 | =cut |
---|
23 | |
---|
24 | sub 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 | $c->stash->{page}{title} = "Liste des sites"; |
---|
30 | } |
---|
31 | |
---|
32 | sub default : LocalPath { |
---|
33 | my ( $self, $c, undef, $sitename, $subform ) = @_; |
---|
34 | |
---|
35 | my $base = $c->model('Accounts')->db; |
---|
36 | |
---|
37 | $c->stash->{page}{title} = "Site :: $sitename"; |
---|
38 | $c->stash->{sitename} = $sitename; |
---|
39 | $c->stash->{site} = $base->get_object('site', $sitename) or do { |
---|
40 | $c->forward('/no_object'); |
---|
41 | return; |
---|
42 | }; |
---|
43 | |
---|
44 | $c->stash->{subform} = $subform || ''; |
---|
45 | |
---|
46 | for ($subform) { |
---|
47 | # Exceptions... |
---|
48 | # /^$/ $c->stash->{template} = |
---|
49 | |
---|
50 | $c->stash->{form} = $c->model('AttrForms', 'site' . $c->stash->{subform}, $c->stash->{site}); |
---|
51 | $c->stash->{form}->set_attrs; |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
55 | =head1 AUTHOR |
---|
56 | |
---|
57 | Thauvin Olivier |
---|
58 | |
---|
59 | =head1 LICENSE |
---|
60 | |
---|
61 | This library is free software, you can redistribute it and/or modify |
---|
62 | it under the same terms as Perl itself. |
---|
63 | |
---|
64 | =cut |
---|
65 | |
---|
66 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.