diff --git a/lib/WebGUI/Macro/Extras.pm b/lib/WebGUI/Macro/Extras.pm index 6960e8220..43ce3dea4 100644 --- a/lib/WebGUI/Macro/Extras.pm +++ b/lib/WebGUI/Macro/Extras.pm @@ -21,6 +21,7 @@ Package WebGUI::Macro::Extras Macro for returning the extrasURL set up in the site's WebGUI.conf file. + =head2 process Returns the extrasURL. A trailing slash '/' is appended to the URL. diff --git a/lib/WebGUI/Macro/Page.pm b/lib/WebGUI/Macro/Page.pm index 7cf140bbd..b2d200ca9 100644 --- a/lib/WebGUI/Macro/Page.pm +++ b/lib/WebGUI/Macro/Page.pm @@ -13,6 +13,25 @@ package WebGUI::Macro::Page; use strict; use WebGUI::Session; +=head1 NAME + +Package WebGUI::Macro::Page + +=head1 DESCRIPTION + +Macro for pulling information from the Asset in which it's embedded. + +=head2 process ( property ) + +If the macro is called from outside of an Asset, or if there's no asset in +session variable, returns a single space. + +=head3 property + +The name of the property to retrieve from the assset via $session{asset}->get() + +=cut + #------------------------------------------------------------------- sub process { if (exists $session{asset}) { diff --git a/lib/WebGUI/Macro/PageTitle.pm b/lib/WebGUI/Macro/PageTitle.pm index 2067ee93d..a2a39a0e6 100644 --- a/lib/WebGUI/Macro/PageTitle.pm +++ b/lib/WebGUI/Macro/PageTitle.pm @@ -13,6 +13,22 @@ package WebGUI::Macro::PageTitle; use strict; use WebGUI::Session; +=head1 NAME + +Package WebGUI::Macro::PageTitle + +=head1 DESCRIPTION + +Macro for returning the title of the current Asset. + +=head2 process ( ) + +Returns the title of the current Asset. If a WebGUI operation or function +is active, then the title is returned as a link to the Asset. If there's +no asset cached in the session variable, nothing is returned. + +=cut + #------------------------------------------------------------------- sub process { if (exists $session{asset}) { diff --git a/lib/WebGUI/Macro/PageUrl.pm b/lib/WebGUI/Macro/PageUrl.pm index 47265ad7a..341d632f9 100644 --- a/lib/WebGUI/Macro/PageUrl.pm +++ b/lib/WebGUI/Macro/PageUrl.pm @@ -14,6 +14,20 @@ use strict; use WebGUI::Session; use WebGUI::URL; +=head1 NAME + +Package WebGUI::Macro::Page + +=head1 DESCRIPTION + +Macro for displaying the url for the current asset. + +=head2 process ( ) + +process is really a wrapper around WebGUI::URL::page(); + +=cut + #------------------------------------------------------------------- sub process { return WebGUI::URL::page(); diff --git a/lib/WebGUI/Macro/Quote.pm b/lib/WebGUI/Macro/Quote.pm index 922672a71..f9405871d 100644 --- a/lib/WebGUI/Macro/Quote.pm +++ b/lib/WebGUI/Macro/Quote.pm @@ -13,6 +13,24 @@ package WebGUI::Macro::Quote; use strict; use WebGUI::SQL; +=head1 NAME + +Package WebGUI::Macro::Quote + +=head1 DESCRIPTION + +Macro for quoting data to make it safe for use in SQL queries. + +=head2 process ( text ) + +process is really a wrapper around WebGUI::SQL::quote(); + +=head3 text + +The text to quote. + +=cut + #------------------------------------------------------------------- sub process { return quote(shift); diff --git a/lib/WebGUI/Macro/RandomAssetProxy.pm b/lib/WebGUI/Macro/RandomAssetProxy.pm index ce6fe8cad..5615a2d08 100644 --- a/lib/WebGUI/Macro/RandomAssetProxy.pm +++ b/lib/WebGUI/Macro/RandomAssetProxy.pm @@ -13,6 +13,25 @@ package WebGUI::Macro::RandomAssetProxy; use strict; use WebGUI::Asset; use WebGUI::Session; +use WebGUI::International; + +=head1 NAME + +Package WebGUI::Macro::RandomAssetProxy + +=head1 DESCRIPTION + +Macro for displaying a random asset. + +=head2 process ( url ) + +=head3 url + +The URL of an asset from the site. A random asset will be chosen +from among that asset's children. Error message will be returned +if no asset exists at that url, or if the asset has no children. + +=cut #------------------------------------------------------------------- sub process { @@ -28,10 +47,10 @@ sub process { $randomAsset->toggleToolbar; return $randomAsset->canView ? $randomAsset->view() : undef; } else { - return "Asset has no children."; + return WebGUI::International::get('childless','Macro_RandomAssetProxy'); } } else { - return "Invalid asset URL."; + return WebGUI::International::get('invalid url','Macro_RandomAssetProxy'); } } diff --git a/lib/WebGUI/Storage/Image.pm b/lib/WebGUI/Storage/Image.pm index 185682f52..8ff1bbb38 100644 --- a/lib/WebGUI/Storage/Image.pm +++ b/lib/WebGUI/Storage/Image.pm @@ -44,6 +44,8 @@ These methods are available from this class: my $boolean = $self->generateThumbnail($filename); my $url = $self->getThumbnailUrl; my $boolean = $self->isImage; +my ($captchaFile, $challenge) = $self->addFileFromCaptcha; +$self->resize($imageFile, $width, $height); =cut diff --git a/lib/WebGUI/i18n/English/Macro_RandomAssetProxy.pm b/lib/WebGUI/i18n/English/Macro_RandomAssetProxy.pm index 526d12bf2..d951f242d 100644 --- a/lib/WebGUI/i18n/English/Macro_RandomAssetProxy.pm +++ b/lib/WebGUI/i18n/English/Macro_RandomAssetProxy.pm @@ -12,16 +12,26 @@ our $I18N = { lastUpdated => 1112315917, }, - 'random asset proxy body' => { - message => q| + 'random asset proxy body' => { + message => q|
^RandomAssetProxy();
^RandomAssetProxy(Asset URL);
This macro works similarly to the ^AssetProxy(); macro except instead of displaying the
Asset, it picks a random Asset from the descendents of the Asset whose URL is supplied as the
argument.
- |,
- lastUpdated => 1112315914,
- },
+ |,
+ lastUpdated => 1135101114,
+ },
+
+ 'childless' => {
+ message => q|Asset has no children.|,
+ lastUpdated => 1135101140,
+ },
+
+ 'invalid url' => {
+ message => q|Invalid asset URL.|,
+ lastUpdated => 1135101140,
+ },
};