diff --git a/lib/WebGUI/Macro/Product.pm b/lib/WebGUI/Macro/Product.pm index 1ab524a32..4d956e567 100644 --- a/lib/WebGUI/Macro/Product.pm +++ b/lib/WebGUI/Macro/Product.pm @@ -7,12 +7,33 @@ use WebGUI::Asset::Template; use WebGUI::SQL; use WebGUI::International; +=head1 NAME + +Package WebGUI::Macro::Product + +=head1 DESCRIPTION + +This macro looks up a Product in the Product Manager + +=head2 process ( ID/SKU [,templateId] ) + +=head3 productId or SKU + +The productId or SKU of the project to look up. + +=head3 templateId + +An alternate template to use for formatting the link, referenced by templateId. If this +is left blank, a default template from the Macro/Product namespace will be used. + +=cut + sub process { my (@param, $productId, $variantId, $product, $variant, $output, $templateId, @variantLoop, %var); @param = @_; - return 'No SKU or productId passed' unless ($_[0]); + return WebGUI::International::get('no sku or id') unless ($_[0]); ($productId, $variantId) = WebGUI::SQL->quickArray("select productId, variantId from productVariants where sku=".quote($_[0])); ($productId) = WebGUI::SQL->quickArray("select productId from products where sku=".quote($_[0])) unless ($productId); diff --git a/lib/WebGUI/Macro/Spacer.pm b/lib/WebGUI/Macro/Spacer.pm index f7587aec6..89e79cee6 100644 --- a/lib/WebGUI/Macro/Spacer.pm +++ b/lib/WebGUI/Macro/Spacer.pm @@ -15,6 +15,29 @@ use WebGUI::Session; #------------------------------------------------------------------- +=head1 NAME + +Package WebGUI::Macro::Spacer + +=head1 DESCRIPTION + +Macro for outputting a spacer graphic. + +=head2 process ( [width, height] ) + +process takes returns an IMG tag pointing to the spacer gif in the WebGUI +extras directory. + +=head3 width + +Set the width of the spacer. + +=head3 height + +Set the height of the spacer. + +=cut + sub process { my ($output, @param, $width, $height); @param = @_; diff --git a/lib/WebGUI/Macro/Splat_random.pm b/lib/WebGUI/Macro/Splat_random.pm index 43d94c40e..53071ce88 100644 --- a/lib/WebGUI/Macro/Splat_random.pm +++ b/lib/WebGUI/Macro/Splat_random.pm @@ -13,6 +13,25 @@ package WebGUI::Macro::Splat_random; use strict; use WebGUI::Utility; +=head1 NAME + +Package WebGUI::Macro::Splat_random + +=head1 DESCRIPTION + +Macro for returning a bounded, integer random number. + +=head2 process ( max ) + +Random numbers are rounded, not truncated. + +=head3 max + +The maximum random number. If omitted, 1_000_000_000 is +used as a default. + +=cut + #------------------------------------------------------------------- sub process { my ($temp, @param); diff --git a/lib/WebGUI/Macro/StyleSheet.pm b/lib/WebGUI/Macro/StyleSheet.pm index e48709d1a..4fbac2ed7 100644 --- a/lib/WebGUI/Macro/StyleSheet.pm +++ b/lib/WebGUI/Macro/StyleSheet.pm @@ -14,6 +14,24 @@ use strict; use WebGUI::Session; use WebGUI::Style; +=head1 NAME + +Package WebGUI::Macro::StyleSheet + +=head1 DESCRIPTION + +Macro for dynamically adding references to CSS documents to use in this page. + +=head2 process ( url ) + +process is a wrapper around WebGUI::Style::setLink(). + +=head3 url + +The URL to the CSS document. + +=cut + #------------------------------------------------------------------- sub process { WebGUI::Style::setLink(shift,{ diff --git a/lib/WebGUI/Macro/SubscriptionItem.pm b/lib/WebGUI/Macro/SubscriptionItem.pm index 105f08148..d9d8c1e66 100644 --- a/lib/WebGUI/Macro/SubscriptionItem.pm +++ b/lib/WebGUI/Macro/SubscriptionItem.pm @@ -5,6 +5,30 @@ use WebGUI::Asset::Template; use WebGUI::SQL; use WebGUI::URL; +=head1 NAME + +Package WebGUI::Macro::SubscriptionItem; + +=head1 DESCRIPTION + +Macro for displaying information about subscription items. + +=head2 process ( subscriptionId [,templateId ] ) + +process takes two optional parameters for customizing the content and layout +of the account link. + +=head3 subscriptionId + +The text of the link. If no text is displayed an internationalized default will be used. + +=head3 templateId + +A templateId to use for formatting the link. If this is empty, a default template will +be used from the Macro/SubscriptionItem namespace. + +=cut + sub process { my ($subscriptionId, $templateId, %var); ($subscriptionId, $templateId) = @_; diff --git a/lib/WebGUI/Macro/SubscriptionItemPurchaseUrl.pm b/lib/WebGUI/Macro/SubscriptionItemPurchaseUrl.pm index c00f96339..1db835de5 100644 --- a/lib/WebGUI/Macro/SubscriptionItemPurchaseUrl.pm +++ b/lib/WebGUI/Macro/SubscriptionItemPurchaseUrl.pm @@ -3,6 +3,25 @@ package WebGUI::Macro::SubscriptionItemPurchaseUrl; use strict; use WebGUI::URL; +=head1 NAME + +Package WebGUI::Macro::SubscriptionItemPurchaseUrl + +=head1 DESCRIPTION + +Macro that returns a URL to purchase a subscription item. + +=head2 process ( subscriptionId ) + +process returns a URL that is the current page with an operation appended +to purchase the requested subscription item. + +=head3 subscriptionId + +The ID of the subscription item to purchase. + +=cut + sub process { return WebGUI::URL::page('op=purchaseSubscription;sid='.shift); } diff --git a/lib/WebGUI/Macro/Thumbnail.pm b/lib/WebGUI/Macro/Thumbnail.pm index f05955b80..885736d99 100644 --- a/lib/WebGUI/Macro/Thumbnail.pm +++ b/lib/WebGUI/Macro/Thumbnail.pm @@ -14,6 +14,23 @@ use strict; use WebGUI::Asset::File::Image; use WebGUI::Session; +=head1 NAME + +Package WebGUI::Macro::Thumbnail + +=head1 DESCRIPTION + +Macro for returning a thumbnail to an Image Asset. + +=head2 process ( url ) + +=head3 url + +A URL to the Image Asset whose thumbnail you want to display. If no +Image Asset can be found with that URL, then undef will be returned. + +=cut + #------------------------------------------------------------------- sub process { my $url = shift; diff --git a/lib/WebGUI/Macro/URLEncode.pm b/lib/WebGUI/Macro/URLEncode.pm index 5eb875b9e..96c45b9a3 100644 --- a/lib/WebGUI/Macro/URLEncode.pm +++ b/lib/WebGUI/Macro/URLEncode.pm @@ -14,6 +14,25 @@ use strict; use WebGUI::Session; use WebGUI::URL; +=head1 NAME + +Package WebGUI::Macro::URLEncode + +=head1 DESCRIPTION + +Macro for URL encoding text. + +=head2 process ( text ) + +process is really a wrapper around WebGUI::URL::escape; +of the account link. + +=head3 text + +The text to URL encode. + +=cut + #------------------------------------------------------------------- sub process { return WebGUI::URL::escape(shift); diff --git a/lib/WebGUI/Macro/r_printable.pm b/lib/WebGUI/Macro/r_printable.pm index 300ad587e..9a12ddcb0 100644 --- a/lib/WebGUI/Macro/r_printable.pm +++ b/lib/WebGUI/Macro/r_printable.pm @@ -17,6 +17,38 @@ use WebGUI::Asset::Template; use WebGUI::URL; use WebGUI::Utility; +=head1 NAME + +Package WebGUI::Macro::r_printable + +=head1 DESCRIPTION + +Macro for displaying a link to the user to change the page's style template +to one more suitable for printing. + +=head2 process ( [text,styleId,template] ) + +process takes two optional parameters for customizing the content and layout +of the account link. + +=head3 text + +The text of the link. If no text is displayed an internationalized +default will be used. If the text equals 'linkonly', then only the +URL for the link will be returned instead of the templated output. + +=head3 styleId + +The default style to make the page printable is "Make Page Printable". The +styleId argument can be used to override this default. + +=head3 template + +The URL to a template to use for formatting the link. If omitted, a default +is used. + +=cut + #------------------------------------------------------------------- sub process { my ($temp, @param, $styleId); diff --git a/lib/WebGUI/Macro/u_companyUrl.pm b/lib/WebGUI/Macro/u_companyUrl.pm index eb3529433..5bc45aa4d 100644 --- a/lib/WebGUI/Macro/u_companyUrl.pm +++ b/lib/WebGUI/Macro/u_companyUrl.pm @@ -13,6 +13,21 @@ package WebGUI::Macro::u_companyUrl; use strict; use WebGUI::Session; +=head1 NAME + +Package WebGUI::Macro::u_companyUrl + +=head1 DESCRIPTION + +Macro for displaying the Company URL entered into the WebGUI site settings + +=head2 process ( ) + +returns the companyURL from the session variable. + +=cut + + #------------------------------------------------------------------- sub process { return $session{setting}{companyURL}; diff --git a/lib/WebGUI/i18n/English/Macro_Product.pm b/lib/WebGUI/i18n/English/Macro_Product.pm index 84ac6e268..ae301aa15 100644 --- a/lib/WebGUI/i18n/English/Macro_Product.pm +++ b/lib/WebGUI/i18n/English/Macro_Product.pm @@ -16,6 +16,11 @@ our $I18N = { lastUpdated => 1128918830, }, + 'no sku or id' => { + message => q|No SKU or productId passed|, + lastUpdated => 1135117939, + }, + 'cannot find product' => { message => q|Cannot find product|, lastUpdated => 1128976376, @@ -32,10 +37,10 @@ our $I18N = {

^Product(SKU or productId, [templateId]);
This macro looks up a Product in the Product Manager by SKU or productId and -allows information about i to be displayed. If the SKU or productId cannot +allows information about it to be displayed. If the SKU or productId cannot be found, the message ^International("cannot find product","Macro_Product"); will be displayed.

-

The macro may take one optional argument, an alternate template in the Macro/Product namespace for formatting information about the Product. The following variables are available in the template:

+

The macro takes one optional argument, an alternate template in the Macro/Product namespace for formatting information about the Product. The following variables are available in the template:

variants.message
The internationalized text "^International("available product configurations","Macro_Product");"