Revision 169

Date:
2011/11/17 15:31:12
Author:
ahitrov
Revision Log:
Hack for complicated image structures
Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/core/comps/contenido/components/set_image.msn

     
    29 29 }
    30 30 if ($upload) {
    31 31
    32 my $IMG = $object->_store_image( $upload, attr => $prop->{attr} );
    32 my $IMG = $object->_store_image( $upload, attr => $prop->{attr}, prop => $prop );
    33 33
    34 34 if ( ref $IMG eq 'HASH' && exists $IMG->{filename} ) {
    35 35 $object->_delete_image( $default );
  • utf8/core/lib/Contenido/File.pm

     
    170 170 my $input = shift;
    171 171 my (%opts) = @_;
    172 172 my $object = delete $opts{object} || return;
    173 my $attr = delete $opts{attr} || return;
    173 my $attr = delete $opts{attr};
    174 174
    175 my ($prop) = grep { $_->{attr} eq $attr } $object->structure;
    175 my ($prop) = exists $opts{prop} && ref $opts{prop} ? ($opts{prop}) : $attr ? grep { $_->{attr} eq $attr } $object->structure : (undef);
    176 176 return unless ref $prop;
    177 177 my @preview = exists $prop->{'preview'} && ref $prop->{'preview'} eq 'ARRAY' ? @{$prop->{'preview'}} : exists $prop->{'preview'} && $prop->{'preview'} ? ($prop->{'preview'}) : ();
    178 178 my @crops = exists $prop->{'crop'} && ref $prop->{'crop'} eq 'ARRAY' ? @{$prop->{'crop'}} : exists $prop->{'crop'} && $prop->{'crop'} ? ($prop->{'crop'}) : ();
  • utf8/core/lib/Contenido/Object.pm

     
    1144 1144 my $input = shift;
    1145 1145 my (%opts) = @_;
    1146 1146
    1147 return Contenido::File::store_image( $input, object => $self, attr => $opts{attr} );
    1147 return Contenido::File::store_image( $input, object => $self, attr => $opts{attr}, prop => $opts{prop} );
    1148 1148 }
    1149 1149
    1150 1150 # ----------------------------------------------------------------------------