Added Karma RFE: Thumbnail size can be enterred in CS

This commit is contained in:
JT Smith 2006-10-11 04:05:12 +00:00
parent b1bb5d0b58
commit 4f0d117c9f
6 changed files with 62 additions and 3 deletions

View file

@ -18,6 +18,7 @@
- Changed the ?op=editProduct form to a TabForm.
- fixed a small error in WebGUI::Group documentation.
- Added WebGUI::Text with some CSV functions.
- Added Karma RFE: Thumbnail size can be enterred in CS
7.0.9
- Removed the need for DateTime::Cron::Simple, which also added the ability

View file

@ -23,11 +23,21 @@ recalculateProjectCompletion($session);
updateSqlReportTable($session);
updateProductsTable($session);
makeLdapRecursiveFiltersText($session);
addImageStuffToCs($session);
finish($session); # this line required
##-------------------------------------------------
#-------------------------------------------------
sub addImageStuffToCs {
my $session = shift;
print "\tAdding thumbnail and image sizing to CS.\n" unless $quiet;
$session->db->write("alter table Collaboration add column thumbnailSize int not null default 0");
$session->db->write("alter table Collaboration add column maxImageSize int not null default 0");
}
#-------------------------------------------------
sub recalculateProjectCompletion {
my $session = shift;
print "\tForcing project completion recalculation.\n" unless $quiet;

View file

@ -747,10 +747,10 @@ sub postProcess {
if ($storage->isImage($file)) {
##Use generateThumbnail to shrink size to site's max image size
##We should look into using the new resize method instead.
$storage->generateThumbnail($file,$self->session->setting->get("maxImageSize"));
$storage->generateThumbnail($file, $self->getThread->getParent->get("maxImageSize") || $self->session->setting->get("maxImageSize"));
$storage->deleteFile($file);
$storage->renameFile('thumb-'.$file,$file);
$storage->generateThumbnail($file);
$storage->generateThumbnail($file, $self->getThread->getParent->get("thumbnailSize"));
}
$size += $storage->getFileSize($file);
}

View file

@ -339,6 +339,20 @@ sub definition {
label=>$i18n->get('approval workflow'),
hoverHelp=>$i18n->get('approval workflow description'),
},
thumbnailSize => {
fieldType => "integer",
defaultValue => 0,
tab => "display",
label => $i18n->get("thumbnail size"),
hoverHelp => $i18n->get("thumbnail size help")
},
maxImageSize => {
fieldType => "integer",
defaultValue => 0,
tab => "display",
label => $i18n->get("max image size"),
hoverHelp => $i18n->get("max image size help")
},
mailServer=>{
fieldType=>"text",
defaultValue=>undef,

View file

@ -16,6 +16,16 @@ our $HELP = {
description => 'display last reply description',
namespace => 'Asset_Collaboration',
},
{
title => 'thumbnail size',
description => 'thumbnail size help',
namespace => 'Asset_Collaboration',
},
{
title => 'max image size',
description => 'max image size help',
namespace => 'Asset_Collaboration',
},
{
title => 'system template',
description => 'system template description',

View file

@ -14,6 +14,30 @@ our $I18N = {
context => q|thread link|
},
'max image size' => {
message => q|Maximum Image Size|,
lastUpdated => 0,
context => q|field label for image on display tab|
},
'max image size help' => {
message => q|Set the size of the image attachments for this Collaboration System. If you set it to 0 then the default size set in the master settings will be used. Also, changing this setting does not retroactively change the size of images already in the CS. You'll have to re-save each post to get the size to change.|,
lastUpdated => 0,
context => q|help for display setting label|
},
'thumbnail size' => {
message => q|Thumbnail Size|,
lastUpdated => 0,
context => q|field label for thumbnails on display tab|
},
'thumbnail size help' => {
message => q|Set the size of the thumbnails for this Collaboration System. If you set it to 0 then the default size set in the master settings will be used. Also, changing this setting does not retroactively change the size of thumbnails already in the CS. You'll have to re-save each post to get the size to change.|,
lastUpdated => 0,
context => q|help for display setting label|
},
'require subscription for email posting' => {
message => q|Require subscription for email posts?|,
lastUpdated => 0,