Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Kernel/Config/Files/XML/Framework.xml
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,18 @@
</Array>
</Value>
</Setting>
<Setting Name="Frontend::RichText::HtmlSupportAllowedElements" Required="0" Valid="1">
<Description Translatable="1">HTML elements that are passed through the CKEditor GeneralHtmlSupport filter with all their attributes, classes and inline styles in the agent interface. Elements not listed here lose attributes, classes and styles that are not handled by an active editor feature (e.g. inline styles on images).</Description>
<Navigation>Frontend::Base</Navigation>
<Value>
<Array>
<Item>span</Item>
<Item>cite</Item>
<Item>style</Item>
<Item>table</Item>
</Array>
</Value>
</Setting>
<Setting Name="Frontend::EnhancedCKEditorToolbar" Required="1" Valid="1">
<Description Translatable="1">Controls shown in the enhanced mode CKEditor toolbar. Each array defines a button group that will be visibly separated in the editor. (Only used if `Frontend::RichText::EnhancedMode` is enabled).</Description>
<Navigation>Frontend::Base</Navigation>
Expand Down Expand Up @@ -762,6 +774,18 @@
</Array>
</Value>
</Setting>
<Setting Name="CustomerFrontend::RichText::HtmlSupportAllowedElements" Required="0" Valid="1">
<Description Translatable="1">HTML elements that are passed through the CKEditor GeneralHtmlSupport filter with all their attributes, classes and inline styles in the customer interface. Elements not listed here lose attributes, classes and styles that are not handled by an active editor feature (e.g. inline styles on images).</Description>
<Navigation>Frontend::Base</Navigation>
<Value>
<Array>
<Item>span</Item>
<Item>cite</Item>
<Item>style</Item>
<Item>table</Item>
</Array>
</Value>
</Setting>
<Setting Name="CustomerFrontend::EnhancedCKEditorToolbar" Required="1" Valid="1">
<Description Translatable="1">Controls shown in the enhanced mode CKEditor toolbar. Each array defines a button group that will be visibly separated in the editor. (Only used if `CustomerFrontend::RichText::EnhancedMode` is enabled).</Description>
<Navigation>Frontend::Base</Navigation>
Expand Down
36 changes: 19 additions & 17 deletions Kernel/Output/HTML/Layout.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6485,14 +6485,15 @@ sub SetRichTextParameters {
SplitQuote => $LanguageObject->Translate('Split Quote'),
RemoveQuote => $LanguageObject->Translate('Remove Quote'),
},
Plugins => \@Plugins,
Toolbar => \@Toolbar,
ToolbarWithoutImage => \@ToolbarWithoutImage,
PictureUploadAction => $PictureUploadAction,
Type => $RichTextType,
EditorStylesPath => $ConfigObject->Get("Frontend::RichTextEditorStyles"),
ContentStylesPath => $ConfigObject->Get("Frontend::RichTextArticleStyles"),
CustomCSS => $ConfigObject->Get("Frontend::RichText::DefaultCSS"),
Plugins => \@Plugins,
Toolbar => \@Toolbar,
ToolbarWithoutImage => \@ToolbarWithoutImage,
PictureUploadAction => $PictureUploadAction,
Type => $RichTextType,
EditorStylesPath => $ConfigObject->Get("Frontend::RichTextEditorStyles"),
ContentStylesPath => $ConfigObject->Get("Frontend::RichTextArticleStyles"),
CustomCSS => $ConfigObject->Get("Frontend::RichText::DefaultCSS"),
HtmlSupportAllowedElements => $ConfigObject->Get("Frontend::RichText::HtmlSupportAllowedElements"),
},
);

Expand Down Expand Up @@ -6639,15 +6640,16 @@ sub CustomerSetRichTextParameters {
Lang => {
SplitQuote => $LanguageObject->Translate('Split Quote'),
},
Plugins => \@Plugins,
Toolbar => \@Toolbar,
ToolbarWithoutImage => \@ToolbarWithoutImage,
ToolbarMidi => \@ToolbarMidi,
ToolbarMini => \@ToolbarMini,
PictureUploadAction => $PictureUploadAction,
EditorStylesPath => $ConfigObject->Get("CustomerFrontend::RichTextEditorStyles"),
ContentStylesPath => $ConfigObject->Get("CustomerFrontend::RichTextArticleStyles"),
CustomCSS => $ConfigObject->Get("CustomerFrontend::RichText::DefaultCSS"),
Plugins => \@Plugins,
Toolbar => \@Toolbar,
ToolbarWithoutImage => \@ToolbarWithoutImage,
ToolbarMidi => \@ToolbarMidi,
ToolbarMini => \@ToolbarMini,
PictureUploadAction => $PictureUploadAction,
EditorStylesPath => $ConfigObject->Get("CustomerFrontend::RichTextEditorStyles"),
ContentStylesPath => $ConfigObject->Get("CustomerFrontend::RichTextArticleStyles"),
CustomCSS => $ConfigObject->Get("CustomerFrontend::RichText::DefaultCSS"),
HtmlSupportAllowedElements => $ConfigObject->Get("CustomerFrontend::RichText::HtmlSupportAllowedElements"),
},
);

Expand Down
29 changes: 6 additions & 23 deletions var/httpd/htdocs/js/Core.UI.RichTextEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,32 +190,15 @@ Core.UI.RichTextEditor = (function (TargetNS) {
content: UserLanguage
},
htmlSupport: {
allow: [
{
name: 'span',
attributes: true,
classes: true,
styles: true
},
{
name: 'cite',
attributes: true,
classes: true,
styles: true
},
{
name: 'style',
// elements configurable via Frontend::RichText::HtmlSupportAllowedElements
allow: (Core.Config.Get('RichText.HtmlSupportAllowedElements') || ['span', 'cite', 'style', 'table']).map(function (ElementName) {
return {
name: ElementName,
attributes: true,
classes: true,
styles: true
},
{
name: 'table',
attributes: true,
classes: true,
styles: true
},
],
};
}),
disallow: [
{
styles: {
Expand Down