From 7c6ba21048804b10968eb04c61268210fada2779 Mon Sep 17 00:00:00 2001
From: Colin Kuskie
Date: Mon, 16 Jul 2007 22:59:15 +0000
Subject: [PATCH] Help cleanup moves into the Macros. Macro help title will be
Macro Template Variables. Body tags in the help are now optional. To skip
the body tag, put in an empty string. Updated the Help and the tests to
cover that. Updated the Account Macro according to those rules.
---
lib/WebGUI/Help/Macro_a_account.pm | 2 +-
lib/WebGUI/Operation/Help.pm | 2 +-
lib/WebGUI/i18n/English/Macro_a_account.pm | 25 +---------------------
t/i18n/help.t | 2 +-
4 files changed, 4 insertions(+), 27 deletions(-)
diff --git a/lib/WebGUI/Help/Macro_a_account.pm b/lib/WebGUI/Help/Macro_a_account.pm
index c9f7fc65b..99a387e84 100644
--- a/lib/WebGUI/Help/Macro_a_account.pm
+++ b/lib/WebGUI/Help/Macro_a_account.pm
@@ -4,7 +4,7 @@ our $HELP = {
'account' => {
title => 'account title',
- body => 'account body',
+ body => '',
fields => [
],
variables => [
diff --git a/lib/WebGUI/Operation/Help.pm b/lib/WebGUI/Operation/Help.pm
index cbc6f3b48..afd04a6e3 100644
--- a/lib/WebGUI/Operation/Help.pm
+++ b/lib/WebGUI/Operation/Help.pm
@@ -313,7 +313,7 @@ sub www_viewHelp {
$vars{body} = $help->{body}->($session);
}
else {
- $vars{body} = $i18n->get($help->{body});
+ $vars{body} = $i18n->get($help->{body}) if $help->{body}; ##Body entry is optional
}
my $userUiLevel = $session->user->profileField("uiLevel");
my $uiOverride = $session->form->process("uiOverride");
diff --git a/lib/WebGUI/i18n/English/Macro_a_account.pm b/lib/WebGUI/i18n/English/Macro_a_account.pm
index f525b4181..ad0257db7 100644
--- a/lib/WebGUI/i18n/English/Macro_a_account.pm
+++ b/lib/WebGUI/i18n/English/Macro_a_account.pm
@@ -3,7 +3,7 @@ package WebGUI::i18n::English::Macro_a_account;
our $I18N = {
'account title' => {
- message => q|Account Macro|,
+ message => q|Account Macro Template Variables|,
lastUpdated => 1112466408,
},
@@ -17,29 +17,6 @@ our $I18N = {
lastUpdated => 1149177662,
},
- 'account body' => {
- message => q|
-
-^a();
-^a([link text], [template name]);
-This macro creates a link to the current user's account information. The
-Macro takes two optional arguments, the text that is displayed with the
-link and a template from the Macro/a_account namespace to be used to
-display the link and text. If the link text is set to the word
-"linkonly" then only the URL will be returned.
-
-NOTES:
-
-- The .myAccountLink style sheet class is tied to this macro.
-- This Macro may only be nested inside other Macros if the "linkonly" option is used.
-
-
-The following is a list of variables available in the template:
-
-|,
- lastUpdated => 1168558260,
- },
-
'46' => {
message => q|My Account|,
lastUpdated => 1031514049
diff --git a/t/i18n/help.t b/t/i18n/help.t
index 5bb49bf1d..e6d268b7b 100644
--- a/t/i18n/help.t
+++ b/t/i18n/help.t
@@ -91,7 +91,7 @@ sub getHelpLabels {
tag=>'body',
namespace=>$topic, ##default
label=>$helpTable{$topic}{$entry}{'body'},
- };
+ } if $helpTable{$topic}{$entry}{'body'};
}
##Add all labels in the fields array