Implemented RFE 9204 - Add Reply Filter Code and Reply Rich Editor Option to Collaboration System - Provides ability to specify different Rich Editors and FilterCodes for posts (start of thread) and replies

This commit is contained in:
Eric Kennedy 2009-05-14 03:02:26 +00:00
parent 90717eee40
commit 2fb41ce8e8
5 changed files with 67 additions and 5 deletions

View file

@ -374,7 +374,12 @@ sub formatContent {
my $self = shift;
my $content = shift || $self->get("content");
my $contentType = shift || $self->get("contentType");
my $msg = WebGUI::HTML::filter($content,$self->getThread->getParent->get("filterCode"));
my $msg = undef ;
if (!$self->isa("WebGUI::Asset::Post::Thread")) { # apply appropriate content filter
$msg = WebGUI::HTML::filter($content,$self->getThread->getParent->get("replyFilterCode"));
} else {
$msg = WebGUI::HTML::filter($content,$self->getThread->getParent->get("filterCode"));
}
$msg = WebGUI::HTML::format($msg, $contentType);
if ($self->getThread->getParent->get("useContentFilter")) {
$msg = WebGUI::HTML::processReplacements($self->session,$msg);
@ -1422,7 +1427,9 @@ sub www_edit {
$var{'content.form'} = WebGUI::Form::HTMLArea($session, {
name=>"content",
value=>$content,
richEditId=>$self->getThread->getParent->get("richEditor")
richEditId=>($self->isa("WebGUI::Asset::Post::Thread") ?
$self->getThread->getParent->get("richEditor") :
$self->getThread->getParent->get("replyRichEditor")),
});
##Edit variables just for Threads
if ($className eq 'WebGUI::Asset::Post::Thread' && $self->getThread->getParent->canEdit) {

View file

@ -593,6 +593,13 @@ sub definition {
label=>$i18n->get('filter code'),
hoverHelp=>$i18n->get('filter code description'),
},
replyFilterCode =>{
fieldType=>"filterContent",
defaultValue=>'javascript',
tab=>'security',
label=>$i18n->get('reply filter code'),
hoverHelp=>$i18n->get('reply filter code description'),
},
richEditor =>{
fieldType=>"selectRichEditor",
defaultValue=>"PBrichedit000000000002",
@ -600,6 +607,13 @@ sub definition {
label=>$i18n->get('rich editor'),
hoverHelp=>$i18n->get('rich editor description'),
},
replyRichEditor =>{
fieldType=>"selectRichEditor",
defaultValue=>"PBrichedit000000000002",
tab=>'display',
label=>$i18n->get('reply rich editor'),
hoverHelp=>$i18n->get('reply rich editor description'),
},
attachmentsPerPost =>{
fieldType=>"integer",
defaultValue=>0,