diff --git a/lib/WebGUI/Operation/FormHelpers.pm b/lib/WebGUI/Operation/FormHelpers.pm index a372fc42c..3e0e7853e 100644 --- a/lib/WebGUI/Operation/FormHelpers.pm +++ b/lib/WebGUI/Operation/FormHelpers.pm @@ -14,7 +14,23 @@ use strict; use WebGUI::Asset; use WebGUI::HTMLForm; +=head1 NAME + +Package WebGUI::Operation::FormHelpers + +=head1 DESCRIPTION + +Operational support for various things relating to forms and rich editors. + #------------------------------------------------------------------- + +=head2 www_formAssetTree ( $session ) + +Returns a list of the all the current Asset's children as form. The children can be filtered via the +form variable C. A crumb trail is provided for navigation. + +=cut + sub www_formAssetTree { my $session = shift; my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session); @@ -45,6 +61,12 @@ sub www_formAssetTree { #------------------------------------------------------------------- +=head2 www_richEditPageTree ( $session ) + +Asset picker for the rich editor. + +=cut + sub www_richEditPageTree { my $session = shift; my $i18n = WebGUI::International->new($session); @@ -99,6 +121,14 @@ window.opener.tinyMCE.insertLink("^" + "/" + ";" + document.getElementById("url_ #------------------------------------------------------------------- + +=head2 www_richEditImageTree ( $session ) + +Similar to www_formAssetTree, except it is limited to only display assets of class WebGUI::Asset::File::Image. +Each link display a thumbnail of the image via www_richEditViewThumbnail. + +=cut + sub www_richEditImageTree { my $session = shift; my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session); @@ -124,13 +154,22 @@ sub www_richEditImageTree { #------------------------------------------------------------------- + +=head2 www_richEditViewThumbnail ( $session ) + +Displays a thumbnail of an Image Asset in the Image manager for the Rich Editor. The current +URL in the session object is used to determine which Image is used. + +=cut + sub www_richEditViewThumbnail { my $session = shift; my $image = WebGUI::Asset->newByUrl($session); + my $i18n = WebGUI::International->new($session); $session->style->useEmptyStyle("1"); if ($image->get("className") =~ /WebGUI::Asset::File::Image/) { my $output = '
'; - $output .= 'Preview'; + $output .= ''.$i18n->get('preview').''; $output .= '
'; $output .= $image->get("filename"); $output .= '
'; @@ -144,7 +183,7 @@ sub www_richEditViewThumbnail { \n"; return $output; } - return '
Image Manager
'; + return '
'.$i18n->get('image manager').'
'; } diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index d4ef5233b..dfab31218 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -3869,6 +3869,18 @@ Message Boards hold forums for users. There are many different Wobjects in WebG lastUpdated => 0, }, + 'preview' => { + message => q|Preview|, + context => q|alternate image text displayed when a thumbnail cannot be found for an image. The image is being previewed.|, + lastUpdated => 1141434351, + }, + + 'image manager' => { + message => q|Image Manager|, + context => q|alternate text when an icon cannot be found in the Rich Editor image manager thumbnail display form.|, + lastUpdated => 1141434353, + }, + }; 1;