/[Arh]/lib/Arh/Model/Picture.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/Arh/Model/Picture.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5 by dpavlin, Thu Nov 29 11:48:39 2007 UTC revision 6 by dpavlin, Thu Nov 29 12:36:51 2007 UTC
# Line 3  use warnings; Line 3  use warnings;
3    
4  package Arh::Model::Picture;  package Arh::Model::Picture;
5  use Jifty::DBI::Schema;  use Jifty::DBI::Schema;
6    use File::Find;
7    use Data::Dump qw/dump/;
8    
9  use Arh::Record schema {  use Arh::Record schema {
10    
# Line 16  use Arh::Record schema { Line 18  use Arh::Record schema {
18          column filename =>          column filename =>
19                  label is _("Picture filename"),                  label is _("Picture filename"),
20                  is required,                  is required,
21                  is indexed;                  is indexed,
22                    is unique;
23    
24          column type =>          column type =>
25                  label is _("Type of picture"),                  label is _("Type of picture"),
# Line 31  use Arh::Record schema { Line 34  use Arh::Record schema {
34    
35  sub since { '0.0.3' }  sub since { '0.0.3' }
36    
37    sub all_filenames {
38    
39            my @files;
40            my $path = Jifty::Util->app_root . '/share/web/static/pics';
41    
42            warn "## path = $path";
43    
44            find({ wanted => sub {
45                    my $f = $File::Find::name;
46                    return unless -f $f;
47                    push @files, $_;
48            }, follow => 0 }, $path);
49    
50            warn "## all_filenames = ",dump( @files );
51    
52            return @files;
53    }
54    
55  1;  1;
56    

Legend:
Removed from v.5  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26