Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 64c12df6

Von Werner Hahn vor mehr als 6 Jahren hinzugefügt

  • ID 64c12df64c6ee056bd7571bf751e6fd0d1e60766
  • Vorgänger d7fe5d1a
  • Nachfolger c267657f

Shopmodul: Bilder hochladen

Unterschiede anzeigen:

SL/File.pm
8 8
use SL::File::Backend;
9 9
use SL::File::Object;
10 10
use SL::DB::History;
11
use SL::DB::ShopImage;
11 12
use SL::DB::File;
12 13
use SL::Helper::UserPreferences;
14
use SL::Controller::Helper::ThumbnailCreator qw(file_probe_type);
13 15
use SL::JSON;
14 16

  
15 17
use constant RENAME_OK          => 0;
......
189 191

  
190 192
sub _save {
191 193
  my ($self, %params) = @_;
194
  $main::lxdebug->dump(0, 'WH: PARAMS', \%params);
192 195
  my $file = $params{dbfile};
193 196
  my $exists = 0;
194 197

  
......
240 243

  
241 244
  $file->mtime(DateTime->now_local);
242 245
  $file->save;
246
  #ShopImage
247
  if($file->object_type eq "shop_image"){
248
    my $image_content = $params{file_contents};
249
    my $thumbnail = file_probe_type($image_content);
250
    $main::lxdebug->dump(0, 'WH: THUMB ',$thumbnail);
251
    my $shopimage = SL::DB::ShopImage->new();
252
    $shopimage->assign_attributes(
253
                                  file_id                => $file->id,
254
                                  thumbnail_content      => $thumbnail->{thumbnail_img_content},
255
                                  org_file_height        => $thumbnail->{file_image_height},
256
                                  org_file_width         => $thumbnail->{file_image_width},
257
                                  thumbnail_content_type => $thumbnail->{thumbnail_img_content_type},
258
                                 );
259
    $shopimage->save;
260
  }
243 261
  if ($params{file_type} eq 'document' && $params{source} ne 'created') {
244 262
    SL::DB::History->new(
245 263
      addition    => 'IMPORT',

Auch abrufbar als: Unified diff