From 80c3f027f2b49022cb301b864ed9e872cace4c70 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 16 Dec 2005 22:55:06 +0000 Subject: [PATCH] Add POD to more Macros. Document that using the CanEditText Macro outside of an Asset will have unpredictable results. --- lib/WebGUI/Macro/At_username.pm | 12 ++++++++++++ lib/WebGUI/Macro/CanEditText.pm | 19 +++++++++++++++++++ lib/WebGUI/i18n/English/Macro_CanEditText.pm | 12 +++++++----- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/lib/WebGUI/Macro/At_username.pm b/lib/WebGUI/Macro/At_username.pm index 9ad81e803..191230ea7 100644 --- a/lib/WebGUI/Macro/At_username.pm +++ b/lib/WebGUI/Macro/At_username.pm @@ -13,6 +13,18 @@ package WebGUI::Macro::At_username; use strict; use WebGUI::Session; +=head1 NAME + +Package WebGUI::Macro::At_username + +=head1 DESCRIPTION + +Macro for displaying the current User's username. + +=head2 process + +=cut + #------------------------------------------------------------------- sub process { return $session{user}{username}; diff --git a/lib/WebGUI/Macro/CanEditText.pm b/lib/WebGUI/Macro/CanEditText.pm index b602f588e..0e99f5716 100644 --- a/lib/WebGUI/Macro/CanEditText.pm +++ b/lib/WebGUI/Macro/CanEditText.pm @@ -13,6 +13,25 @@ package WebGUI::Macro::CanEditText; use strict; use WebGUI::Session; +=head1 NAME + +Package WebGUI::Macro::CanEditText + +=head1 DESCRIPTION + +Macro for displaying a message to a User who can edit the Asset +containing the Macro. This macro should not be used outside +of an Asset as it will yield unpredictable results. + +=head2 process ( text ) + +=head3 text + +The text that will be shown to the user. If the user cannot edit +this asset, an empty string will be returned. + +=cut + #------------------------------------------------------------------- sub process { my @param = @_; diff --git a/lib/WebGUI/i18n/English/Macro_CanEditText.pm b/lib/WebGUI/i18n/English/Macro_CanEditText.pm index 337e2a0c9..946aa2a53 100644 --- a/lib/WebGUI/i18n/English/Macro_CanEditText.pm +++ b/lib/WebGUI/i18n/English/Macro_CanEditText.pm @@ -16,14 +16,16 @@ our $I18N = { message => q| ^CanEditText(text message);
-Display a message to a user that can edit the current page. The message can be -HTML or WebGUI Macros. +Display a message to a user that can edit the current Asset.

-Example: ^CanEditText(^AdminToggle;); +Example:
+^CanEditText("You may edit this Asset");
+^CanEditText(^AdminToggle;);

- +Do not use this Macro outside of an Asset as it will have unpredictable +results. |, - lastUpdated => 1112466919, + lastUpdated => 1134773763, }, };