From 3837878fff75f8f20291f401f55eb5780e396b96 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Fri, 23 Jan 2009 20:16:23 +0000 Subject: [PATCH] fixed: Added the ability to choose which rich editor is used to compose inbox messages --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/upgrade_7.6.9-7.6.10.pl | 11 +++++++++++ lib/WebGUI/Account/Inbox.pm | 21 +++++++++++++++++++++ lib/WebGUI/i18n/English/Account_Inbox.pm | 11 +++++++++++ 4 files changed, 44 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index ee91ad34d..17cc527bd 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - reverted #9386: Gallery: "Image resolutions" issue. This is a feature of the Galley. - fixed #9236: Survey 2.0 missing hoverhelp - added: Widget Macro now uses a style, defaulting to the users. + - added ability to select which rich editor is used to compose messages in the inbox 7.6.9 - fixed: ukplayer example is now loaded with swfobject.js released under the MIT licence, see gotcha's and /extras/ukplayer diff --git a/docs/upgrades/upgrade_7.6.9-7.6.10.pl b/docs/upgrades/upgrade_7.6.9-7.6.10.pl index 18df64280..2a2353fbb 100644 --- a/docs/upgrades/upgrade_7.6.9-7.6.10.pl +++ b/docs/upgrades/upgrade_7.6.9-7.6.10.pl @@ -31,6 +31,7 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here +addRichEditorInboxSetting( $session ); finish($session); # this line required @@ -44,6 +45,16 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} +#---------------------------------------------------------------------------- +# Add ability to select which rich editor for messages between users +sub addRichEditorInboxSetting { + my $session = shift; + print "\tAdding rich editor selection to Inbox... " unless $quiet; + + $session->setting->add("inboxRichEditId","PBrichedit000000000001"); + + print "DONE!\n" unless $quiet; +} # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/lib/WebGUI/Account/Inbox.pm b/lib/WebGUI/Account/Inbox.pm index 6e1f39685..57d6b5af1 100644 --- a/lib/WebGUI/Account/Inbox.pm +++ b/lib/WebGUI/Account/Inbox.pm @@ -217,6 +217,12 @@ sub editSettingsForm { label => $i18n->get("invite user confirm template label"), hoverHelp => $i18n->get("invite user confirm template hoverHelp") ); + $f->selectRichEditor( + name => "inboxRichEditorId", + value => $self->getRichEditorId, + label => $i18n->get("inbox rich editor label"), + hoverHelp => $i18n->get("inbox rich editor description"), + ); return $f->printRowsOnly; } @@ -257,6 +263,7 @@ sub editSettingsFormSave { $setting->set("inboxInviteUserTemplateId",$form->process("inboxInviteUserTemplateId","template")); $setting->set("inboxInviteUserConfirmTemplateId",$form->process("inboxInviteUserConfirmTemplateId","template")); + $setting->set("inboxRichEditorId", $form->process("inboxRichEditorId", "selectRichEditor") ); } @@ -382,6 +389,18 @@ sub getMessageConfirmTemplateId { return $self->session->setting->get("inboxMessageConfirmationTemplateId") || "DUoxlTBXhVS-Zl3CFDpt9g"; } +#------------------------------------------------------------------- + +=head2 getRichEditorId + +This method returns the rich editor ID users compose messages with. + +=cut + +sub getRichEditorId { + my $self = shift; + return $self->session->setting->get("inboxRichEditorId") || "PBrichedit000000000001"; +} #------------------------------------------------------------------- @@ -668,6 +687,7 @@ sub www_inviteUser { name => "message", value => $message, width => "600", + richEditId => $self->getRichEditorId, }); } else { @@ -1037,6 +1057,7 @@ sub www_sendMessage { name => "message", value => $var->{'message_body'} || "", width => "600", + richEditId => $self->getRichEditorId, }); $var->{'form_header' } = WebGUI::Form::formHeader($session,{ diff --git a/lib/WebGUI/i18n/English/Account_Inbox.pm b/lib/WebGUI/i18n/English/Account_Inbox.pm index 9f2d7b40b..bd13a590e 100644 --- a/lib/WebGUI/i18n/English/Account_Inbox.pm +++ b/lib/WebGUI/i18n/English/Account_Inbox.pm @@ -535,6 +535,17 @@ our $I18N = { lastUpdated => 1230867391, }, + 'inbox rich editor label' => { + message => q{Inbox Rich Editor}, + lastUpdated => 0, + context => q{Label for setting}, + }, + + 'inbox rich editor description' => { + message => q{The rich editor used to compose messages}, + lastUpdated => 0, + context => "Description of Inbox setting", + }, }; 1;