From f5832ee280c4a0b61e3e9772fe16360d257d0fbc Mon Sep 17 00:00:00 2001 From: Drake Date: Tue, 7 Nov 2006 22:25:47 +0000 Subject: [PATCH] Make Rich Edit assets drop blank toolbar rows, shifting subsequent rows up. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/RichEdit.pm | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 3a096112a..55014991f 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -38,6 +38,7 @@ - fix: Post titles containing periods result in urls containing periods - fix: Activity list expands outside of edit workflow screen - fix: Thread layout "flat" doesn't stick + - fix: Rich Edit omitting rows drops subsequent rows 7.1.4 - Template variables in the main Survey Template were out of date in the diff --git a/lib/WebGUI/Asset/RichEdit.pm b/lib/WebGUI/Asset/RichEdit.pm index 10a2f72f9..171b468f1 100644 --- a/lib/WebGUI/Asset/RichEdit.pm +++ b/lib/WebGUI/Asset/RichEdit.pm @@ -433,12 +433,11 @@ sub getRichEditor { my $self = shift; return '' if ($self->getValue('disableRichEditor') || $self->session->env->get("HTTP_USER_AGENT") =~ /Safari/); my $nameId = shift; - my @toolbarRow1 = split("\n",$self->getValue("toolbarRow1")); - push(@toolbarRow1,"contextmenu") if ($self->getValue("enableContextMenu")); - my @toolbarRow2 = split("\n",$self->getValue("toolbarRow2")); - my @toolbarRow3 = split("\n",$self->getValue("toolbarRow3")); - my @toolbarButtons = (@toolbarRow1,@toolbarRow2,@toolbarRow3); + my @toolbarRows = grep{@$_} map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3); + push(@{$toolbarRows[0]},"contextmenu") if ($self->getValue("enableContextMenu")); + my @toolbarButtons = map{@$_} @toolbarRows; my @plugins; + my $i18n = WebGUI::International->new($self->session, 'Asset_RichEdit'); my %config = ( mode => "exact", @@ -451,9 +450,8 @@ sub getRichEditor { cleanup_callback => "tinyMCE_WebGUI_Cleanup", urlconvertor_callback => "tinyMCE_WebGUI_URLConvertor", theme_advanced_resizing => "true", - theme_advanced_buttons1 => join(",",@toolbarRow1), - theme_advanced_buttons2 => join(",",@toolbarRow2), - theme_advanced_buttons3 => join(",",@toolbarRow3), + (map { "theme_advanced_buttons".($_+1) => (join ',', @{$toolbarRows[$_]}) } + (0..$#toolbarRows)), ask => $self->getValue("askAboutRichEdit") ? "true" : "false", preformatted => $self->getValue("preformatted") ? "true" : "false", force_br_newlines => $self->getValue("useBr") ? "true" : "false",