Added POD to 5 macros
Internationalized the AssetProxy "Invalid Asset URL" error message.
This commit is contained in:
parent
fe27be1974
commit
7c619a1ecd
6 changed files with 115 additions and 1 deletions
|
|
@ -14,6 +14,27 @@ use strict;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::AOIHits
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying the number of times a key,value pair occurs in the
|
||||
metadata for content viewed by the current user.
|
||||
|
||||
=head2 process ( key, value )
|
||||
|
||||
=head3 key
|
||||
|
||||
The metadata property that will be looked up.
|
||||
|
||||
=head3 value
|
||||
|
||||
The value for the key that will be looked up.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my (@param, $temp);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,27 @@ use strict;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::AOIRank
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying the value for a metadata property by rank.
|
||||
|
||||
=head2 process ( key, [ rank ] )
|
||||
|
||||
=head3 key
|
||||
|
||||
The metadata property that will be looked up.
|
||||
|
||||
=head3 rank
|
||||
|
||||
Define which value, by it's ranking, will be displayed. The highest ranking is
|
||||
1. If the rank is omitted, a default of 1 will be used.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my (@param, $temp);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,23 @@ package WebGUI::Macro::AdminText;
|
|||
use strict;
|
||||
use WebGUI::Session;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::AdminText
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying a text message to user's with Admin turned on.
|
||||
|
||||
=head2 process ( [text] )
|
||||
|
||||
=head3 text
|
||||
|
||||
The text to be displayed to the user. If the user is not in Admin mode the empty
|
||||
string is returned.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my @param = @_;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,35 @@ use WebGUI::Session;
|
|||
use WebGUI::Asset::Template;
|
||||
use WebGUI::URL;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::AdminToggle
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying a url to the user for turning Admin mode on and off.
|
||||
|
||||
=head2 process ( [turnOn,turnOff,template ] )
|
||||
|
||||
process takes two optional parameters for customizing the content and layout
|
||||
of the account link.
|
||||
|
||||
=head3 turnOn
|
||||
|
||||
The text displayed to the user if Admin mode is turned off and they are in the
|
||||
Turn On Admin group. If this is blank an internationalized default is used.
|
||||
|
||||
=head3 turnOff
|
||||
|
||||
The text displayed to the user if Admin mode is turned on and they are in the
|
||||
Turn On Admin group. If this is blank an internationalized default is used.
|
||||
|
||||
=head3 template
|
||||
|
||||
A template to use for formatting the link.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
if (WebGUI::Grouping::isInGroup(12)) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,27 @@ use Time::HiRes;
|
|||
use WebGUI::Asset;
|
||||
use WebGUI::ErrorHandler;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::International;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::AssetProxy
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying the output of an Asset in another location.
|
||||
|
||||
=head2 process ( url )
|
||||
|
||||
=head3 url
|
||||
|
||||
The URL of the Asset whose output will be returned. If no Asset with that URL
|
||||
can be found, an internationalized error message will be returned instead.
|
||||
|
||||
No editing controls (toolbar) will be displayed in the Asset output, even if
|
||||
Admin is turned on.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
|
|
@ -28,7 +49,7 @@ sub process {
|
|||
$output .= "AssetProxy:".Time::HiRes::tv_interval($t) if (WebGUI::ErrorHandler::canShowPerformanceIndicators());
|
||||
return $output;
|
||||
} else {
|
||||
return "Invalid Asset URL";
|
||||
return WebGUI::International::get('invalid url', 'Macro_AssetProxy');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ our $I18N = {
|
|||
lastUpdated => 1112315917,
|
||||
},
|
||||
|
||||
'invalid url' => {
|
||||
message => q|Invalid Asset URL|,
|
||||
lastUpdated => 1134769012,
|
||||
},
|
||||
|
||||
'asset proxy body' => {
|
||||
message => q|
|
||||
<P><B>^AssetProxy</B>(<i>Asset URL</i>);<BR>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue