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.
This commit is contained in:
Colin Kuskie 2006-11-24 04:01:52 +00:00
parent 61138b4764
commit be4fd74276
5 changed files with 157 additions and 63 deletions

View file

@ -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,);

57
lib/WebGUI/Help/Auth.pm Normal file
View file

@ -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;

View file

@ -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'
},

View file

@ -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|<p>The following template variables are available in all Anonymous Registration templates.</p>
|,
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;

View file

@ -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,