fix thumbnailing of uploaded images via the RTE

This commit is contained in:
Colin Kuskie 2007-02-28 05:35:47 +00:00
parent 218415ad27
commit 85ecb2364a
3 changed files with 12 additions and 9 deletions

View file

@ -10,6 +10,8 @@
- fix: Calendar: Only Turn Admin On group can add events (perlDreamer Consulting, LLC)
- fix: Event -> canEdit (perlDreamer Consulting, LLC)
- fix: import packages broke (perlDreamer Consulting, LLC)
- fix: Uploading images via the Rich Text Editor collateral system did not
make thumbnails (perlDreamer Consulting, LLC)
- fix: A bunch of bugs in fileImport.pl and improved its performance very
significantly (Martin Kamerbeek / Oqapi)

View file

@ -433,10 +433,10 @@ A reference to the current session.
Accepts any parameters specified by the definition() method. This parameter set can be specified by either a hash or hash reference, and can be tagged or not. Here are examples:
my $obj = $class->new({ name=>"this", value=>"that"});
my $obj = $class->new({ -name=>"this", -value=>"that"});
my $obj = $class->new(name=>"this", value=>"that");
my $obj = $class->new(-name=>"this", -value=>"that");
my $obj = $class->new($session, { name=>"this", value=>"that"});
my $obj = $class->new($session, { -name=>"this", -value=>"that"});
my $obj = $class->new($session, name=>"this", value=>"that");
my $obj = $class->new($session, -name=>"this", -value=>"that");
Please note that an id attribute is automatically added to every form element with a name of name_formId. So if your form element has a name of "description" then the id attribute assigned to it would be "description_formId".

View file

@ -426,7 +426,7 @@ sub www_richEditAddImage {
name => 'op',
value => 'richEditAddImageSave',
);
$f->file(
$f->image(
label => $i18n->get('File'),
name => 'filename',
size => 10,
@ -460,15 +460,17 @@ sub www_richEditAddImageSave {
# check if user can edit the current asset
return $session->privilege->insufficient('bare') unless $base->canEdit;
my $storage = WebGUI::Storage::Image->create($session);
#my $imageId = WebGUI::Form::Image->create($session);
my $imageId = WebGUI::Form::Image->new($session,{name => 'filename'})->getValueFromPost;
my $imageObj = WebGUI::Storage::Image->get($session, $imageId);
##This is a hack. It should use the WebGUI::Form::File API to insulate
##us from future form name changes.
my $filename = $storage->addFileFromFormPost('filename_file');
my $filename = $imageObj->getFiles->[0];
if ($filename) {
$base->addChild({
assetId => 'new',
className => 'WebGUI::Asset::File::Image',
storageId => $storage->getId,
storageId => $imageObj->getId,
filename => $filename,
title => $filename,
menuTitle => $filename,
@ -479,7 +481,6 @@ sub www_richEditAddImageSave {
ownerUserId => $session->var->get('userId'),
isHidden => 1,
});
$storage->generateThumbnail($filename);
}
$session->http->setRedirect($url.'?op=richEditImageTree');
return "";