From 903ccd0777d1d08d97f784889fdfae44c87a1dd3 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 31 Oct 2005 04:41:38 +0000 Subject: [PATCH] manual merge of changes from 6.7.8 for File,Image assets --- lib/WebGUI/Asset/File.pm | 1 + lib/WebGUI/Asset/File/Image.pm | 13 +++- lib/WebGUI/Help/Asset_File.pm | 5 ++ lib/WebGUI/Help/Asset_Image.pm | 58 +++++++++++++++ lib/WebGUI/i18n/English/Asset_File.pm | 32 ++++++--- lib/WebGUI/i18n/English/Asset_Image.pm | 97 +++++++++++++++++++++++--- 6 files changed, 183 insertions(+), 23 deletions(-) diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index 6898a4f12..c2f0b7051 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -280,6 +280,7 @@ sub www_edit { my $tabform = $self->getEditForm; $tabform->getTab("display")->template( -value=>$self->getValue("templateId"), + -hoverHelp=>WebGUI::International::get('file template description','Asset_Image'), -namespace=>"FileAsset" ); $self->getAdminConsole->setHelp("file add/edit", "Asset_File"); diff --git a/lib/WebGUI/Asset/File/Image.pm b/lib/WebGUI/Asset/File/Image.pm index 265b91a1e..0900f003a 100644 --- a/lib/WebGUI/Asset/File/Image.pm +++ b/lib/WebGUI/Asset/File/Image.pm @@ -231,6 +231,7 @@ sub www_edit { $tabform->getTab("display")->template( -value=>$self->get("templateId"), -namespace=>"ImageAsset", + -hoverHelp=>WebGUI::International::get('image template description','Asset_Image'), -defaultValue=>"PBtmpl0000000000000088" ); $self->getAdminConsole->setHelp("image add/edit","Asset_Image"); @@ -254,18 +255,24 @@ sub www_resize { my ($x, $y) = $self->getStorageLocation->getSizeInPixels($self->get("filename")); $f->readOnly( -label=>WebGUI::International::get('image size', 'Asset_Image'), - -value=>$x.' x '.$y + -hoverHelp=>WebGUI::International::get('image size description', 'Asset_Image'), + -value=>$x.' x '.$y, ); $f->integer( -label=>WebGUI::International::get('new width','Asset_Image'), - -name=>"newWidth" + -hoverHelp=>WebGUI::International::get('new width description','Asset_Image'), + -name=>"newWidth", + -value=>$x, ); $f->integer( -label=>WebGUI::International::get('new height','Asset_Image'), - -name=>"newHeight" + -hoverHelp=>WebGUI::International::get('new height description','Asset_Image'), + -name=>"newHeight", + -value=>$y, ); $f->submit; my $image = '
'.$self->get(
'; + $self->getAdminConsole->setHelp("image resize","Asset_Image"); return $self->getAdminConsole->render($f->print.$image,WebGUI::International::get("resize image","Asset_Image")); } diff --git a/lib/WebGUI/Help/Asset_File.pm b/lib/WebGUI/Help/Asset_File.pm index 15191771b..d38b0c716 100644 --- a/lib/WebGUI/Help/Asset_File.pm +++ b/lib/WebGUI/Help/Asset_File.pm @@ -16,6 +16,11 @@ our $HELP = { description => 'current file description', namespace => 'Asset_File', }, + { + title => 'file template title', + description => 'file template description', + namespace => 'Asset_File', + }, ], related => [ { diff --git a/lib/WebGUI/Help/Asset_Image.pm b/lib/WebGUI/Help/Asset_Image.pm index 8e2433275..b58754c50 100644 --- a/lib/WebGUI/Help/Asset_Image.pm +++ b/lib/WebGUI/Help/Asset_Image.pm @@ -21,8 +21,21 @@ our $HELP = { description => 'Thumbnail description', namespace => 'Asset_Image', }, + { + title => 'image template title', + description => 'image template description', + namespace => 'Asset_Image', + }, ], related => [ + { + tag => 'image template', + namespace => 'Asset_Image', + }, + { + tag => 'image resize', + namespace => 'Asset_Image', + }, { tag => 'asset fields', namespace => 'Asset' @@ -34,6 +47,51 @@ our $HELP = { ] }, + 'image template' => { + title => 'image template title', + body => 'image template body', + fields => [ + ], + related => [ + { + tag => 'image add/edit', + namespace => 'Asset_Image', + }, + { + tag => 'template language', + namespace => 'Asset_Template', + }, + ] + }, + + 'image resize' => { + title => 'resize image title', + body => 'resize image body', + fields => [ + { + title => 'image size', + description => 'image size description', + namespace => 'Asset_Image', + }, + { + title => 'new width', + description => 'new width description', + namespace => 'Asset_Image', + }, + { + title => 'new height', + description => 'new height description', + namespace => 'Asset_Image', + }, + ], + related => [ + { + tag => 'image add/edit', + namespace => 'Asset_Image', + }, + ] + }, + }; 1; diff --git a/lib/WebGUI/i18n/English/Asset_File.pm b/lib/WebGUI/i18n/English/Asset_File.pm index 43c0f636b..b083c27c7 100644 --- a/lib/WebGUI/i18n/English/Asset_File.pm +++ b/lib/WebGUI/i18n/English/Asset_File.pm @@ -15,32 +15,44 @@ our $I18N = { context => 'Describing file add/edit form specific fields', lastUpdated => 1119068839, }, + 'file template title' => { - message => q|File, Template|, - lastUpdated => 1109287565, + message => q|File Template|, + lastUpdated => 1130456105, + }, + + 'file template description' => { + message => q|File templates allow you to display information about the file, such as its filename, size or an icon representing the file type.|, + lastUpdated => 1130456105, }, 'file template body' => { message => q|

The following variables are available in File Templates:

-

attachment.icon
+

fileIcon
The icon which describes the type of file. -

attachment.url
+

fileUrl
The URL to the file. -

attachment.name
+

controls
+A toolbar for working with the file. + +

filename
The name of the file. -

attachment.size
-The size of the file. +

storageId
+The internal storage ID used for the file. -

attachment.type
-The type of the file (PDF, etc.) +

title
+The title set for the file when it was uploaded, or the filename if none was entered. + +

menuTitle
+The menu title, displayed in navigations, set for the file when it was uploaded, or the filename if none was entered. |, context => 'Describing the file template variables', - lastUpdated => 1109287834, + lastUpdated => 1130439830, }, diff --git a/lib/WebGUI/i18n/English/Asset_Image.pm b/lib/WebGUI/i18n/English/Asset_Image.pm index 5cfea03b7..c91eb21ca 100644 --- a/lib/WebGUI/i18n/English/Asset_Image.pm +++ b/lib/WebGUI/i18n/English/Asset_Image.pm @@ -65,42 +65,119 @@ shown here.|, context => q|label for Image asset form|, lastUpdated => 1106765841 }, - + 'image size' => { message => q|Image Size|, context => q|label for Image asset form|, lastUpdated => 1106765841 }, - - 'image size' => { - message => q|Image Size|, - context => q|label for Image asset form|, - lastUpdated => 1106765841 + + 'image size description' => { + message => q|Current size of the image, width and height, in pixels|, + context => q|hover help for Image asset form, image size field|, + lastUpdated => 1130531739, }, - + 'edit image' => { message => q|Edit Image|, context => q|label to edit the image|, lastUpdated => 1106765841 }, - + 'resize image' => { message => q|Resize Image|, context => q|label to resize the image|, lastUpdated => 1106765841 }, - + + 'resize image title' => { + message => q|Image, Resize|, + context => q|Title for help entry|, + lastUpdated => 1130532366, + }, + + 'resize image body' => { + message => q|

This allows you to grow, shrink or stretch images inside of WebGUI. Simply enter + the new width and height in the form, press Submit and the image will be changed on the server.

+

There is no undo or versioning for this task. You may wish to download a copy of the image + in case you make a mistake.

+

If you know the new width or height, and do not want to calculate the other dimension, just enter 0 + in that field and WebGUI will calculate it for you.

|, + lastUpdated => 1130531896, + }, + 'new width' => { message => q|New Width|, context => q|label to resize the image|, lastUpdated => 1106765841 }, - + + 'new width description' => { + message => q|New Width|, + context => q|Enter the new width for the Image in pixels. If 0 is entered, a new width will be calculated using the height.|, + lastUpdated => 1130538990 + }, + 'new height' => { message => q|New Height|, context => q|label to resize the image|, lastUpdated => 1106765841 }, + + 'new height description' => { + message => q|New Height|, + context => q|Enter the new height for the Image in pixels. If 0 is entered, a new height will be calculated using the width.|, + lastUpdated => 1130538987 + }, + + 'image template title' => { + message => q|Image Template|, + lastUpdated => 1130440964, + }, + + 'image template description' => { + message => q|Image templates allow you to display information about the image, such as its thumbnail, filename or the image itself.|, + lastUpdated => 1130440964, + }, + + 'image template body' => { + message => q|

The following variables are available in Image Templates:

+ +

fileIcon
+The icon which describes the type of file. + +

fileUrl
+The URL to the file. + +

controls
+A toolbar for working with the file. + +

thumbnail
+A URL to the thumbnail of the image; + +

thumbnailSize
+An integer representing the length of the longest side + +

parameters
+Any additional IMG tag parameters that were entered with the image was uploaded. + +

filename
+The name of the image. + +

storageId
+The internal storage ID used for the file. + +

title
+The title set for the file when it was uploaded, or the filename if none was entered. + +

menuTitle
+The menu title, displayed in navigations, set for the image when it was uploaded, or the filename if none was entered. + + |, + context => 'Describing the image template variables', + lastUpdated => 1130456281, + }, + };