| 1 | ########################################################### | ||
| 2 | # SIOC::Site | ||
| 3 | # Site class for the SIOC ontology | ||
| 4 | ########################################################### | ||
| 5 | # | ||
| 6 | # $Id: Site.pm 10 2008-03-01 21:38:39Z geewiz $ | ||
| 7 | # | ||
| 8 | |||
| 9 | package SIOC::Site; | ||
| 10 | |||
| 11 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 3 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 3 | ▶ | use Readonly; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 3 | ▶ | use version; our $VERSION = qv(1.0.0); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | 3 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 3 | ▶ | use MooseX::AttributeHelpers; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | 3 | extends 'SIOC::Space'; | |
| 22 | |||
| 23 | ### optional attributes | ||
| 24 | |||
| 25 | has 'administrators' => ( | ||
| 26 | metaclass => 'Collection::Array', | ||
| 27 | is => 'rw', | ||
| 28 | isa => 'ArrayRef[SIOC::User]', | ||
| 29 | 0 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 30 | 3 | provides => { | |
| 31 | 'push' => 'add_administrator', | ||
| 32 | }, | ||
| 33 | ); | ||
| 34 | |||
| 35 | has 'forums' => ( | ||
| 36 | metaclass => 'Collection::Array', | ||
| 37 | is => 'rw', | ||
| 38 | isa => 'ArrayRef[SIOC::Forum]', | ||
| 39 | 0 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 40 | 3 | provides => { | |
| 41 | 'push' => 'add_forum', | ||
| 42 | }, | ||
| 43 | ); | ||
| 44 | |||
| 45 | has 'admin_usergroup' => ( | ||
| 46 | isa => 'Str', | ||
| 47 | is => 'rw', | ||
| 48 | 0 | ▶ | default => sub { 'admin' }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 49 | 3 | ); | |
| 50 | |||
| 51 | ### methods | ||
| 52 | |||
| 53 | 0 | ▶ | after 'fill_template' => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 54 | 0 | my ($self) = @_; | |
| 55 | |||
| 56 | 0 | $self->set_template_var(forums => $self->forums); | |
| 57 | 0 | $self->set_template_var(admin_ug => $self->admin_usergroup); | |
| 58 | 0 | $self->set_template_var(administrators => $self->administrators); | |
| 59 | 3 | }; | |
| 60 | |||
| 61 | ### EOC | ||
| 62 | |||
| 63 | 3 | 1; | |
| 64 | __DATA__ | ||