| 1 |
296 |
ahitrov |
% if ( ref $document && $document->id ) { |
| 2 |
|
|
% my $image = $document->get_image ('picture'); |
| 3 |
|
|
% if ( ref $image && exists $image->{filename} ) { |
| 4 |
|
|
<card id="<% $document->id %>" url="<% $state->images_directory.$image->{filename} %>"/> |
| 5 |
|
|
% } |
| 6 |
|
|
% } |
| 7 |
|
|
<%args> |
| 8 |
|
|
|
| 9 |
|
|
$store => undef |
| 10 |
|
|
|
| 11 |
|
|
</%args> |
| 12 |
|
|
<%init> |
| 13 |
|
|
|
| 14 |
|
|
my $document; |
| 15 |
|
|
if ( $store ) { |
| 16 |
|
|
if ( $ARGS{picture} ) { |
| 17 |
|
|
$document = promosuite::Postcard->new ($keeper); |
| 18 |
|
|
my @properties = $document->structure(); |
| 19 |
|
|
my ($prop) = grep { $_->{attr} eq 'picture' } @properties; |
| 20 |
|
|
my $IMG = $document->get_image ('picture'); |
| 21 |
|
|
my $IMAGE = $m->comp ('/subs/set_image.msn', |
| 22 |
|
|
field => 'picture', |
| 23 |
|
|
object => $document, |
| 24 |
|
|
prop => $prop, |
| 25 |
|
|
default => $IMG, |
| 26 |
|
|
SETS => \%ARGS, |
| 27 |
|
|
); |
| 28 |
|
|
if (ref $IMAGE && exists($IMAGE->{filename})) { |
| 29 |
|
|
local $Data::Dumper::Indent = 0; |
| 30 |
|
|
$document->picture( Data::Dumper::Dumper($IMAGE) ); |
| 31 |
|
|
$document->store; |
| 32 |
|
|
} |
| 33 |
|
|
} |
| 34 |
|
|
} |
| 35 |
|
|
return unless ref $document && $document->id; |
| 36 |
|
|
|
| 37 |
|
|
</%init> |