Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-769: Reorder and hide for CKEditor toolbar groups and buttons, CustomStyleInline button support #203

Merged
merged 9 commits into from
Oct 13, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class RichText extends AbstractFieldTypeParser
private const ATTRIBUTE_TYPE_STRING = 'string';
private const ATTRIBUTE_TYPE_NUMBER = 'number';

private const TOOLBARS_NODE_KEY = 'toolbars';
public const TOOLBARS_SA_SETTINGS_ID = 'fieldtypes.ezrichtext.' . self::TOOLBARS_NODE_KEY;
private const TOOLBAR_NODE_KEY = 'toolbar';
public const TOOLBARS_SA_SETTINGS_ID = 'fieldtypes.ezrichtext.' . self::TOOLBAR_NODE_KEY;

// constants common for OE custom classes and data attributes configuration
private const ELEMENT_NODE_KEY = 'element';
Expand Down Expand Up @@ -193,11 +193,19 @@ public function addFieldTypeSemanticConfig(NodeBuilder $nodeBuilder)

// RichText Toolbars configuration (defines list of Toolbars and Buttons enabled for current SiteAccess scope)
$nodeBuilder
->arrayNode(self::TOOLBARS_NODE_KEY)
->useAttributeAsKey('name')
->info('List of Toolbars and Buttons enabled for current SiteAccess scope.')
->arrayNode(self::TOOLBAR_NODE_KEY)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This BC break needs to be mentioned in upgrade notes @ezsystems/documentation-team

->useAttributeAsKey('group_name')
->info('List of grouped Toolbars and Buttons enabled for current SiteAccess scope.')
->prototype('array')
->children()
->booleanNode('visible')
->info('Is group visible on toolbar?')
->defaultTrue()
->end()
->integerNode('priority')
->info('Defines order in which group appear (255 .. -255).')
->defaultValue(0)
->end()
->arrayNode('buttons')
->useAttributeAsKey('name')
->prototype('array')
Expand Down Expand Up @@ -265,7 +273,7 @@ public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerIn
$onlineEditorSettingsMap = [
self::CLASSES_NODE_KEY => self::CLASSES_SA_SETTINGS_ID,
self::ATTRIBUTES_NODE_KEY => self::ATTRIBUTES_SA_SETTINGS_ID,
self::TOOLBARS_NODE_KEY => self::TOOLBARS_SA_SETTINGS_ID,
self::TOOLBAR_NODE_KEY => self::TOOLBARS_SA_SETTINGS_ID,
];
foreach ($onlineEditorSettingsMap as $key => $settingsId) {
if (isset($scopeSettings['fieldtypes']['ezrichtext'][$key])) {
Expand Down
4 changes: 4 additions & 0 deletions src/bundle/Resources/config/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ services:
arguments:
$alloyEditorConfiguration: '%ezplatform.ezrichtext.alloy_editor%'

EzSystems\EzPlatformRichText\Configuration\Provider\CKEditor:
arguments:
$customStylesConfiguration: '%ezplatform.ezrichtext.custom_styles%'

EzSystems\EzPlatformRichText\Configuration\AggregateProvider:
arguments:
$providers: !tagged ezplatform.ezrichtext.configuration.provider
Loading