POD for FormHelpers, and two new i18n labels for
the thumbnail display.
This commit is contained in:
parent
0621fd4492
commit
476018f0da
2 changed files with 53 additions and 2 deletions
|
|
@ -14,7 +14,23 @@ use strict;
|
||||||
use WebGUI::Asset;
|
use WebGUI::Asset;
|
||||||
use WebGUI::HTMLForm;
|
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<classLimiter>. A crumb trail is provided for navigation.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_formAssetTree {
|
sub www_formAssetTree {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session);
|
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 {
|
sub www_richEditPageTree {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $i18n = WebGUI::International->new($session);
|
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 {
|
sub www_richEditImageTree {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session);
|
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 {
|
sub www_richEditViewThumbnail {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $image = WebGUI::Asset->newByUrl($session);
|
my $image = WebGUI::Asset->newByUrl($session);
|
||||||
|
my $i18n = WebGUI::International->new($session);
|
||||||
$session->style->useEmptyStyle("1");
|
$session->style->useEmptyStyle("1");
|
||||||
if ($image->get("className") =~ /WebGUI::Asset::File::Image/) {
|
if ($image->get("className") =~ /WebGUI::Asset::File::Image/) {
|
||||||
my $output = '<div align="center">';
|
my $output = '<div align="center">';
|
||||||
$output .= '<img src="'.$image->getThumbnailUrl.'" border="0" alt="Preview">';
|
$output .= '<img src="'.$image->getThumbnailUrl.'" border="0" alt="'.$i18n->get('preview').'">';
|
||||||
$output .= '<br />';
|
$output .= '<br />';
|
||||||
$output .= $image->get("filename");
|
$output .= $image->get("filename");
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
@ -144,7 +183,7 @@ sub www_richEditViewThumbnail {
|
||||||
</script>\n";
|
</script>\n";
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
return '<div align="center"><img src="'.$session->config->get("extrasURL").'/tinymce/images/icon.gif" border="0" alt="Image Manager"></div>';
|
return '<div align="center"><img src="'.$session->config->get("extrasURL").'/tinymce/images/icon.gif" border="0" alt="'.$i18n->get('image manager').'"></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3869,6 +3869,18 @@ Message Boards hold forums for users. There are many different Wobjects in WebG
|
||||||
lastUpdated => 0,
|
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;
|
1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue