Added a few comments so mere mortals like me will understand what this does in 30 years
This commit is contained in:
parent
9864b4caf1
commit
8860176b39
1 changed files with 3 additions and 4 deletions
|
|
@ -148,17 +148,16 @@ sub getValueFromPost {
|
||||||
my $storage = WebGUI::Storage::Image->get($self->session, $id);
|
my $storage = WebGUI::Storage::Image->get($self->session, $id);
|
||||||
if (defined $storage) {
|
if (defined $storage) {
|
||||||
my @files = @{$storage->getFiles};
|
my @files = @{$storage->getFiles};
|
||||||
my @images = grep{$storage->isImage($_)} @files;
|
my @images = grep{$storage->isImage($_)} @files; # Put all filenames that isImage returns true for into @images
|
||||||
if ($self->get('forceImageOnly')) {
|
if ($self->get('forceImageOnly')) {
|
||||||
$storage->deleteFile($_) for grep{!isIn($_, @images)} @files;
|
$storage->deleteFile($_) for grep{!isIn($_, @images)} @files; # Search @files for filenames that are not in @images and delete them
|
||||||
@files = @images;
|
@files = @images;
|
||||||
}
|
}
|
||||||
|
|
||||||
return undef unless @files;
|
return undef unless @files;
|
||||||
$storage->generateThumbnail($_) for @images;
|
$storage->generateThumbnail($_) for @images; # Make a thumbnail for each filename in @images
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue