/[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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (hide annotations)
Fri Nov 30 17:35:14 2007 UTC (11 years, 10 months ago) by dpavlin
File size: 1023 byte(s)
is required doesn't seem to work, but is mandatory does
1 dpavlin 4 use strict;
2     use warnings;
3    
4     package Arh::Model::Picture;
5     use Jifty::DBI::Schema;
6 dpavlin 6 use File::Find;
7     use Data::Dump qw/dump/;
8 dpavlin 4
9     use Arh::Record schema {
10    
11     column campaign =>
12     label is _("Part of campaign"),
13     refers_to Arh::Model::Campaign,
14 dpavlin 17 is mandatory,
15 dpavlin 4 is indexed,
16     since '0.0.4';
17    
18     column filename =>
19     label is _("Picture filename"),
20 dpavlin 17 is mandatory,
21 dpavlin 6 is indexed,
22     is unique;
23 dpavlin 4
24     column type =>
25     label is _("Type of picture"),
26     refers_to Arh::Model::PictureType,
27 dpavlin 17 is mandatory,
28 dpavlin 4 is indexed,
29 dpavlin 5 since '0.0.4';
30 dpavlin 4
31     };
32    
33     # Your model-specific methods go here.
34    
35     sub since { '0.0.3' }
36    
37 dpavlin 6 sub all_filenames {
38    
39     my @files;
40     my $path = Jifty::Util->app_root . '/share/web/static/pics';
41    
42 dpavlin 13 # warn "## path = $path";
43 dpavlin 6
44     find({ wanted => sub {
45     my $f = $File::Find::name;
46     return unless -f $f;
47     push @files, $_;
48     }, follow => 0 }, $path);
49    
50 dpavlin 13 # warn "## all_filenames = ",dump( @files );
51 dpavlin 6
52     return @files;
53     }
54    
55 dpavlin 10 #use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on
56    
57 dpavlin 13 use Arh::DefaultACL;
58 dpavlin 10
59 dpavlin 4 1;
60    

  ViewVC Help
Powered by ViewVC 1.1.26