| 1 | package MojoMojo::Model::Themes; | ||||||||||
| 2 | |||||||||||
| 3 | 35 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 35 | ▶ | use parent 'Catalyst::Model'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 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 | 0 | ▶ | sub list { | ||||||||
|
Subroutine
list: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 20 | 0 | 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){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 0 | ▶ | next if $theme =~ /^\.{1,2}/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 0 | push @themes, $theme; | |||||||||
| 27 | } | ||||||||||
| 28 | 0 | closedir TDH; | |||||||||
| 29 | 0 | ▶ | MojoMojo->log->info("Available themes in " . $theme_dir . ": @themes") | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | 35 | 1; | |||||||||