MojoMojo::Model::Themes - support for Thematic styles


MojoMojo documentation Contained in the MojoMojo distribution.

Index


Code Index:

NAME

Top

MojoMojo::Model::Themes - support for Thematic styles

ACTIONS

Top

list

List available themes.

AUTHOR

Top

Marcus Ramberg <mramberg@cpan.org>

LICENSE

Top

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.


MojoMojo documentation Contained in the MojoMojo distribution.
package MojoMojo::Model::Themes;

use strict;

use parent 'Catalyst::Model';

sub list {
    my $self       = shift;
    my $theme_dir  = MojoMojo->path_to('root', 'static', 'themes');
    my @themes;
    opendir TDH, $theme_dir;
    while (my $theme = readdir TDH){
        next if $theme =~ /^\.{1,2}/;
        push @themes, $theme;
    }
    closedir TDH;
    MojoMojo->log->info("Available themes in " . $theme_dir . ": @themes")
        if MojoMojo->debug;
    return @themes
}

1;