{'message_body'} =~ s/\n/\ {'message_body'} =~ s/\n/\ %s ',
- sprintf($i18n->get('add to friends description'),
- $protoFriend->getWholeName),
- ' %s %s %s %s %s ',
- sprintf($i18n->get('friend request description'),
- $inviter->getWholeName),
- ' %s %s %s %s %s %s %s %s {message} =~ s/\n/\
\n/g;
+ }
+
+ #Build the action URLs
+ my $nextInvitation = $friends->getPreviousInvitation($invitation); #Messages sorted descending so next is actually previous
+ if( $nextInvitation->{inviteId} ) {
+ $var->{'hasNext' } = "true";
+ $var->{'next_message_url'} = $self->getUrl("module=inbox;do=viewInvitation;inviteId=".$nextInvitation->{inviteId});
+ }
+
+ my $prevInvitation = $friends->getNextInvitation($invitation); #Messages sorted descending so previous is actually next
+ if( $prevInvitation->{inviteId} ) {
+ $var->{'hasPrevious' } = "true";
+ $var->{'prev_message_url'} = $self->getUrl("module=inbox;do=viewInvitation;inviteId=".$prevInvitation->{inviteId});
+ }
+
+ $var->{'form_header' } = WebGUI::Form::formHeader($session,{
+ action => $self->getUrl("module=inbox;do=approveDenyInvitations;inviteId=".$inviteId)
+ });
+ $var->{'form_footer' } = WebGUI::Form::formFooter($session);
+
+ $var->{'form_accept' } = WebGUI::Form::submit($session,{
+ name =>"accept",
+ value =>$i18n->get("accept button label")
+ });
+
+ $var->{'form_deny' } = WebGUI::Form::submit($session,{
+ name =>"deny",
+ value =>$i18n->get("deny button label")
+ });
+
+ return $self->processTemplate($var,$self->getViewInvitationTemplateId);
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_viewMessage ( )
+
+The page on which users view their messages
+
+=cut
+
+sub www_viewMessage {
+ my $self = shift;
+ my $session = $self->session;
+ my $user = $session->user;
+
+ my $var = {};
+ my $messageId = shift || $session->form->get("messageId");
+ my $errorMsg = shift;
+
+ my $inbox = WebGUI::Inbox->new($session);
+ my $message = $inbox->getMessage($messageId);
+
+ #Add common template variable for displaying the inbox
+ $self->appendCommonVars($var,$inbox);
+
+ #Handler Errors
+ if (!(defined $message)) {
+ my $i18n = WebGUI::International->new($session,'Account_Inbox');
+ $errorMsg = $i18n->get("message does not exist");
+ }
+ elsif (!$inbox->canRead($message)) {
+ my $i18n = WebGUI::International->new($session,'Account_Inbox');
+ $errorMsg = $i18n->get("no access");
+ }
+
+ if($errorMsg) {
+ my $backUrl = $var->{'view_inbox_url'};
+ $var->{'isInvitation'} = "true";
+ return $self->showError($var,$errorMsg,$backUrl,$self->getInboxErrorTemplateId);
+ }
+
+ $message->setStatus("read") unless ($message->isRead);
+
+ $var->{'message_id' } = $messageId;
+ $var->{'message_subject' } = $message->get("subject");
+ $var->{'message_dateStamp' } = $message->get("dateStamp");
+ $var->{'message_dateStamp_human'} = $session->datetime->epochToHuman($var->{'message_dateStamp'});
+ $var->{'message_status' } = $message->getStatus;
+ $var->{'message_body' } = $message->get("message");
+
+ unless ($var->{'message_body'} =~ /\{'message_body'} =~ s/(http\S*)/\$1\<\/a\>/g;
+ }
+ unless ($var->{'message_body'} =~ /\
{'message_body'} =~ /\
\n/g;
+ }
+
+ #Get the user the message was sent by
+ my $sentBy = $message->get("sentBy");
+ my $from = WebGUI::User->new($session,$sentBy);
+ my $sentByVisitor = 0;
+ if ($from->isVisitor) {
+ $sentByVisitor = 1;
+ $from = WebGUI::User->new($session,3);
+ }
+ $var->{'message_from_id' } = $from->userId;
+ $var->{'message_from' } = $from->getWholeName;
+
+ #Build the action URLs
+ $var->{'delete_url' } = $self->getUrl("module=inbox;do=deleteMessage;messageId=".$messageId);
+
+ my $status = $message->get("status");
+ if($sentBy ne $user->userId
+ && !$sentByVisitor
+ && $status ne "pending"
+ && $status ne "completed" ) {
+ $var->{'canReply' } = "true";
+ $var->{'reply_url'} = $self->getUrl("module=inbox;do=sendMessage;messageId=".$messageId);
+ }
+
+ my $nextMessage = $inbox->getPreviousMessage($message); #Message are displayed in descending order so next is actually previous
+ if( defined $nextMessage ) {
+ $var->{'hasNext' } = "true";
+ $var->{'next_message_url'} = $self->getUrl("module=inbox;do=viewMessage;messageId=".$nextMessage->getId);
+ }
+
+ my $prevMessage = $inbox->getNextMessage($message); #Messages are displayed in descending order so previous is actually next
+ if(defined $prevMessage) {
+ $var->{'hasPrevious' } = "true";
+ $var->{'prev_message_url'} = $self->getUrl("module=inbox;do=viewMessage;messageId=".$prevMessage->getId);
+ }
+
+ return $self->processTemplate($var,$self->getViewMessageTemplateId);
+}
+
+
+1;
diff --git a/lib/WebGUI/Account/Profile.pm b/lib/WebGUI/Account/Profile.pm
new file mode 100644
index 000000000..ba14b5670
--- /dev/null
+++ b/lib/WebGUI/Account/Profile.pm
@@ -0,0 +1,491 @@
+package WebGUI::Account::Profile;
+
+use strict;
+
+use WebGUI::Exception;
+use WebGUI::International;
+use WebGUI::Pluggable;
+use WebGUI::ProfileCategory;
+use WebGUI::ProfileField;
+use WebGUI::Utility;
+use base qw/WebGUI::Account/;
+
+=head1 NAME
+
+Package WebGUI::Account::Profile
+
+=head1 DESCRIPTION
+
+This is the class which is used to display a users's profile information
+
+=head1 SYNOPSIS
+
+ use WebGUI::Account::Profile;
+
+=head1 METHODS
+
+These subroutines are available from this package:
+
+=cut
+
+#-------------------------------------------------------------------
+
+=head2 appendCommonVars ( var )
+
+ Appends common template variables that all profile templates use
+
+=head3 var
+
+ The hash reference to append template variables to
+
+=cut
+
+sub appendCommonVars {
+ my $self = shift;
+ my $var = shift;
+ my $session = $self->session;
+ my $user = $session->user;
+ my $pageUrl = $session->url->page;
+
+ $var->{'user_full_name' } = $user->getWholeName;
+ $var->{'user_member_since' } = $user->dateCreated;
+ $var->{'view_profile_url' } = $user->getProfileUrl($pageUrl);
+ $var->{'edit_profile_url' } = $self->getUrl("module=profile;do=edit");
+ $var->{'back_url' } = $session->env->get("HTTP_REFERER") || $var->{'view_profile_url'};
+ $var->{'invitations_enabled' } = $session->user->profileField('ableToBeFriend');
+}
+
+#-------------------------------------------------------------------
+
+=head2 editSettingsForm ( )
+
+ Creates form elements for user settings page custom to this account module
+
+=cut
+
+sub editSettingsForm {
+ my $self = shift;
+ my $session = $self->session;
+ my $setting = $session->setting;
+ my $i18n = WebGUI::International->new($session,'Account_Profile');
+ my $f = WebGUI::HTMLForm->new($session);
+
+ $f->template(
+ name => "profileStyleTemplateId",
+ value => $self->getStyleTemplateId,
+ namespace => "style",
+ label => $i18n->get("profile style template label"),
+ hoverHelp => $i18n->get("profile style template hoverHelp")
+ );
+ $f->template(
+ name => "profileLayoutTemplateId",
+ value => $self->getLayoutTemplateId,
+ namespace => "Account/Layout",
+ label => $i18n->get("profile layout template label"),
+ hoverHelp => $i18n->get("profile layout template hoverHelp")
+ );
+ $f->template(
+ name => "profileEditLayoutTemplateId",
+ value => $self->getEditLayoutTemplateId,
+ namespace => "Account/Layout",
+ label => $i18n->get("profile edit layout template label"),
+ hoverHelp => $i18n->get("profile edit layout template hoverHelp")
+ );
+ $f->template(
+ name => "profileEditTemplateId",
+ value => $self->getEditTemplateId,
+ namespace => "Account/Profile/Edit",
+ label => $i18n->get("profile edit template label"),
+ hoverHelp => $i18n->get("profile edit template hoverHelp")
+ );
+ $f->template(
+ name => "profileViewTemplateId",
+ value => $self->getViewTemplateId,
+ namespace => "Account/Profile/View",
+ label => $i18n->get("profile view template label"),
+ hoverHelp => $i18n->get("profile view template hoverHelp")
+ );
+ $f->template(
+ name => "profileErrorTemplateId",
+ value => $self->getErrorTemplateId,
+ namespace => "Account/Profile/Error",
+ label => $i18n->get("profile error template label"),
+ hoverHelp => $i18n->get("profile error template hoverHelp")
+ );
+
+
+ return $f->printRowsOnly;
+}
+
+
+#-------------------------------------------------------------------
+
+=head2 editSettingsFormSave ( )
+
+ Creates form elements for user settings page custom to this account module
+
+=cut
+
+sub editSettingsFormSave {
+ my $self = shift;
+ my $session = $self->session;
+ my $setting = $session->setting;
+ my $form = $session->form;
+
+ $setting->set("profileStyleTemplateId", $form->process("profileStyleTemplateId","template"));
+ $setting->set("profileLayoutTemplateId", $form->process("profileLayoutTemplateId","template"));
+ $setting->set("profileDisplayLayoutTemplateId", $form->process("profileDisplayLayoutTemplateId","template"));
+ $setting->set("profileEditTemplateId", $form->process("profileEditTemplateId","template"));
+ $setting->set("profileViewTempalteId", $form->process("profileViewTemplateId","template"));
+ $setting->set("profileErrorTemplateId",$form->process("profileErrorTemplateId","template"));
+
+}
+
+#-------------------------------------------------------------------
+
+=head2 getExtrasStyle ( field, fieldErrors, fieldValue )
+
+This method returns the proper field to display for required fields.
+
+=head3 field
+
+field to check
+
+=head3 fieldErrors
+
+errors returned as a result of validation (see $self->validateProfileFields)
+
+=head3 fieldValue
+
+Value of the field to use when returning the style
+
+=cut
+
+sub getExtrasStyle {
+ my $self = shift;
+ my $field = shift;
+ my $fieldErrors = shift;
+ my $fieldValue = shift;
+
+ my $requiredStyleOff = q{class="profilefield_required_off"};
+ my $requiredStyle = q{class="profilefield_required"};
+ my $errorStyle = q{class="profilefield_error"}; #Required Field Not Filled In and Error Returend
+
+ return $errorStyle if(WebGUI::Utility::isIn($field->getId,@{$fieldErrors}));
+ return "" unless ($field->isRequired);
+ return $requiredStyle unless($self->session->user->profileField($field->getId) || $fieldValue);
+ return $requiredStyleOff;
+}
+
+
+#-------------------------------------------------------------------
+
+=head2 getDisplayLayoutTemplateId ( )
+
+This method returns the template ID for the account layout.
+
+=cut
+
+sub getEditLayoutTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("profileEditLayoutTemplateId") || "FJbUTvZ2nUTn65LpW6gjsA";
+}
+
+#-------------------------------------------------------------------
+
+=head2 getEditTemplateId ( )
+
+This method returns the template ID for the edit profile page.
+
+=cut
+
+sub getEditTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("profileEditTemplateId") || "75CmQgpcCSkdsL-oawdn3Q";
+}
+
+#-------------------------------------------------------------------
+
+=head2 getErrorTemplateId ( )
+
+This method returns the template ID used to display the error page.
+
+=cut
+
+sub getErrorTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("profileErrorTemplateId") || "MBmWlA_YEA2I6D29OMGtRg";
+}
+
+
+#-------------------------------------------------------------------
+
+=head2 getLayoutTemplateId ( )
+
+This method returns the template ID for the account layout.
+
+=cut
+
+sub getLayoutTemplateId {
+ my $self = shift;
+ my $session = $self->session;
+ my $method = $self->method;
+ my $uid = $self->uid;
+
+ return $self->getEditLayoutTemplateId if($method eq "edit" || $uid eq "");
+ return $session->setting->get("profileLayoutTemplateId") || $self->SUPER::getLayoutTemplateId;
+}
+
+#-------------------------------------------------------------------
+
+=head2 getStyleTemplateId ( )
+
+This method returns the template ID for the main style.
+
+=cut
+
+sub getStyleTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("profileStyleTemplateId") || $self->SUPER::getStyleTemplateId;
+}
+
+#-------------------------------------------------------------------
+
+=head2 getViewTemplateId ( )
+
+This method returns the template ID for the view profile page.
+
+=cut
+
+sub getViewTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("profileViewTemplateId") || "2CS-BErrjMmESOtGT90qOg";
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_edit ( )
+
+The edit page for the user's profile.
+
+=cut
+
+sub www_edit {
+ my $self = shift;
+ my $errors = shift || {};
+ my $session = $self->session;
+ my $user = $session->user;
+ my $selected = $errors->{errorCategory} || $session->form->get("selected"); #Allow users to template tabs or other category dividers
+ my $var = {};
+
+ my $active = 0; #Whether or not a category is selected
+ my $counter = 1; #Count the number of categories being displayed
+ my $hasErrors = scalar(keys %{$errors});
+
+ my @errorFields = ();
+ @errorFields = (@{$errors->{errorFields}},@{$errors->{warningFields}}) if($hasErrors);
+
+ $var->{'profile_errors' } = [];
+ map{ push(@{$var->{'profile_errors'}},{ error_message => $_ }) } @{$errors->{errors}} if($hasErrors);
+ $var->{'hasErrors' } = scalar(@{$var->{'profile_errors'}}) > 0;
+
+ my @categories = ();
+ foreach my $category (@{WebGUI::ProfileCategory->getCategories($session)}) {
+ next unless $category->isEditable;
+ my @fields = ();
+ foreach my $field (@{$category->getFields}) {
+ next unless ($field->isEditable);
+ next if $field->getId =~ m/contentPositions/; #This protects the contentPosition fields
+ my $fieldId = $field->getId;
+ my $fieldLabel = $field->getLabel;
+ my $fieldForm = $field->formField({ extras=>$self->getExtrasStyle($field,\@errorFields,$user->profileField($fieldId)) });
+ my $fieldSubtext = $field->isRequired ? "*" : undef;
+ my $fieldExtras = $field->getExtras;
+ #Create a seperate template var for each field
+ $var->{'profile_field_'.$fieldId.'_form' } = $fieldForm;
+ $var->{'profile_field_'.$fieldId.'_label' } = $fieldLabel;
+ $var->{'profile_field_'.$fieldId.'_subtext'} = $fieldSubtext;
+ $var->{'profile_field_'.$fieldId.'_extras' } = $fieldExtras;
+
+ push(@fields, {
+ 'profile_field_id' => $fieldId,
+ 'profile_field_form' => $fieldForm,
+ 'profile_field_label' => $fieldLabel,
+ 'profile_field_subtext' => $field->isRequired ? "*" : undef,
+ 'profile_field_extras' => $field->getExtras,
+ });
+ }
+ my $categoryId = $category->getId;
+ my $categoryLabel = $category->getLabel;
+ my $shortCategoryLabel = $category->getShortLabel;
+ my $isActive = $categoryId eq $selected;
+ my $categoryIndex = $counter++;
+
+ $var->{'profile_category_'.$categoryId."_isActive" } = $isActive;
+ $var->{'profile_category_'.$categoryId."_label" } = $categoryLabel;
+ $var->{'profile_category_'.$categoryId."_shortLabel"} = $shortCategoryLabel;
+ $var->{'profile_category_'.$categoryId."_fields" } = \@fields;
+ $var->{'profile_category_'.$categoryId."_index" } = $categoryIndex;
+
+ push(@categories, {
+ 'profile_category_id' => $categoryId,
+ 'profile_category_isActive' => $isActive,
+ 'profile_category_is_'.$categoryId => "true", #Test so users can tell what category they are at in the loop
+ 'profile_category_label' => $categoryLabel,
+ 'profile_category_shortLabel' => $shortCategoryLabel,
+ 'profile_category_index' => $categoryIndex,
+ 'profile_fields_loop' => \@fields,
+ 'profile_errors' => $var->{'profile_errors'},
+ });
+ #This value will determine whether or not a valid category is active or not
+ $active ||= $isActive;
+ }
+
+ #If not category is selected, set the first category as the active one
+ $categories[0]->{profile_category_isActive} = 1 unless($active);
+
+ $var->{'profile_category_loop'} = \@categories;
+
+ $var->{'profile_form_submit' } = WebGUI::Form::submit($session,{});
+ $var->{'profile_form_header' } = WebGUI::Form::formHeader($session,{
+ action => $self->getUrl("module=profile;do=editSave")
+ });
+ $var->{'profile_form_footer' } = WebGUI::Form::formFooter($session);
+
+ $self->appendCommonVars($var);
+
+ return $self->processTemplate($var,$self->getEditTemplateId);
+}
+
+
+#-------------------------------------------------------------------
+
+=head2 www_editSave ( )
+
+The page which saves the user's profile and returns them to their profile view.
+
+=cut
+
+sub www_editSave {
+ my $self = shift;
+ my $session = $self->session;
+
+ my $fields = WebGUI::ProfileField->getEditableFields($session);
+ my $retHash = $session->user->validateProfileDataFromForm($fields);
+ push (@{$retHash->{errors}},@{$retHash->{warnings}});
+
+ unless(scalar(@{$retHash->{errors}})) {
+ foreach my $fieldName (keys %{$retHash->{profile}}) {
+ $session->user->profileField($fieldName,$retHash->{profile}->{$fieldName});
+ }
+ }
+
+ return $self->www_edit($retHash);
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_view ( )
+
+The display page of the .
+
+=cut
+
+sub www_view {
+ my $self = shift;
+ my $session = $self->session;
+ my $var = {};
+ my $uid = $self->uid;
+ my $selected = $session->form->get("selected"); #Allow users to template tabs or other category dividers
+
+ my $active = 0; #Whether or not a category is selected
+ my $counter = 1; #Count the number of categories being displayed
+
+ #Ensure uid is passed in if they want to view a profile. This controls the tab state.
+ return $self->www_edit unless ($uid);
+
+ my $user = WebGUI::User->new($session,$uid);
+
+ $self->appendCommonVars($var);
+
+ #Overwrite these
+ $var->{'user_full_name' } = $user->getWholeName;
+ $var->{'user_member_since' } = $user->dateCreated;
+
+ #Check user privileges
+ unless ($user->profileIsViewable($session->user)) {
+ my $i18n = WebGUI::International->new($session,'Account_Profile');
+ return $self->showError(
+ $var,
+ $i18n->get("profile not public error"),
+ $var->{'back_url'},
+ $self->getErrorTemplateId
+ );
+ }
+
+ my @categories = ();
+ foreach my $category (@{WebGUI::ProfileCategory->getCategories($session)}) {
+ next unless $category->isViewable;
+ my @fields = ();
+ foreach my $field (@{$category->getFields}) {
+ next unless ($field->isViewable);
+ next if $field->getId =~ m/contentPositions/; #This protects the contentPosition fields
+ my $fieldId = $field->getId;
+ my $fieldLabel = $field->getLabel;
+ my $fieldValue = $field->formField(undef,2,$user);
+ my $fieldRaw = $user->profileField($fieldId);;
+ #Create a seperate template var for each field
+ $var->{'profile_field_'.$fieldId.'_label' } = $fieldLabel;
+ $var->{'profile_field_'.$fieldId.'_value' } = $fieldValue;
+ $var->{'profile_field_'.$fieldId.'_raw' } = $fieldRaw;
+
+ push(@fields, {
+ 'profile_field_id' => $fieldId,
+ 'profile_field_is_'.$fieldId => "true",
+ 'profile_field_label' => $fieldLabel,
+ 'profile_field_value' => $fieldValue,
+ 'profile_field_raw' => $fieldRaw
+ });
+ }
+ my $categoryId = $category->getId;
+ my $categoryLabel = $category->getLabel;
+ my $shortCategoryLabel = $category->getShortLabel;
+ my $isActive = $categoryId eq $selected;
+ my $categoryIndex = $counter++;
+
+ $var->{'profile_category_'.$categoryId."_isActive" } = $isActive;
+ $var->{'profile_category_'.$categoryId."_label" } = $categoryLabel;
+ $var->{'profile_category_'.$categoryId."_shortLabel"} = $shortCategoryLabel;
+ $var->{'profile_category_'.$categoryId."_fields" } = \@fields;
+ $var->{'profile_category_'.$categoryId."_index" } = $categoryIndex;
+
+ push(@categories, {
+ 'profile_category_id' => $categoryId,
+ 'profile_category_isActive' => $isActive,
+ 'profile_category_is_'.$categoryId => "true",
+ 'profile_category_label' => $categoryLabel,
+ 'profile_category_shortLabel' => $shortCategoryLabel,
+ 'profile_category_index' => $categoryIndex,
+ 'profile_fields_loop' => \@fields,
+ });
+ #This value will determine whether or not a valid category is active or not
+ $active ||= $isActive;
+ }
+
+ #If not category is selected, set the first category as the active one
+ $categories[0]->{profile_category_isActive} = 1 unless($active);
+ my $privacySetting = $user->profileField("publicProfile") || "none";
+ $var->{'profile_privacy_'.$privacySetting } = "true";
+
+ $var->{'profile_category_loop' } = \@categories;
+ $var->{'profile_user_id' } = $user->userId;
+ $var->{'can_edit_profile' } = $uid eq $session->user->userId;
+ $var->{'acceptsPrivateMessages'} = $user->acceptsPrivateMessages($session->user->userId);
+ $var->{'acceptsFriendsRequests'} = $user->acceptsFriendsRequests($session->user);
+
+ return $self->processTemplate($var,$self->getViewTemplateId);
+}
+
+
+
+1;
diff --git a/lib/WebGUI/Account/Shop.pm b/lib/WebGUI/Account/Shop.pm
new file mode 100644
index 000000000..1eb720fbe
--- /dev/null
+++ b/lib/WebGUI/Account/Shop.pm
@@ -0,0 +1,297 @@
+package WebGUI::Account::Shop;
+
+use strict;
+
+use WebGUI::Exception;
+use WebGUI::International;
+use WebGUI::Pluggable;
+use WebGUI::Utility;
+use base qw/WebGUI::Account/;
+
+=head1 NAME
+
+Package WebGUI::Account::Shop
+
+=head1 DESCRIPTION
+
+Shop Features built into the Account system
+
+=head1 SYNOPSIS
+
+use WebGUI::Account::Shop;
+
+=head1 METHODS
+
+These methods are available from this class:
+
+=cut
+
+#-------------------------------------------------------------------
+
+=head2 appendCommonVars ( var )
+
+ Appends common template variables that shop templates will use
+
+=head3 var
+
+ The hash reference to append template variables to
+
+=cut
+
+sub appendCommonVars {
+ my $self = shift;
+ my $var = shift;
+
+ $self->SUPER::appendCommonVars($var);
+
+ my $session = $self->session;
+ my $user = $session->user;
+ my $method = $session->form->get("do");
+
+ $var->{'manage_purchases_url' } = $self->getUrl("module=shop;do=managePurchases");
+ $var->{'managesPurchasesIsActive'} = WebGUI::Utility::isIn($method,("","managePurchases","view","viewTransaction"));
+}
+
+#-------------------------------------------------------------------
+
+=head2 canView ( )
+
+ Returns whether or not the user can view the the tab for this module
+
+=cut
+
+sub canView {
+ my $self = shift;
+ return ($self->uid eq "");
+}
+
+#-------------------------------------------------------------------
+
+=head2 editSettingsForm ( )
+
+ Creates form elements for user settings page custom to this account module
+
+=cut
+
+sub editSettingsForm {
+ my $self = shift;
+ my $session = $self->session;
+ my $i18n = WebGUI::International->new($session,'Account_Shop');
+ my $shopi18n = WebGUI::International->new($session,'Shop');
+ my $f = WebGUI::HTMLForm->new($session);
+
+ $f->template(
+ name => "shopStyleTemplateId",
+ value => $self->getStyleTemplateId,
+ namespace => "style",
+ label => $i18n->get("shop style template label"),
+ hoverHelp => $i18n->get("shop style template hoverHelp")
+ );
+ $f->template(
+ name => "shopLayoutTemplateId",
+ value => $self->getLayoutTemplateId,
+ namespace => "Account/Layout",
+ label => $i18n->get("shop layout template label"),
+ hoverHelp => $i18n->get("shop layout template hoverHelp")
+ );
+ $f->template(
+ name => "shopMyPurchasesTemplateId",
+ value => $self->session->setting->get("shopMyPurchasesTemplateId"),
+ namespace => "Shop/MyPurchases",
+ label => $shopi18n->get("my purchases template"),
+ hoverHelp => $shopi18n->get("my purchases template help")
+ );
+ $f->template(
+ name => "shopMyPurchasesDetailTemplateId",
+ value => $self->session->setting->get("shopMyPurchasesDetailTemplateId"),
+ namespace => "Shop/MyPurchasesDetail",
+ label => $shopi18n->get("my purchases detail template"),
+ hoverHelp => $shopi18n->get("my purchases detail template help")
+ );
+
+ return $f->printRowsOnly;
+}
+
+#-------------------------------------------------------------------
+
+=head2 editSettingsFormSave ( )
+
+ Creates form elements for the settings page custom to this account module
+
+=cut
+
+sub editSettingsFormSave {
+ my $self = shift;
+ my $session = $self->session;
+ my $setting = $session->setting;
+ my $form = $session->form;
+
+ $setting->set("shopStyleTemplateId", $form->process("shopStyleTemplateId","template"));
+ $setting->set("shopLayoutTemplateId", $form->process("shopLayoutTemplateId","template"));
+ $setting->set("shopMyPurchasesTemplateId", $form->process("shopMyPurchasesTemplateId","template"));
+ $setting->set("shopMyPurchasesDetailTemplateId", $form->process("shopMyPurchasesDetailTemplateId","template"));
+}
+
+#-------------------------------------------------------------------
+
+=head2 getLayoutTemplateId ( )
+
+This method returns the templateId for the layout of your new module.
+
+=cut
+
+sub getLayoutTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("shopLayoutTemplateId") || "aUDsJ-vB9RgP-AYvPOy8FQ";
+}
+
+
+#-------------------------------------------------------------------
+
+=head2 getStyleTemplateId ( )
+
+This method returns the template ID for the main style.
+
+=cut
+
+sub getStyleTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("shopStyleTemplateId") || $self->SUPER::getStyleTemplateId;
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_managePurchases ( )
+
+The main view page for editing the user's profile.
+
+=cut
+
+sub www_managePurchases {
+ my $self = shift;
+ my $session = $self->session;
+ my $url = $session->url;
+
+ my $var = {};
+
+ # build list
+ foreach my $id (@{WebGUI::Shop::Transaction->getTransactionIdsForUser($session)}) {
+ my $transaction = WebGUI::Shop::Transaction->new($session, $id);
+ push @{$var->{transactions}}, {
+ %{$transaction->get},
+ viewDetailUrl => $self->getUrl('op=account;module=shop;do=viewTransaction;transactionId='.$id),
+ amount => sprintf("%.2f", $transaction->get('amount')),
+ };
+ }
+
+ $self->appendCommonVars($var);
+
+ return $self->processTemplate($var,$session->setting->get("shopMyPurchasesTemplateId"));
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_view ( )
+
+The main view page for editing the user's profile.
+
+=cut
+
+sub www_view {
+ my $self = shift;
+
+ #Use the view class as the driver for now. This will likely grow
+ return $self->www_managePurchases();
+
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_viewTransaction ( )
+
+The main view page for editing the user's profile.
+
+=cut
+
+sub www_viewTransaction {
+ my $self = shift;
+ my $session = $self->session;
+
+ my $transactionId = $session->form->get('transactionId');
+ my $transaction = shift || WebGUI::Shop::Transaction->new($session,$transactionId);
+ my $notice = shift;
+
+ return $session->insufficient unless ($transaction->get('userId') eq $session->user->userId);
+
+ my $i18n = WebGUI::International->new($session, 'Shop');
+ my $i18n = WebGUI::International->new($session, 'Shop');
+ my ($style, $url) = $session->quick(qw(style url));
+
+ my %var = (
+ %{$transaction->get},
+ notice => $notice,
+ cancelRecurringUrl => $url->page('shop=transaction;method=cancelRecurring;transactionId='.$transaction->getId),
+ amount => sprintf("%.2f", $transaction->get('amount')),
+ inShopCreditDeduction => sprintf("%.2f", $transaction->get('inShopCreditDeduction')),
+ taxes => sprintf("%.2f", $transaction->get('taxes')),
+ shippingPrice => sprintf("%.2f", $transaction->get('shippingPrice')),
+ shippingAddress => $transaction->formatAddress({
+ name => $transaction->get('shippingAddressName'),
+ address1 => $transaction->get('shippingAddress1'),
+ address2 => $transaction->get('shippingAddress2'),
+ address3 => $transaction->get('shippingAddress3'),
+ city => $transaction->get('shippingCity'),
+ state => $transaction->get('shippingState'),
+ code => $transaction->get('shippingCode'),
+ country => $transaction->get('shippingCountry'),
+ phoneNumber => $transaction->get('shippingPhoneNumber'),
+ }),
+ paymentAddress => $transaction->formatAddress({
+ name => $transaction->get('paymentAddressName'),
+ address1 => $transaction->get('paymentAddress1'),
+ address2 => $transaction->get('paymentAddress2'),
+ address3 => $transaction->get('paymentAddress3'),
+ city => $transaction->get('paymentCity'),
+ state => $transaction->get('paymentState'),
+ code => $transaction->get('paymentCode'),
+ country => $transaction->get('paymentCountry'),
+ phoneNumber => $transaction->get('paymentPhoneNumber'),
+ }),
+ );
+
+ # items
+ my @items = ();
+ foreach my $item (@{$transaction->getItems}) {
+ my $address = '';
+ if ($transaction->get('shippingAddressId') ne $item->get('shippingAddressId')) {
+ $address = $transaction->formatAddress({
+ name => $item->get('shippingAddressName'),
+ address1 => $item->get('shippingAddress1'),
+ address2 => $item->get('shippingAddress2'),
+ address3 => $item->get('shippingAddress3'),
+ city => $item->get('shippingCity'),
+ state => $item->get('shippingState'),
+ code => $item->get('shippingCode'),
+ country => $item->get('shippingCountry'),
+ phoneNumber => $item->get('shippingPhoneNumber'),
+ });
+ }
+ push @items, {
+ %{$item->get},
+ viewItemUrl => $url->page('shop=transaction;method=viewItem;transactionId='.$transaction->getId.';itemId='.$item->getId),
+ price => sprintf("%.2f", $item->get('price')),
+ itemShippingAddress => $address,
+ orderStatus => $i18n->get($item->get('orderStatus')),
+ };
+ }
+ $var{items} = \@items;
+
+ $self->appendCommonVars(\%var);
+
+ # render
+ return $self->processTemplate(\%var,$session->setting->get("shopMyPurchasesDetailTemplateId"));
+}
+
+
+
+1;
diff --git a/lib/WebGUI/Account/User.pm b/lib/WebGUI/Account/User.pm
new file mode 100644
index 000000000..37185c1bf
--- /dev/null
+++ b/lib/WebGUI/Account/User.pm
@@ -0,0 +1,145 @@
+package WebGUI::Account::User;
+
+use strict;
+
+use WebGUI::Exception;
+use WebGUI::International;
+use WebGUI::Pluggable;
+use WebGUI::Utility;
+use WebGUI::Operation::Auth;
+
+use base qw/WebGUI::Account/;
+
+=head1 NAME
+
+Package WebGUI::Account::User
+
+=head1 DESCRIPTION
+
+This is the class which is used to display a users's account details
+
+=head1 SYNOPSIS
+
+ use WebGUI::Account::User;
+
+=head1 METHODS
+
+These subroutines are available from this package:
+
+=cut
+
+#-------------------------------------------------------------------
+
+=head2 canView ( )
+
+ Returns whether or not the user can view the inbox tab
+
+=cut
+
+sub canView {
+ my $self = shift;
+ return ($self->uid eq "");
+}
+
+#-------------------------------------------------------------------
+
+=head2 editSettingsForm ( )
+
+ Creates form elements for user settings page custom to this account module
+
+=cut
+
+sub editSettingsForm {
+ my $self = shift;
+ my $session = $self->session;
+ my $setting = $session->setting;
+ my $i18n = WebGUI::International->new($session,'Account_User');
+ my $f = WebGUI::HTMLForm->new($session);
+
+ $f->template(
+ name => "userAccountStyleTemplateId",
+ value => $self->session->setting->get("userAccountStyleTemplateId"),
+ namespace => "style",
+ label => $i18n->get("user style template label"),
+ hoverHelp => $i18n->get("user style template hoverHelp")
+ );
+ $f->template(
+ name => "userAccountLayoutTemplateId",
+ value => $self->session->setting->get("userAccountLayoutTemplateId"),
+ namespace => "Account/Layout",
+ label => $i18n->get("layout template label"),
+ hoverHelp => $i18n->get("layout template hoverHelp")
+ );
+ $f->raw(q{ });
+ $f->readOnly (
+ value => $i18n->get("templates in auth method message"),
+ );
+
+ return $f->printRowsOnly;
+}
+
+#-------------------------------------------------------------------
+
+=head2 editSettingsFormSave ( )
+
+ Creates form elements for user settings page custom to this account module
+
+=cut
+
+sub editSettingsFormSave {
+ my $self = shift;
+ my $session = $self->session;
+ my $setting = $session->setting;
+ my $form = $session->form;
+
+ $setting->set("userAccountStyleTemplateId", $form->process("userAccountStyleTemplateId","template"));
+ $setting->set("userAccountLayoutTemplateId", $form->process("userAccountLayoutTemplateId","template"));
+}
+
+#-------------------------------------------------------------------
+
+=head2 getLayoutTemplateId ( )
+
+This method returns the template ID for the account layout.
+
+=cut
+
+sub getLayoutTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("userAccountLayoutTemplateId") || "9ThW278DWLV0-Svf68ljFQ";
+}
+
+
+#-------------------------------------------------------------------
+
+=head2 getStyleTemplateId ( )
+
+This method returns the template ID for the main style.
+
+=cut
+
+sub getStyleTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("userAccountStyleTemplateId") || $self->SUPER::getStyleTemplateId;
+}
+
+
+#-------------------------------------------------------------------
+
+=head2 www_view ( )
+
+The main view page for editing the user's profile.
+
+=cut
+
+sub www_view {
+ my $self = shift;
+ my $session = $self->session;
+
+ my $auth = WebGUI::Operation::Auth::getInstance($session);
+
+ return $auth->displayAccount;
+}
+
+
+1;
diff --git a/lib/WebGUI/Account/_NewModule.skeleton b/lib/WebGUI/Account/_NewModule.skeleton
new file mode 100644
index 000000000..7c665f462
--- /dev/null
+++ b/lib/WebGUI/Account/_NewModule.skeleton
@@ -0,0 +1,145 @@
+package WebGUI::Account::NewModule;
+
+use strict;
+
+use WebGUI::Exception;
+use WebGUI::International;
+use WebGUI::Pluggable;
+use WebGUI::Utility;
+use base qw/WebGUI::Account/;
+
+=head1 NAME
+
+Package WebGUI::Account::NewAsset
+
+=head1 DESCRIPTION
+
+Describe your New Account Module's functionality and features here.
+
+=head1 SYNOPSIS
+
+use WebGUI::Account::NewModule;
+
+
+=head1 METHODS
+
+These methods are available from this class:
+
+=cut
+
+#-------------------------------------------------------------------
+
+=head2 canView ( )
+
+ Returns whether or not the user can view the the tab for this module
+
+=cut
+
+sub canView {
+ my $self = shift;
+ return 1;
+}
+
+#-------------------------------------------------------------------
+
+=head2 editSettingsForm ( )
+
+ Creates form elements for user settings page custom to this account module
+
+=cut
+
+sub editSettingsForm {
+ my $self = shift;
+ my $session = $self->session;
+ my $i18n = WebGUI::International->new($session,'Account_NewModule');
+ my $f = WebGUI::HTMLForm->new($session);
+
+ $f->template(
+ name => "moduleStyleTemplateId",
+ value => $self->getStyleTemplateId,
+ namespace => "style",
+ label => $i18n->get("style template label"),
+ hoverHelp => $i18n->get("style template hoverHelp")
+ );
+ $f->template(
+ name => "moduleLayoutTemplateId",
+ value => $self->getLayoutTemplateId,
+ namespace => "Account/Layout",
+ label => $i18n->get("layout template label"),
+ hoverHelp => $i18n->get("layout template hoverHelp")
+ );
+ $f->template(
+ name => "moduleViewTemplateId",
+ value => $self->session->setting->get("moduleViewTemplateId"),
+ namespace => "Account/NewModule/View",
+ label => $i18n->get("view template label"),
+ hoverHelp => $i18n->get("view template hoverHelp")
+ );
+
+ return $f->printRowsOnly;
+}
+
+#-------------------------------------------------------------------
+
+=head2 editSettingsFormSave ( )
+
+ Creates form elements for the settings page custom to this account module
+
+=cut
+
+sub editSettingsFormSave {
+ my $self = shift;
+ my $session = $self->session;
+ my $setting = $session->setting;
+ my $form = $session->form;
+
+ $setting->set("moduleStyleTemplateId", $form->process("moduleStyleTemplateId","template"));
+ $setting->set("moduleLayoutTemplateId", $form->process("moduleLayoutTemplateId","template"));
+ $setting->set("moduleViewTemplateId", $form->process("moduleViewTemplateId","template"));
+}
+
+#-------------------------------------------------------------------
+
+=head2 getLayoutTemplateId ( )
+
+This method returns the templateId for the layout of your new module.
+
+=cut
+
+sub getLayoutTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("moduleLayoutTempalteId") || $self->SUPER::getLayoutTemplateId;
+}
+
+
+#-------------------------------------------------------------------
+
+=head2 getStyleTemplateId ( )
+
+This method returns the template ID for the main style.
+
+=cut
+
+sub getStyleTemplateId {
+ my $self = shift;
+ return $self->session->setting->get("moduleStyleTemplateId") || $self->SUPER::getStyleTemplateId;
+}
+
+#-------------------------------------------------------------------
+
+=head2 www_view ( )
+
+The main view page for editing the user's profile.
+
+=cut
+
+sub www_view {
+ my $self = shift;
+ my $session = $self->session;
+ my $var = {};
+
+ return $self->processTemplate($var,$session->setting->get("moduleViewTemplateId"));
+}
+
+
+1;
diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm
index 3efa89461..bec58b3ad 100644
--- a/lib/WebGUI/Asset/Post.pm
+++ b/lib/WebGUI/Asset/Post.pm
@@ -418,7 +418,7 @@ Formats the url to view a users profile.
sub getPosterProfileUrl {
my $self = shift;
- return $self->getUrl("op=viewProfile;uid=".$self->get("ownerUserId"));
+ return WebGUI::User->new($self->session,$self->get("ownerUserId"))->getProfileUrl;
}
#-------------------------------------------------------------------
diff --git a/lib/WebGUI/Asset/Shortcut.pm b/lib/WebGUI/Asset/Shortcut.pm
index 0497f6151..ec21a452d 100644
--- a/lib/WebGUI/Asset/Shortcut.pm
+++ b/lib/WebGUI/Asset/Shortcut.pm
@@ -847,7 +847,7 @@ sub www_saveUserPrefs {
my $field = WebGUI::ProfileField->new($self->session,$fieldId);
next unless $field;
$data{$field->getId} = $field->formProcess;
- if ($field->getId eq 'email' && WebGUI::Operation::Profile::isDuplicateEmail($self->session,$data{$field->getId})) {
+ if ($field->getId eq 'email' && $field->isDuplicate($data{$field->getId})) {
return '  '.$i18n->get(61).'
';
- $vars->{'account.message'} = $i18n->get(856);
- if($self->session->setting->get("useKarma")){
- $vars->{'account.form.karma'} = $self->session->user->profileField("karma");
- $vars->{'account.form.karma.label'} = $i18n->get(537);
- }
- $vars->{'account.options'} = WebGUI::Operation::Shared::accountOptions($self->session);
- return WebGUI::Asset::Template->new($self->session,$self->getAccountTemplateId)->process($vars);
+ $vars->{displayTitle} = ''.$i18n->get(61).'
';
+ $vars->{'account.message'} = $i18n->get(856);
+ if($self->session->setting->get("useKarma")){
+ $vars->{'account.form.karma'} = $self->session->user->profileField("karma");
+ $vars->{'account.form.karma.label'} = $i18n->get(537);
+ }
+ WebGUI::Account->appendAccountLinks($self->session,$vars);
+
+ ########### ACCOUNT SHUNT
+ #The following is a shunt which allows the displayAccount page to be displayed in the
+ #Account system. This shunt will be replaced in WebGUI 8 when the API can be broken
+ my $output = WebGUI::Asset::Template->new($self->session,$self->getAccountTemplateId)->process($vars);
+ #If the account system is calling this method, just return the template
+ my $op = $self->session->form->get("op");
+ if($op eq "account") {
+ return $output;
+ }
+ #Otherwise wrap the template into the account layout
+ my $instance = WebGUI::Content::Account->createInstance($self->session,"user");
+ return $instance->displayContent($output,1);
}
#-------------------------------------------------------------------
@@ -580,5 +601,4 @@ sub setConnectDN {
}
-1;
-
+1;
\ No newline at end of file
diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm
index f93aa1b0b..087d31d4b 100644
--- a/lib/WebGUI/Auth/WebGUI.pm
+++ b/lib/WebGUI/Auth/WebGUI.pm
@@ -229,7 +229,17 @@ sub createAccountSave {
}
}
$error .= $self->error unless($self->_isValidPassword($password,$passConfirm));
- my ($profile, $temp, $warning) = WebGUI::Operation::Profile::validateProfileData($self->session, {regOnly => 1});
+
+ my $fields = WebGUI::ProfileField->getRegistrationFields($session);
+ my $retHash = $self->user->validateProfileDataFromForm($fields);
+ my $profile = $retHash->{profile};
+ my $temp = "";
+ my $warning = "";
+
+ my $format = "%s
\n%s
\n", $i18n->get('add to friends')),
- '%s
\n%s
%s
\n%s
\n%s
\n%s
\n", $i18n->get('friend request')),
- '%s
\n%s
\n%s
\n%s
\n%s
\n%s
\n%s
\n
{message} =~ /\
\n/g;
- }
-
- #Get the username of the person who sent the message
- my $sentBy = $message->get("sentBy");
- #Assume it's the admin user who sent the message
- my $from = WebGUI::User->new($session,3)->username;
- #If the user actually exists, get the username
- if($sentBy ne "1" && $sentBy ne "3") {
- $from = WebGUI::User->new($session,$sentBy)->username;
- }
-
- $vars->{ from } = $from;
-
-
- #If the person didn't send the message to themselves (for admin only) and the user still exsists (check visitor case)
- if($sentBy ne $session->user->userId &&
- $sentBy ne "1" &&
- $origStatus ne "pending" &&
- $origStatus ne "completed") {
- my $u = WebGUI::User->new($session,$sentBy);
- $vars->{'canReply'} = "true";
- _appendPrivateMessageForm($session,$vars,$u,$message);
- }
-
- }
- $vars->{'accountOptions'} = WebGUI::Operation::Shared::accountOptions($session);
- my $templateId = $session->setting->get("viewInboxMessageTemplateId");
- return $session->style->userStyle(WebGUI::Asset::Template->new($session,$templateId)->process($vars));
+ my $instance = WebGUI::Content::Account->createInstance($session,"inbox");
+ return $instance->displayContent($instance->callMethod("viewMessage"));
}
-1;
+1;
\ No newline at end of file
diff --git a/lib/WebGUI/Operation/Profile.pm b/lib/WebGUI/Operation/Profile.pm
index bfa3b8c72..be0dd9166 100644
--- a/lib/WebGUI/Operation/Profile.pm
+++ b/lib/WebGUI/Operation/Profile.pm
@@ -11,19 +11,11 @@ package WebGUI::Operation::Profile;
#-------------------------------------------------------------------
use strict qw(vars subs);
-use URI;
-use WebGUI::Asset::Template;
-use WebGUI::Operation::Auth;
-use WebGUI::HTML;
-use WebGUI::HTMLForm;
+use WebGUI::Content::Account;
use WebGUI::International;
-use WebGUI::SQL;
+use WebGUI::ProfileField;
use WebGUI::User;
use WebGUI::Utility;
-use WebGUI::ProfileField;
-use WebGUI::ProfileCategory;
-use WebGUI::Operation::Shared;
-use WebGUI::Operation::Friends;
=head1 NAME
@@ -46,7 +38,7 @@ These methods are available from this package:
Returns an array of hashes for required profile fields. This array is ready
to be used as template variables in the WebGUI template system.
-This method is deprecated, and should not be used in new code. Use
+DEPRECATED - 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.
@@ -80,6 +72,9 @@ duplicated in the system. Returns true of false. Will return false
if the email address passed in is same as the email address of the
current user.
+DEPRECATED - This method is deprecated, and should not be used in new code. Use
+the isDuplicate method from WebGUI::ProfileField instead
+
=head3 email
email address to check for duplication
@@ -89,12 +84,9 @@ email address to check for duplication
sub isDuplicateEmail {
my $session = shift;
my $email = shift;
- my ($otherEmail)
- = $session->db->quickArray(
- 'select count(*) from userProfileData where email = ? and userId <> ?',
- [$email, $session->user->userId]
- );
- return ($otherEmail > 0);
+
+ my $field = WebGUI::ProfileField->new($session,'email');
+ return $field->isDuplicate($email);
}
#-------------------------------------------------------------------
@@ -103,6 +95,9 @@ sub isDuplicateEmail {
Saves profile data to a user's profile. Does not validate any of the data.
+DEPRECATED - This method is deprecated, and should not be used in new code. Use
+the updateProfileFields method in WebGUI::User
+
=head3 session
WebGUI session object
@@ -119,12 +114,9 @@ Hash ref of profile data to save.
sub saveProfileFields {
my $session = shift;
- my $u = shift;
+ my $u = shift;
my $profile = shift;
-
- foreach my $fieldName (keys %{$profile}) {
- $u->profileField($fieldName,${$profile}{$fieldName});
- }
+ $u->updateProfileFields($profile);
}
#-------------------------------------------------------------------
@@ -134,6 +126,9 @@ sub saveProfileFields {
Validates profile data from the session form variables. Returns processed data, warnings
and errors.
+DEPRECATED - This method is deprecated, and should not be used in new code. Use
+the validateProfileDataFromForm method from WebGUI::User instead
+
There are two levels of validation:
=over 4
@@ -152,46 +147,35 @@ warning if it is a duplicate.
=cut
sub validateProfileData {
- my $session = shift;
- my $opts = shift || {};
- my $regOnly = $opts->{regOnly};
- my %data = ();
- my $error = "";
- my $warning = "";
- my $i18n = WebGUI::International->new($session);
- my $fields = $regOnly ? WebGUI::ProfileField->getRegistrationFields($session)
+ my $session = shift;
+ my $opts = shift || {};
+ my $regOnly = $opts->{regOnly};
+
+ my $error = "";
+ my $warning = "";
+ my $fields = $regOnly ? WebGUI::ProfileField->getRegistrationFields($session)
: WebGUI::ProfileField->getEditableFields($session);
- foreach my $field (@$fields) {
- my $fieldValue = $field->formProcess;
- if (ref $fieldValue eq "ARRAY") {
- $data{$field->getId} = $$fieldValue[0];
- } else {
- $data{$field->getId} = $fieldValue;
- }
- if ($field->isRequired && $data{$field->getId} eq "") {
- $error .= ''.$error.'
') if($error ne "");
- foreach my $fieldName (keys %{$profile}) {
- $session->user->profileField($fieldName,$profile->{$fieldName});
- }
- return WebGUI::Operation::Auth::www_auth($session);
-}
#-------------------------------------------------------------------
=head2 www_viewProfile ( session )
-View the profile data for a user by the userId specified by the form variable C
for the authentications modules you have installed on your site. },
+ lastUpdated => 1119068809
+ },
+
+
+};
+
+1;
diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm
index b1477ea56..d50b6512e 100755
--- a/lib/WebGUI/i18n/English/WebGUI.pm
+++ b/lib/WebGUI/i18n/English/WebGUI.pm
@@ -188,6 +188,11 @@ our $I18N = {
lastUpdated => 1031514049
},
+ 'home info short' => {
+ message => q|Home|,
+ lastUpdated => 1031514049
+ },
+
'118' => {
message => q|Anonymous Registration|,
lastUpdated => 1031514049
@@ -244,6 +249,16 @@ our $I18N = {
context => q|Title of the statistics viewer for the admin console.|
},
+ 'required error' => {
+ message => q{%s is required.},
+ lastUpdated => 1031514049
+ },
+
+ 'language not available error' => {
+ message => q|%s is not available. Please select another language|,
+ lastUpdated => 1031514049
+ },
+
'451' => {
message => q|is required.|,
lastUpdated => 1031514049
@@ -325,7 +340,7 @@ our $I18N = {
},
'861' => {
- message => q|Make profile public?|,
+ message => q|Profile Privacy Setting|,
lastUpdated => 1043879954
},
@@ -604,6 +619,11 @@ our $I18N = {
lastUpdated => 1031514049
},
+ 'demographic info short' => {
+ message => q|Demographic|,
+ lastUpdated => 1031514049
+ },
+
'77' => {
message => q|That account name is already in use by another member of this site. Please try a different username. The following are some suggestions:
%sToo
@@ -835,6 +855,11 @@ to add or remove users from their groups.
lastUpdated => 1031514049
},
+ 'preferences short' => {
+ message => q|Preferences|,
+ lastUpdated => 1031514049
+ },
+
'1026' => {
message => q|Allow rich edit?|,
lastUpdated => 1065966219
@@ -1248,6 +1273,11 @@ You must be using mod_perl and configure PerlSetEnv SYBASE /opt/sybase/11.0.2
lastUpdated => 1031514049
},
+ 'misc info short' => {
+ message => q|Miscellaneous|,
+ lastUpdated => 1031514049
+ },
+
'967' => {
message => q|Empty everyone's trash.|,
lastUpdated => 1208022779
@@ -1516,6 +1546,11 @@ sent in HTML format. No attachments can be included.|,
lastUpdated => 1031514049
},
+ 'work info short' => {
+ message => q|Work|,
+ lastUpdated => 1031514049
+ },
+
'429' => {
message => q|Login Time|,
lastUpdated => 1031514049
@@ -1906,6 +1941,11 @@ This group could then be named "Employees in HMO 1", and would allow you to rest
lastUpdated => 1031514049
},
+ 'contact info short' => {
+ message => q|Contact Info|,
+ lastUpdated => 1031514049
+ },
+
'230' => {
message => q|Message|,
lastUpdated => 1031514049
@@ -2247,6 +2287,11 @@ This group could then be named "Employees in HMO 1", and would allow you to rest
lastUpdated => 1031514049
},
+ 'personal info short' => {
+ message => q|Personal|,
+ lastUpdated => 1031514049
+ },
+
'317' => {
message => q|ICQ UIN|,
lastUpdated => 1031514049
@@ -3229,6 +3274,12 @@ a user.|,
lastUpdated => 1118941685,
},
+ 'account settings tab' => {
+ message => q|Account|,
+ lastUpdated => 1098327046,
+ context => q|Tab label for the account settings in WebGUI Settings.|
+ },
+
'account' => {
message => q|Account|,
lastUpdated => 1098327046,
@@ -3534,6 +3585,11 @@ LongTruncOk=1
lastUpdated => 1181019679,
},
+ 'inbox message status active' => {
+ message => q|Active|,
+ lastUpdated => 1181019679,
+ },
+
'private message prev label' => {
message => q|Previous|,
lastUpdated => 1181019679,
diff --git a/lib/WebGUI/i18n/English/WebGUIProfile.pm b/lib/WebGUI/i18n/English/WebGUIProfile.pm
index 5d4e671d6..afed1aee5 100644
--- a/lib/WebGUI/i18n/English/WebGUIProfile.pm
+++ b/lib/WebGUI/i18n/English/WebGUIProfile.pm
@@ -17,6 +17,16 @@ our $I18N = {
lastUpdated => 1031514049
},
+ 'category short name' => {
+ message => q|Category Short Name|,
+ lastUpdated => 1031514049
+ },
+
+ 'category short name description' => {
+ message => q|The short name of the this category.|,
+ lastUpdated => 1122315199,
+ },
+
'475' => {
message => q|Field Name|,
lastUpdated => 1031514049
diff --git a/t/Account.t b/t/Account.t
new file mode 100644
index 000000000..7b67756d6
--- /dev/null
+++ b/t/Account.t
@@ -0,0 +1,76 @@
+# vim:syntax=perl
+#-------------------------------------------------------------------
+# WebGUI is Copyright 2001-2008 Plain Black Corporation.
+#-------------------------------------------------------------------
+# Please read the legal notices (docs/legal.txt) and the license
+# (docs/license.txt) that came with this distribution before using
+# this software.
+#------------------------------------------------------------------
+# http://www.plainblack.com info@plainblack.com
+#------------------------------------------------------------------
+
+# This tests the operation of WebGUI::Account modules. You can use
+# as a base to test your own modules.
+
+use FindBin;
+use strict;
+use lib "$FindBin::Bin/lib";
+use Test::More;
+use WebGUI::Test; # Must use this before any other WebGUI modules
+use WebGUI::Session;
+
+#----------------------------------------------------------------------------
+# Init
+my $session = WebGUI::Test->session;
+
+
+#----------------------------------------------------------------------------
+# Tests
+
+plan tests => 7; # Increment this number for each test you create
+
+#----------------------------------------------------------------------------
+# Test the creation of WebGUI::Account
+
+# Can we load WebGUI::Account?
+use_ok( "WebGUI::Account" );
+
+SKIP: { # Not everyone has Test::Exception yet
+ eval { require Test::Exception; import Test::Exception };
+ # Skip 1 test if Test::Exception couldn't be loaded
+ skip 1, 'Test::Exception not found' if $@;
+ throws_ok( sub { WebGUI::Account->new }, 'WebGUI::Error::InvalidObject',
+ 'new() throws exception without session object'
+ );
+};
+
+my $account;
+# ok() tests booleans. assignment evaluates to the value assigned (it's how '$a = $b = 4' works)
+ok( $account = WebGUI::Account->new( $session ),
+ "WebGUI::Account object created successfully"
+);
+
+# Test $account->isa
+isa_ok( $account, "WebGUI::Account", 'Blessed into the right class' );
+
+#----------------------------------------------------------------------------
+# Test getUrl
+
+is( $account->getUrl, $session->url->page('op=account;module=;do='),
+ 'getUrl adds op, module, and do'
+);
+
+is( $account->getUrl( 'foo=bar' ), $session->url->page( 'op=account;foo=bar' ),
+ 'getUrl adds op if passed other parameters'
+);
+
+is( $account->getUrl( 'op=account' ), $session->url->page( 'op=account' ),
+ 'getUrl doesnt add op=account if already exists'
+);
+
+#----------------------------------------------------------------------------
+# Cleanup
+END {
+
+}
+#vim:ft=perl
diff --git a/www/extras/FileUploadControl.js b/www/extras/FileUploadControl.js
index 53e6ece14..687254f73 100755
--- a/www/extras/FileUploadControl.js
+++ b/www/extras/FileUploadControl.js
@@ -85,7 +85,7 @@ function FileUploadControl_swapImage(firedobj) {
var img = row.childNodes[0].childNodes[0];
img.src = imgPath;
img.style.visibility="visible";
- img.alt = alternate;
+ img.alt = alternative;
}
//removes a row from the control
diff --git a/www/extras/account/account.css b/www/extras/account/account.css
new file mode 100644
index 000000000..d75c73806
--- /dev/null
+++ b/www/extras/account/account.css
@@ -0,0 +1,724 @@
+
+/* general */
+
+ body {
+ margin:0;
+ padding:0;
+ font: 11px Verdana;
+ }
+ a {
+ cursor: pointer;
+ }
+ button {
+ cursor: pointer;
+ }
+ img {
+ border: none;
+ }
+ .button {
+ float:right;
+ padding-right:10px;
+ }
+ .centered {
+ text-align: center;
+ }
+ .account_message {
+ width: 600px;
+ height: 300px;
+ border: solid #BECEF8 1px;
+ margin-left: 50px;
+ margin-bottom: 20px;
+ overflow:-moz-scrollbars-vertical;
+ overflow-x:hidden;
+ overflow-y:scroll;
+ background-color: white;
+ text-align: left;
+ }
+ .profileMember {
+ text-align:right;
+ margin-right:20px;
+ font-size:9px;
+ }
+ .member {
+ font: 9px Verdana, Arial, Helvetica, sans-serif;
+ color:#000000;
+ text-align:center;
+ }
+ .photostyle {
+ border:solid #9BB4F4 2px;
+ margin-bottom:5px;
+ margin-top:5px
+ }
+ #rightalign {
+ float: right;
+ }
+ /*.send {
+ padding-right: 75px;
+ }*/
+
+ .Profile_registration {
+
+ }
+ .Profile_registration td {
+ font-size:9pt;
+ font-family:arial;
+ }
+ .Profile_registration .tabs a {
+ text-decoration:none;
+ background-color:#FEEBC7;
+ margin-right:10px;
+ padding:0px 10px 1px 10px;
+ color:#FDC55B;
+ font-weight:bold;
+ border:solid #FDBA42 1px;
+ }
+ .Profile_registration .tabs a.active {
+ background:#FDBA42;
+ color:black;
+ }
+ .Profile_registration .header {
+ font-size:10px;
+ font-weight:bold;
+ text-align:left;
+ color:#fff;
+ background-color:#818997;
+ border-top:solid #FE9515 3px;
+ text-align:right;
+ }
+ .Profile_registration .header a {
+ color:white;
+ text-decoration:none;
+ }
+ .Profile_registration .help a {
+ font-weight:bold;
+ text-decoration:none;
+ }
+
+ .Profile_registration .inputText {
+ font-size:10px;
+ margin-right:1px;
+ }
+ .Profile_registration .label {
+ font-weight:bold;
+ font-size:9pt;
+ text-align:right;
+ white-space:nowrap;
+ width:1%;
+ }
+ .Profile_registration .labelLeft {
+ font-weight:bold;
+ font-size:9pt;
+ text-align:right;
+ white-space:nowrap;
+ width:1%;
+ text-align: left;
+ vertical-align: top;
+ }
+ .Profile_registration .smallLabel {
+ font-size:8px;
+ text-align:center;
+ }
+ .Profile_registration .smallText {
+ font-size:9px;
+ }
+ .Profile_registration .yourselfBG {
+ border:solid #CEDBF8 1px;
+ background-color:#EEF2FD;
+ color:black;
+ padding: 2px;
+ }
+ /*.Profile_registration .yourselfBG a {
+ font-weight:bold;
+ color:#0054ff;
+ text-decoration:none;
+ }*/
+ .Profile_registration .bar {
+ background-color:#DDE6FB;
+ border:solid #BECEF8 1px;
+ text-align:center;
+ color:#0B2259;
+ font-size:14px;
+ font-weight:bold;
+ }
+
+ .Profile_registration .bar a {
+ color:#0B2259;
+ font-size:10px;
+ font-weight:bold;
+ }
+
+/* profile errors */
+
+#profileErrors {
+ background-color: #ff0000;
+ font-weight: bold;
+ color: #ffffff;
+ text-align: center;
+}
+
+.profilefield_required_off {
+}
+.profilefield_required {
+ background-color: #ffffbb;
+}
+.profilefield_error {
+ background-color: #FF9494;
+}
+
+/* bio, addtonetwork, network */
+
+ .bordered {
+ border-bottom: dashed #BECEF8 2px;
+ padding-bottom: 10px;
+ }
+ .friendpic {
+ border: solid #BECEF8 1px;
+ }
+ .invitemsg {
+ width: 600px;
+ height: 150px;
+ }
+ ol.Profile_interests {
+ font-size:15px;
+ font-weight:bold;
+ color:#0B2259;
+ list-style-type:none;
+ margin:0px;
+ padding:0px;
+ padding:5px 5px;
+ }
+ ol.Profile_interests li {
+ margin-bottom:15px;
+ }
+ ol.Profile_interests span {
+ font-weight:normal;
+ font-size:12px;
+ color:black;
+ }
+ .pBio {
+ border-bottom:solid #DDE6FB 1px;
+ margin:0px;
+ margin-bottom:5px;
+ padding-bottom:5px;
+ }
+ .pBio div {
+ background-color:#DDE6FB;
+ padding:2px 5px;
+ margin-bottom:2px;
+ }
+ .program {
+ font-size: 9px;
+ }
+
+/* edit box */
+
+ .editBox {
+ font-size:9px;
+ font-weight:bold;
+ background:white url(images/edit_box_bg.jpg) no-repeat bottom left;
+ border:solid #8DABF1 2px;
+ padding:5px;
+ width:590px;
+ -moz-box-sizing:border-box;
+ font-family:verdana;
+ z-index:100;
+ position:absolute;
+ top:100px;
+ left:100px;
+ display:block;
+ }
+ .editBox input, .editBox select {
+ font-size:9px;
+ }
+
+/* inbox */
+
+.Profile_registration .inboxTitle {
+ background-color:#DDE6FB;
+ border:solid #BECEF8 1px;
+ text-align:center;
+ font-size:10px;
+ font-weight:bold;
+ color:#0B2259;
+ text-decoration: underline;
+}
+
+/* inbox threads */
+
+ .evenThread {
+ background-color: #e1e8fb;
+ border-bottom: 1px solid #bfcef9;
+ padding: 4px;
+ text-align:center;
+ }
+ .oddThread {
+ background-color: #eef2fd;
+ border-bottom: 1px solid #bfcef9;
+ padding: 4px;
+ text-align: center;
+ }
+/* inbox forms */
+
+.inbox_from {
+ color: black;
+ text-decoration: none;
+ font-weight: normal;
+}
+
+.inbox_subject {
+ width: 530px;
+}
+
+.inbox_messageTo {
+ width: 530px;
+ height: 50px;
+ border: solid #BECEF8 1px;
+ overflow:-moz-scrollbars-vertical;
+ overflow-x:hidden;
+ overflow-y:scroll;
+ background-color: white;
+}
+
+/* inbox contacts */
+ .datacells {
+ border-bottom: dashed #BECEF8 1px;
+ }
+ .inbox_contactsTbl {
+ font-size:9pt;
+ font-family:arial;
+ background-color:#EEF2FD;
+ }
+ #contacts {
+ height: 275px;
+ overflow: auto;
+ }
+
+/* pagination */
+.Profile_pagination {
+ text-align:right;
+ font-size:10px;
+}
+.Profile_pagination a {
+ font-weight:bold;
+ font-size:10px;
+ border:solid #BECEF8 1px;
+ padding:1px 5px;
+ text-decoration:none;
+ background-color:#EEF2FD;
+}
+
+.Profile_pagination a:hover {
+ background-color:#FE9515;
+ color:white;
+}
+
+.Profile_pagination .prevNext {
+ border: none;
+ background-color: transparent;
+ color: black;
+}
+
+.Profile_pagination .prevNext:hover {
+ border: none;
+ background-color: transparent;
+ color: black;
+}
+
+.Profile_pagination .active {
+ font-weight:bold;
+ font-size:10px;
+ border:solid #BECEF8 1px;
+ padding:1px 5px;
+ text-decoration:none;
+ background-color:#FE9515;
+ color:white;
+}
+
+/* TABS - outer */
+
+.bottombutton {
+ border: none;
+ float:right;
+ padding-right:2px;
+ padding-top: 2px;
+ position: relative;
+}
+.content {
+ padding:10px;
+
+}
+.subContent {
+ border: solid #ffa700 6px;
+}
+.topbutton {
+ border: none;
+ float:right;
+ clear:both;
+ padding-right:2px;
+ padding-top: 2px;
+ position: relative;
+}
+
+ul.topTabs,
+ul.topTabs li {
+ margin:0px;
+ padding:0px;
+ list-style-type:none;
+ position:relative;zoom:1;
+ width:auto;
+
+ Xposition:relative;
+}
+ul.topTabs li {
+ display:block;
+ float:left;
+ margin-right: 5px;
+}
+ul.topTabs li b {
+ display:block;
+ position:relative;
+ top:-1px;
+ border-top:solid #ffa700 1px;
+ background-color: #faee9a;
+ padding:4px 8px;
+}
+ul.topTabs a {
+ display:block;
+ color:#ffa700;
+ font-size:12px;
+ font-family: Arial, Helvetica, sans-serif;
+ text-decoration:none;
+ background-color:#faee9a;
+ border-left: solid #ffa700 1px;
+ border-right: solid #ffa700 1px;
+}
+ul.topTabs a:hover,
+ul.topTabs a:hover b,
+ul.topTabs a.selected,
+ul.topTabs a.selected b {
+ background-color:#ffa700;
+ color:#fff;
+}
+
+/* TABS - YUI */
+
+.cleardiv {
+ clear: both;
+ margin: 0px 0px 0px 0px;
+ padding: 0px;
+}
+
+.view {
+ border: none;
+ font: bold 10px Verdana;
+ color: #0b2258;
+ text-decoration:none;
+ position: absolute;
+ right: 4px;
+ top:4px;
+}
+
+.profile_displayView {
+ -x-system-font:none;
+ border:medium none;
+ color:#0B2258;
+ display:inline;
+ float:right;
+ font-family:Verdana;
+ font-size:10px;
+ font-size-adjust:none;
+ font-stretch:normal;
+ font-style:normal;
+ font-variant:normal;
+ font-weight:bold;
+ line-height:normal;
+ padding-right:8px;
+ padding-top:3px;
+}
+
+.profile_displaySubContent {
+ border: solid #ffa700 6px;
+ border-top: solid #ffa700 18px;
+}
+
+/* view profile */
+
+.profile_fieldLabel {
+background: #DDE6FB;
+border: 1px solid white;
+}
+.profile_fieldData {
+margin-left: 5px;
+}
+
+ /*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.6.0
+*/
+/* .yui-navset defaults to .yui-navset-top */
+.yui-skin-sam .yui-navset .yui-nav,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav { /* protect nested tabviews from other orientations */
+ border:solid #eef2fd; /* color between tab list and content */
+ border-width:0 0 5px;
+ Xposition:relative;
+ zoom:1;
+}
+
+.yui-skin-sam .yui-navset .yui-nav li,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li {
+ margin:0 0.3em 0 0; /* space between tabs */
+ padding:5px 0 0; /* gecko: make room for overflow */
+ zoom:1;
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected {
+ margin:0 0.3em -1px 0; /* for overlap */
+}
+
+.yui-skin-sam .yui-navset .yui-nav a,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a {
+ background:#9bb4f4; /* tab background */
+ border:solid #eef2fd;
+ border-width:0 1px;
+ color:#eef2fd;
+ position:relative;
+ text-decoration:none;
+ font-size:12px;
+ font-family: Arial, Helvetica, sans-serif;
+ font-weight: bold;
+}
+
+.yui-skin-sam .yui-navset .yui-nav a em,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em {
+ border:solid #eef2fd;
+ border-width:1px 0 0;
+ cursor:hand;
+ padding:0.25em .75em;
+ left:0; right: 0; bottom: 0; /* protect from other orientations */
+ top:-1px; /* for 1px rounded corners */
+ position:relative;
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected a,
+.yui-skin-sam .yui-navset .yui-nav .selected a:focus, /* no focus effect for selected */
+.yui-skin-sam .yui-navset .yui-nav .selected a:hover { /* no hover effect for selected */
+ background:#eef2fd; /* selected tab background */
+ color:#0a2359;
+ font-size:12px;
+ font-family: Arial, Helvetica, sans-serif;
+ text-decoration:none;
+ font-weight: bold;
+}
+
+.yui-skin-sam .yui-navset .yui-nav a:hover,
+.yui-skin-sam .yui-navset .yui-nav a:focus {
+ background:#eef2fd; /* selected tab background */
+ color:#0a2359;
+ outline:0;
+ font-size:12px;
+ font-family: Arial, Helvetica, sans-serif;
+ text-decoration:none;
+ font-weight: bold;
+
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected a,
+.yui-skin-sam .yui-navset .yui-nav .selected a em {
+ border-color:#eef2fd; /* selected tab border color */
+}
+
+.yui-skin-sam .yui-navset .yui-content {
+ background:#edf5ff; /* content background color */
+}
+
+.yui-skin-sam .yui-navset .yui-content,
+.yui-skin-sam .yui-navset .yui-navset-top .yui-content {
+ border:5px solid #eef2fd; /* content border */
+ padding:0.75em 1em; /* content padding */
+}
+
+/* left and right orientations */
+.yui-skin-sam .yui-navset-left .yui-nav,
+.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,
+.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,
+.yui-skin-sam .yui-navset-right .yui-nav {
+ border-width:0 5px 0 0;
+ Xposition:absolute; /* from tabview-core; have to reiterate for skin-sam due to pos:rel on skin-sam yui-nav */
+ top:0; bottom:0; /* stretch to fill content height */
+}
+
+.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,
+.yui-skin-sam .yui-navset-right .yui-nav {
+ border-width:0 0 0 5px;
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav li,
+.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,
+.yui-skin-sam .yui-navset-right .yui-nav li {
+ margin:0 0 0.3em; /* space between tabs */
+ padding:0 0 0 1px; /* gecko: make room for overflow */
+}
+
+.yui-skin-sam .yui-navset-right .yui-nav li {
+ padding:0 1px 0 0; /* gecko: make room for overflow */
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav .selected,
+.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected {
+ margin:0 -1px 0.16em 0;
+}
+
+.yui-skin-sam .yui-navset-right .yui-nav .selected {
+ margin:0 0 0.16em -1px;
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav a,
+.yui-skin-sam .yui-navset-right .yui-nav a {
+ border-width:1px 0;
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav a em,
+.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,
+.yui-skin-sam .yui-navset-right .yui-nav a em {
+ border-width:0 0 0 1px;
+ padding:0.2em .75em;
+ top:auto;
+ left:-1px; /* for 1px rounded corners */
+}
+
+.yui-skin-sam .yui-navset-right .yui-nav a em {
+ border-width:0 1px 0 0;
+ left:auto;
+ right:-1px; /* for 1px rounded corners */
+}
+
+.yui-skin-sam .yui-navset-left .yui-nav a,
+.yui-skin-sam .yui-navset-left .yui-nav .selected a,
+.yui-skin-sam .yui-navset-left .yui-nav a:hover,
+.yui-skin-sam .yui-navset-right .yui-nav a,
+.yui-skin-sam .yui-navset-right .yui-nav .selected a,
+.yui-skin-sam .yui-navset-right .yui-nav a:hover,
+.yui-skin-sam .yui-navset-bottom .yui-nav a,
+.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,
+.yui-skin-sam .yui-navset-bottom .yui-nav a:hover {
+ background-image:none; /* no left-right or bottom-top gradient */
+}
+
+.yui-skin-sam .yui-navset-left .yui-content {
+ border:1px solid #eef2fd; /* content border */
+}
+
+/* bottom orientation */
+.yui-skin-sam .yui-navset-bottom .yui-nav,
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav {
+ border-width:5px 0 0; /* color between tab list and content */
+}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,
+.yui-skin-sam .yui-navset-bottom .yui-nav .selected {
+ margin:-1px 0.3em 0 0; /* for overlap */
+}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,
+.yui-skin-sam .yui-navset-bottom .yui-nav li {
+ padding:0 0 1px 0; /* gecko: make room for overflow */
+ vertical-align:top;
+}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,
+.yui-skin-sam .yui-navset-bottom .yui-nav li a {
+}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,
+.yui-skin-sam .yui-navset-bottom .yui-nav a em {
+ border-width:0 0 1px;
+ top:auto;
+ bottom:-1px; /* for 1px rounded corners */
+}
+
+.yui-skin-sam .yui-navset-bottom .yui-content,
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content {
+ border:1px solid #eef2fd; /* content border */
+}
+
+
+.yui-skin-sam {
+ background-color: #ffa700;
+ padding: 10px 5 5 5px;
+ display:block;
+}
+
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.6.0
+*/
+.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}
+
+.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}
+
+.yui-navset .yui-content .yui-hidden{display:none;}
+
+.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}
+
+.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}
+
+.yui-navset-right {padding:0 6em 0 0;}
+
+.yui-navset-top,.yui-navset-bottom{padding:auto;}
+
+.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}
+
+.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}
+
+.yui-navset .yui-content{zoom:1;}
+
+.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}
+
+.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}
+
+.yui-navset .yui-nav a{position:relative;}
+
+.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}
+
+.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}
+
+.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}
+
+.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}
+
+.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}
+
+.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}
+
+.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}
+
+.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}
+
+.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}
+
+.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}
+
+.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}
+
+.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}
+
+.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}
+
+.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}
+
+.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}
+
+.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}
+
+.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}
+
+.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}
+
+
diff --git a/www/extras/account/images/new.png b/www/extras/account/images/new.png
new file mode 100644
index 000000000..45d7f0676
Binary files /dev/null and b/www/extras/account/images/new.png differ
diff --git a/www/extras/account/images/next.gif b/www/extras/account/images/next.gif
new file mode 100644
index 000000000..d00933441
Binary files /dev/null and b/www/extras/account/images/next.gif differ
diff --git a/www/extras/account/images/no_photo.gif b/www/extras/account/images/no_photo.gif
new file mode 100644
index 000000000..cd34a822f
Binary files /dev/null and b/www/extras/account/images/no_photo.gif differ
diff --git a/www/extras/account/images/old.png b/www/extras/account/images/old.png
new file mode 100644
index 000000000..e43f504ce
Binary files /dev/null and b/www/extras/account/images/old.png differ
diff --git a/www/extras/account/images/prev.gif b/www/extras/account/images/prev.gif
new file mode 100644
index 000000000..47ccf43bb
Binary files /dev/null and b/www/extras/account/images/prev.gif differ
diff --git a/www/extras/account/images/save_changes.gif b/www/extras/account/images/save_changes.gif
new file mode 100644
index 000000000..897b100d4
Binary files /dev/null and b/www/extras/account/images/save_changes.gif differ
diff --git a/www/extras/account/inbox.js b/www/extras/account/inbox.js
new file mode 100644
index 000000000..16823857a
--- /dev/null
+++ b/www/extras/account/inbox.js
@@ -0,0 +1,64 @@
+YAHOO.util.Event.onDOMReady(function() {
+ if(YAHOO.util.Dom.inDocument("friends")) {
+
+ var isUserCheckBox = function ( element ) {
+ if(element.name == "friend") return true;
+ return false;
+ }
+
+ var removeUser = function (evt, obj) {
+ YAHOO.util.Event.stopEvent(evt);
+ var userId = obj.userId;
+ var checkBox = YAHOO.util.Dom.get("friend_"+userId+"_id");
+ checkBox.checked = false;
+ updateUsers(evt,obj.dialog);
+ }
+
+ var updateUsers = function ( evt , dialog ) {
+ YAHOO.util.Event.stopEvent(evt);
+ var toElement = YAHOO.util.Dom.get("messageTo");
+ toElement.innerHTML = ""; // Clear the current stuff
+ YAHOO.util.Dom.removeClass(toElement,"inbox_messageTo");
+
+ var checkBoxes = YAHOO.util.Dom.getElementsBy(isUserCheckBox,"INPUT","contacts");
+ for (var i = 0; i < checkBoxes.length; i++) {
+ if(checkBoxes[i].checked) {
+ var friendName = YAHOO.util.Dom.get("friend_"+checkBoxes[i].value+"_name").innerHTML;
+ var firstPart = document.createTextNode(friendName + " ( ");
+ var link = document.createElement("A");
+ link.setAttribute('href', '#');
+ link.innerHTML = removeText;
+ YAHOO.util.Event.addListener(link,"click",removeUser,{ userId: checkBoxes[i].value, dialog: dialog });
+ var lastPart = document.createTextNode(" ); ");
+ toElement.appendChild(firstPart);
+ toElement.appendChild(link);
+ toElement.appendChild(lastPart);
+ }
+ }
+ YAHOO.util.Dom.addClass(toElement,"inbox_messageTo");
+ dialog.hide();
+ }
+
+ var showUsers = function (evt, dialog) {
+ YAHOO.util.Event.stopEvent(evt);
+ dialog.show();
+ }
+
+ // Instantiate the Dialog
+ var dialog1 = new YAHOO.widget.Dialog("friends", {
+ width : "340px",
+ fixedcenter : true,
+ visible : false,
+ constraintoviewport : false
+ });
+
+ // Render the Dialog
+ dialog1.render();
+
+ YAHOO.util.Event.addListener("show_friends", "click", showUsers, dialog1);
+ YAHOO.util.Event.addListener("cancel_top", "click", dialog1.hide, dialog1, true);
+ YAHOO.util.Event.addListener("cancel_bottom", "click", dialog1.hide, dialog1, true);
+ YAHOO.util.Event.addListener("update_top", "click", updateUsers, dialog1);
+ YAHOO.util.Event.addListener("update_bottom", "click", updateUsers, dialog1);
+ }
+});
\ No newline at end of file