From be4fd742762afe3a5036f7deb208f330fb824198 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 24 Nov 2006 04:01:52 +0000 Subject: [PATCH] WebGUI::Auth provides a set of default template variables inherited by both AuthWebGUI and AuthLDAP. I've pulled the defaults out of AuthWebGUI for one template (anonymous registration) into its own namspace, Auth. Default variables will be pulled out for all of the templates eventually. --- lib/WebGUI/Auth.pm | 2 +- lib/WebGUI/Help/Auth.pm | 57 +++++++++++++++++ lib/WebGUI/Help/AuthWebGUI.pm | 33 ++-------- lib/WebGUI/i18n/English/Auth.pm | 88 +++++++++++++++++++++++++++ lib/WebGUI/i18n/English/AuthWebGUI.pm | 40 ++---------- 5 files changed, 157 insertions(+), 63 deletions(-) create mode 100644 lib/WebGUI/Help/Auth.pm create mode 100644 lib/WebGUI/i18n/English/Auth.pm diff --git a/lib/WebGUI/Auth.pm b/lib/WebGUI/Auth.pm index 69695f833..f7270141f 100644 --- a/lib/WebGUI/Auth.pm +++ b/lib/WebGUI/Auth.pm @@ -195,7 +195,7 @@ sub createAccount { $vars->{$prefix.'formElement.label'} = $label; $vars->{$prefix.'required'} = $required; } - + $vars->{'create.form.submit'} = WebGUI::Form::submit($self->session,{}); $vars->{'create.form.footer'} = WebGUI::Form::formFooter($self->session,); diff --git a/lib/WebGUI/Help/Auth.pm b/lib/WebGUI/Help/Auth.pm new file mode 100644 index 000000000..523fd2b49 --- /dev/null +++ b/lib/WebGUI/Help/Auth.pm @@ -0,0 +1,57 @@ +package WebGUI::Help::Auth; + +our $HELP = { + 'anonymous registration template' => { + title => 'anon reg template title', + body => 'anon reg template body', + fields => [ + ], + variables => [ + { + 'name' => 'create.form.header' + }, + { + 'name' => 'create.form.footer' + }, + { + 'name' => 'create.form.submit' + }, + { + 'name' => 'title', + }, + { + 'name' => 'create.form.profile', + 'variables' => [ + { + 'name' => 'profile.formElement' + }, + { + 'name' => 'profile.formElement.label' + }, + { + 'name' => 'profile.required' + }, + ], + }, + { + 'name' => 'create.form.profile.id.formElement', + }, + { + 'name' => 'create.form.profile.id.formElement.label', + }, + { + 'name' => 'create.form.profile.id.required', + }, + { + 'name' => 'login.url', + }, + { + 'name' => 'login.label', + }, + ], + related => [ + ] + }, +}; + +1; diff --git a/lib/WebGUI/Help/AuthWebGUI.pm b/lib/WebGUI/Help/AuthWebGUI.pm index 2763109da..695dd3e8d 100644 --- a/lib/WebGUI/Help/AuthWebGUI.pm +++ b/lib/WebGUI/Help/AuthWebGUI.pm @@ -130,37 +130,16 @@ our $HELP = { body => 'anon reg template body', fields => [ ], + isa => [ + { + namespace => "Auth", + tag => "anonymous registration template" + }, + ], variables => [ - { - 'name' => 'create.form.header' - }, { 'name' => 'create.form.hidden' }, - { - 'name' => 'create.form.footer' - }, - { - 'name' => 'create.form.submit' - }, - { - 'name' => 'title', - }, - { - 'name' => 'create.form.profile' - }, - { - 'name' => 'profile.formElement' - }, - { - 'name' => 'profile.formElement.label' - }, - { - 'name' => 'login.url', - }, - { - 'name' => 'login.label', - }, { 'name' => 'create.message' }, diff --git a/lib/WebGUI/i18n/English/Auth.pm b/lib/WebGUI/i18n/English/Auth.pm new file mode 100644 index 000000000..cef195097 --- /dev/null +++ b/lib/WebGUI/i18n/English/Auth.pm @@ -0,0 +1,88 @@ +package WebGUI::i18n::English::Auth; + +our $I18N = { + + 'anon reg template title' => { + message => q|Anonymous Registration Template Variables|, + lastUpdated => 1078856626 + }, + + 'anon reg template body' => { + message => q|

The following template variables are available in all Anonymous Registration templates.

+|, + lastUpdated => 1164335958 + }, + + 'create.form.header' => { + message => q|The required form elements that go at the top of the anonymous registration page.|, + lastUpdated => 1149220721, + }, + + 'create.form.submit' => { + message => q|The default submit button for the anonymous registration form. |, + lastUpdated => 1149220721, + }, + + 'create.form.footer' => { + message => q|The required form elements that go after the anonymous registration page form. |, + lastUpdated => 1149220721, + }, + + 'title' => { + message => q|Default page title.|, + lastUpdated => 1164335682, + }, + + 'create.form.profile' => { + message => q|A loop containing visible and required profile fields for anonymous registration. These variables are also available outside of the loop, identified by id.|, + lastUpdated => 1164340521, + }, + + 'profile.formElement' => { + message => q|Form element for visible or required profile field.|, + lastUpdated => 1149220721, + }, + + 'profile.formElement.label' => { + message => q|Default text label for profile form element.|, + lastUpdated => 1149220721, + }, + + 'profile.required' => { + message => q|A boolean that will be true if the profile field is required.|, + lastUpdated => 1164335807, + }, + + 'create.form.profile.id.formElement' => { + message => q|Non-loop version of the form element for profile fields. Replace id with the actual profile id for the element.|, + lastUpdated => 1164340639, + }, + + 'create.form.profile.id.formElement.label' => { + message => q|Non-loop version of the default text label for profile form element. Replace id with the actual profile id for the element.|, + lastUpdated => 1164340641, + }, + + 'create.form.profile.id.required' => { + message => q|Non-loop version of the boolean that will be true if the profile field is required. Replace id with the actual profile id for the element.|, + lastUpdated => 1164340644, + }, + + 'login.url' => { + message => q|URL for the login page.|, + lastUpdated => 1149220395, + }, + + 'login.label' => { + message => q|Default text label for login page link.|, + lastUpdated => 1149220395, + }, + + 'topicName' => { + message => q|Authentication|, + lastUpdated => 1164338173, + }, + +}; + +1; diff --git a/lib/WebGUI/i18n/English/AuthWebGUI.pm b/lib/WebGUI/i18n/English/AuthWebGUI.pm index 9d53a15a2..4d6104e48 100644 --- a/lib/WebGUI/i18n/English/AuthWebGUI.pm +++ b/lib/WebGUI/i18n/English/AuthWebGUI.pm @@ -121,6 +121,11 @@ our $I18N = { lastUpdated => 1149220294, }, + 'title' => { + message => q|Default page title.|, + lastUpdated => 1164335682, + }, + 'login.form.footer' => { message => q|The required form elements that go after the login page form.|, lastUpdated => 1149220294, @@ -151,11 +156,6 @@ our $I18N = { lastUpdated => 1149220294, }, - 'title' => { - message => q|Default page title |, - lastUpdated => 1149220294, - }, - 'login.message' => { message => q|Any message returned by the system. Usually displays after the form is submitted.|, lastUpdated => 1149220294, @@ -469,41 +469,11 @@ our $I18N = { lastUpdated => 1149220652 }, - 'create.form.header' => { - message => q|The required form elements that go at the top of the anonymous registration page.|, - lastUpdated => 1149220721, - }, - 'create.form.hidden' => { message => q|Hidden form fields required for form submittal.|, lastUpdated => 1149220721, }, - 'create.form.footer' => { - message => q|The required form elements that go after the anonymous registration page form. |, - lastUpdated => 1149220721, - }, - - 'create.form.submit' => { - message => q|The default submit button for the anonymous registration form. |, - lastUpdated => 1149220721, - }, - - 'create.form.profile' => { - message => q|A loop containing visible and required profile fields for anonymous registration.|, - lastUpdated => 1149220721, - }, - - 'profile.formElement' => { - message => q|Form element for visible or required profile field.|, - lastUpdated => 1149220721, - }, - - 'profile.formElement.label' => { - message => q|Default text label for profile form element.|, - lastUpdated => 1149220721, - }, - 'create.message' => { message => q|Any message returned by the system. Usually displays after the form is submitted.|, lastUpdated => 1149220721,