selectable templates for user profile view and edit
This commit is contained in:
parent
0b2283d198
commit
c7083c8177
6 changed files with 228 additions and 3 deletions
104
lib/WebGUI/Help/WebGUIProfile.pm
Normal file
104
lib/WebGUI/Help/WebGUIProfile.pm
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
package WebGUI::Help::WebGUIProfile;
|
||||
|
||||
use strict;
|
||||
|
||||
|
||||
our $HELP = {
|
||||
|
||||
'view profile template' => {
|
||||
title => 'view profile template title',
|
||||
body => 'view profile template body',
|
||||
fields => [],
|
||||
variables => [
|
||||
{
|
||||
name => 'displayTitle',
|
||||
},
|
||||
{
|
||||
name => 'profile.elements',
|
||||
required => 1,
|
||||
variables => [
|
||||
{
|
||||
name => 'profile.category',
|
||||
},
|
||||
{
|
||||
name => 'profile.label',
|
||||
},
|
||||
{
|
||||
name => 'profile.value',
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
name => 'profile.accountOptions',
|
||||
required => 1,
|
||||
variables => [
|
||||
{
|
||||
name => 'account.options',
|
||||
required => 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
related => [
|
||||
],
|
||||
},
|
||||
|
||||
'edit profile template' => {
|
||||
title => 'edit profile template title',
|
||||
body => 'edit profile template body',
|
||||
fields => [],
|
||||
variables => [
|
||||
{
|
||||
name => 'displayTitle',
|
||||
},
|
||||
{
|
||||
name => 'profile.message',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'profile.form.header',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'profile.form.footer',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'profile.form.hidden',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'profile.elements',
|
||||
required => 1,
|
||||
variables => [
|
||||
{
|
||||
name => 'profile.category',
|
||||
},
|
||||
{
|
||||
name => 'profile.label',
|
||||
},
|
||||
{
|
||||
name => 'profile.value',
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
name => 'profile.accountOptions',
|
||||
required => 1,
|
||||
variables => [
|
||||
{
|
||||
name => 'account.options',
|
||||
required => 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
related => [
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1; ##All perl modules must return true
|
||||
|
|
@ -50,6 +50,8 @@ This method is deprecated, and should not be used in new code. Use
|
|||
the getRequiredFields method from WebGUI::ProfileField and specify the
|
||||
translation to template variables directly instead.
|
||||
|
||||
NOTE: You should use the getRequiredFields method in WebGUI::ProfileField instead.
|
||||
|
||||
=head3 session
|
||||
|
||||
The current WebGUI session object.
|
||||
|
|
@ -230,7 +232,7 @@ sub www_editProfile {
|
|||
$vars->{'profile.form.elements'} = \@array;
|
||||
$vars->{'profile.form.submit'} = WebGUI::Form::submit($session,{});
|
||||
$vars->{'profile.accountOptions'} = WebGUI::Operation::Shared::accountOptions($session);
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,"PBtmpl0000000000000051")->process($vars));
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session, $session->setting->get('editUserProfileTemplate'))->process($vars));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -319,7 +321,7 @@ sub www_viewProfile {
|
|||
};
|
||||
}
|
||||
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,"PBtmpl0000000000000052")->process($vars));
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session, $session->setting->get('viewUserProfileTemplate'))->process($vars));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -480,6 +480,22 @@ sub definition {
|
|||
fieldType => 'HTMLArea',
|
||||
label => $i18n->get( 'showMessageOnLoginBody label' ),
|
||||
hoverHelp => $i18n->get( 'showMessageOnLoginBody description' ),
|
||||
};
|
||||
push @fields, {
|
||||
tab => "user",
|
||||
name => 'viewUserProfileTemplate',
|
||||
fieldType => 'Template',
|
||||
namespace => 'Operation/Profile/View',
|
||||
label => $i18n->get( 'user profile view template' ),
|
||||
hoverHelp => $i18n->get( 'user profile view template description' ),
|
||||
};
|
||||
push @fields, {
|
||||
tab => "user",
|
||||
name => 'editUserProfileTemplate',
|
||||
fieldType => 'Template',
|
||||
namespace => 'Operation/Profile/Edit',
|
||||
label => $i18n->get( 'user profile edit template' ),
|
||||
hoverHelp => $i18n->get( 'user profile edit template description' ),
|
||||
};
|
||||
# auth settings
|
||||
my $options;
|
||||
|
|
|
|||
|
|
@ -3520,6 +3520,26 @@ LongTruncOk=1</p>
|
|||
lastUpdated => 1181969398,
|
||||
},
|
||||
|
||||
'user profile view template' => {
|
||||
message => q|User Profile Viewing Template|,
|
||||
lastUpdated => 1213323171,
|
||||
},
|
||||
|
||||
'user profile view template description' => {
|
||||
message => q|The template used show the user their user profile.|,
|
||||
lastUpdated => 1213323173,
|
||||
},
|
||||
|
||||
'user profile edit template' => {
|
||||
message => q|User Profile Editing Template|,
|
||||
lastUpdated => 1213323171,
|
||||
},
|
||||
|
||||
'user profile edit template description' => {
|
||||
message => q|The template used show to build a form so the user can edit their template.|,
|
||||
lastUpdated => 1213323173,
|
||||
},
|
||||
|
||||
'send private message' => {
|
||||
message => q|Send Private Message|,
|
||||
lastUpdated => 1181019679,
|
||||
|
|
|
|||
|
|
@ -260,7 +260,83 @@ If you wish to set the Default Value for any other field. Create the field with
|
|||
'requiredForPasswordRecovery hoverHelp' => {
|
||||
message => "Require users to enter this field for password recovery. Only users that enter all such fields correctly and uniquely to them will be able to perform password recovery.",
|
||||
lastUpdated => 1165401097
|
||||
},
|
||||
},
|
||||
|
||||
'view profile template title' => {
|
||||
message => 'View Profile Template',
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'view profile template body' => {
|
||||
message => 'This template is used to show the user their User Profile.',
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'displayTitle' => {
|
||||
message => q|An internationalized title containing the user's name.|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.elements' => {
|
||||
message => q|A loop containing all profile field elements.|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.category' => {
|
||||
message => q|The name of the current category. This variable will only exist for the first profile field in each category.|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.label' => {
|
||||
message => q|The label for this profile field.|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.value' => {
|
||||
message => q|The value of this profile field.|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.accountOptions' => {
|
||||
message => q|A loop containing options for other account actions, such as editing a profile, viewing a profile, changing your account, and so on.|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'account.options' => {
|
||||
message => q|A link to an account option with label.|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'edit profile template title' => {
|
||||
message => 'Edit Profile Template',
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'edit profile template body' => {
|
||||
message => 'This template builds a form for the user to edit their User Profile.',
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.message' => {
|
||||
message => |Messages from the system, in case of errors or further work on the user's part.|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.form.header' => {
|
||||
message => |HTML code to begin the form|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.form.footer' => {
|
||||
message => |HTML code to end the form|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
'profile.form.hidden' => {
|
||||
message => |HTML code for directing the form's action|,
|
||||
lastUpdated => 1213326336,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue