From b90138b717ca44c5b48cd3318dd621b0c5f9a887 Mon Sep 17 00:00:00 2001
From: Henning Leutz <leutz@pcsg.de>
Date: Thu, 8 Nov 2018 11:50:22 +0100
Subject: [PATCH] feat: fix: refactor: quiqqer/quiqqer#783

---
 bin/backend/utils/openSettings.js | 18 ++++++++++++++++++
 locale.xml                        |  9 +++++++++
 settings.xml                      | 14 ++++++++++++--
 3 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 bin/backend/utils/openSettings.js

diff --git a/bin/backend/utils/openSettings.js b/bin/backend/utils/openSettings.js
new file mode 100644
index 0000000..90399ab
--- /dev/null
+++ b/bin/backend/utils/openSettings.js
@@ -0,0 +1,18 @@
+/**
+ * @module package/quiqqer/ckeditor4/bin/backend/utils/openSettings
+ * @author www.pcsg.de (Henning Leutz)
+ */
+define('package/quiqqer/ckeditor4/bin/backend/utils/openSettings', function () {
+    "use strict";
+
+    return function (Panel) {
+        require([
+            'controls/editors/Settings',
+            'utils/Panels'
+        ], function (Editor, PanelUtils) {
+            PanelUtils.openPanelInTasks(new Editor());
+        });
+
+        Panel.getCategoryBar().getChildren()[0].click();
+    };
+});
\ No newline at end of file
diff --git a/locale.xml b/locale.xml
index cabaf18..8603831 100644
--- a/locale.xml
+++ b/locale.xml
@@ -10,6 +10,10 @@
             <de><![CDATA[Integration des CKEditor in QUIQQER.]]></de>
             <en><![CDATA[Integrate the CKEditor into QUIQQER.]]></en>
         </locale>
+        <locale name="editors.settings.title">
+            <de><![CDATA[Inhaltseditor (CKEditor)]]></de>
+            <en><![CDATA[Content editor (CKEditor)]]></en>
+        </locale>
         <locale name="exception.plugin.activate.plugin.not.found">
             <de><![CDATA[Das angegeben Plugin wurde nicht gefunden.]]></de>
             <en><![CDATA[The provided plugin was not found.]]></en>
@@ -118,6 +122,11 @@
             </en>
         </locale>
 
+        <locale name="editors.settings.toolbars">
+            <de><![CDATA[Toolbar Verwaltung]]></de>
+            <en><![CDATA[Toolbar Administration]]></en>
+        </locale>
+
         <!-- Permissions -->
         <locale name="permission.quiqqer.editors.ckeditor._header">
             <de><![CDATA[CKEditor]]></de>
diff --git a/settings.xml b/settings.xml
index 7d1584d..f556e78 100644
--- a/settings.xml
+++ b/settings.xml
@@ -13,7 +13,9 @@
 
 
         <window>
-            <title>CKEditor</title>
+            <title>
+                <locale group="quiqqer/ckeditor4" var="editors.settings.title"/>
+            </title>
             <params>
                 <icon>fa fa-file-text</icon>
             </params>
@@ -48,11 +50,19 @@
                                type="hidden"
                                data-qui="package/quiqqer/ckeditor4/bin/backend/controls/settings/Plugins"
                         />
-
                     </settings>
+                </category>
 
+                <category name="toolbars"
+                          require="package/quiqqer/ckeditor4/bin/backend/utils/openSettings"
+                >
+                    <text>
+                        <locale group="quiqqer/ckeditor4" var="editors.settings.toolbars"/>
+                    </text>
+                    <icon>fa fa-font</icon>
                 </category>
 
+
             </categories>
         </window>
 
-- 
GitLab