11 |
column campaign => |
column campaign => |
12 |
label is _("Part of campaign"), |
label is _("Part of campaign"), |
13 |
refers_to Arh::Model::Campaign, |
refers_to Arh::Model::Campaign, |
14 |
is required, |
is mandatory, |
15 |
is indexed, |
is indexed, |
16 |
since '0.0.4'; |
since '0.0.4'; |
17 |
|
|
18 |
column filename => |
column filename => |
19 |
label is _("Picture filename"), |
label is _("Picture filename"), |
20 |
is required, |
is mandatory, |
21 |
is indexed, |
is indexed, |
22 |
is unique; |
is unique; |
23 |
|
|
24 |
column type => |
column type => |
25 |
label is _("Type of picture"), |
label is _("Type of picture"), |
26 |
refers_to Arh::Model::PictureType, |
refers_to Arh::Model::PictureType, |
27 |
is required, |
is mandatory, |
28 |
is indexed, |
is indexed, |
29 |
since '0.0.4'; |
since '0.0.4'; |
30 |
|
|
39 |
my @files; |
my @files; |
40 |
my $path = Jifty::Util->app_root . '/share/web/static/pics'; |
my $path = Jifty::Util->app_root . '/share/web/static/pics'; |
41 |
|
|
42 |
warn "## path = $path"; |
# warn "## path = $path"; |
43 |
|
|
44 |
find({ wanted => sub { |
find({ wanted => sub { |
45 |
my $f = $File::Find::name; |
my $f = $File::Find::name; |
47 |
push @files, $_; |
push @files, $_; |
48 |
}, follow => 0 }, $path); |
}, follow => 0 }, $path); |
49 |
|
|
50 |
warn "## all_filenames = ",dump( @files ); |
# warn "## all_filenames = ",dump( @files ); |
51 |
|
|
52 |
return @files; |
return @files; |
53 |
} |
} |
54 |
|
|
55 |
#use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on |
#use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on |
56 |
|
|
57 |
sub current_user_can { |
use Arh::DefaultACL; |
|
my ( $self, $action,$item,$name ) = @_; |
|
|
return 1 if $self->current_user->superuser || $self->current_user->administrator; |
|
|
return 1 if $self->current_user->id && $action eq 'read'; |
|
|
return 0; |
|
|
} |
|
58 |
|
|
59 |
1; |
1; |
60 |
|
|