line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MojoMojo::Model::Themes; |
2
|
|
|
|
|
|
|
|
3
|
35
|
|
|
35
|
|
15381
|
use strict; |
|
35
|
|
|
|
|
96
|
|
|
35
|
|
|
|
|
1087
|
|
4
|
|
|
|
|
|
|
|
5
|
35
|
|
|
35
|
|
214
|
use parent 'Catalyst::Model'; |
|
35
|
|
|
|
|
82
|
|
|
35
|
|
|
|
|
279
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
MojoMojo::Model::Themes - support for Thematic styles |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 ACTIONS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head2 list |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
List available themes. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub list { |
20
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
21
|
0
|
|
|
|
|
|
my $theme_dir = MojoMojo->path_to('root', 'static', 'themes'); |
22
|
0
|
|
|
|
|
|
my @themes; |
23
|
0
|
|
|
|
|
|
opendir TDH, $theme_dir; |
24
|
0
|
|
|
|
|
|
while (my $theme = readdir TDH){ |
25
|
0
|
0
|
|
|
|
|
next if $theme =~ /^\.{1,2}/; |
26
|
0
|
|
|
|
|
|
push @themes, $theme; |
27
|
|
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
|
closedir TDH; |
29
|
0
|
0
|
|
|
|
|
MojoMojo->log->info("Available themes in " . $theme_dir . ": @themes") |
30
|
|
|
|
|
|
|
if MojoMojo->debug; |
31
|
|
|
|
|
|
|
return @themes |
32
|
0
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 AUTHOR |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Marcus Ramberg <mramberg@cpan.org> |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 LICENSE |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
This library is free software. You can redistribute it and/or modify |
41
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |