add optional api key setting

This commit is contained in:
O3-Shop 2023-04-07 22:48:34 +02:00
parent 41f5378b9a
commit a6f16518bc
4 changed files with 21 additions and 6 deletions

View File

@ -132,16 +132,22 @@ dumpvar($sInit.PHP_EOL, 1);
$aInclude = (array) Registry::getConfig()->getGlobalParameter('includes' . $sSuffix); $aInclude = (array) Registry::getConfig()->getGlobalParameter('includes' . $sSuffix);
$aExtjs = Registry::getConfig()->getConfigParam('aTinyMCE_extjs', []);
foreach ($aExtjs as $js) {
$aInclude[3][] = $js;
}
$aInclude[3][] = Registry::getConfig()->getActiveView()->getViewConfig()->getModuleUrl( $aInclude[3][] = Registry::getConfig()->getActiveView()->getViewConfig()->getModuleUrl(
'tinymce-editor', 'tinymce-editor',
'out/tinymce/tinymce.min.js' 'out/tinymce/tinymce.min.js'
); );
$aExtjs = Registry::getConfig()->getConfigParam('aTinyMCE_extjs', []);
foreach ($aExtjs as $js) {
$aInclude[3][] = $js;
}
if (strlen(trim(Registry::getConfig()->getConfigParam('sTinyMCE_apikey', '')))) {
$aInclude[3][] = "https://cdn.tiny.cloud/1/".
trim(Registry::getConfig()->getConfigParam('sTinyMCE_apikey', '')).
"/tinymce/6/plugins.min.js";
}
Registry::getConfig()->setGlobalParameter('includes' . $sSuffix, $aInclude); Registry::getConfig()->setGlobalParameter('includes' . $sSuffix, $aInclude);
} }
} }

View File

@ -29,6 +29,7 @@ $aLang = array(
'HELP_SHOP_MODULE_blTinyMCE_filemanager' => 'Ist diese Option aktiv, können Bilder hochgeladen werden. Der Speicherort ist: out/pictures/wysiwigpro/', 'HELP_SHOP_MODULE_blTinyMCE_filemanager' => 'Ist diese Option aktiv, können Bilder hochgeladen werden. Der Speicherort ist: out/pictures/wysiwigpro/',
'SHOP_MODULE_aTinyMCE_classes' => '<h3>TinyMCE für folgende Backend-Seiten laden:</h3><ul><li>article_main (Artikelbeschreibung)</li><li>content_main (CMS Seiten)</li><li>category_text (Kategorienbeschreibung)</li><li>newsletter_main (Newsletter)</li><li>news_text (Nachrichten-Text)</li></ul>', 'SHOP_MODULE_aTinyMCE_classes' => '<h3>TinyMCE für folgende Backend-Seiten laden:</h3><ul><li>article_main (Artikelbeschreibung)</li><li>content_main (CMS Seiten)</li><li>category_text (Kategorienbeschreibung)</li><li>newsletter_main (Newsletter)</li><li>news_text (Nachrichten-Text)</li></ul>',
'HELP_SHOP_MODULE_aTinyMCE_classes' => 'für die Benutzung von TinyMCE in eigenen Admin Views muss hier die entsprechende Controllerklasse eingetragen werden, dann wird für jedes Textarea je ein Editor erzeugt', 'HELP_SHOP_MODULE_aTinyMCE_classes' => 'für die Benutzung von TinyMCE in eigenen Admin Views muss hier die entsprechende Controllerklasse eingetragen werden, dann wird für jedes Textarea je ein Editor erzeugt',
'SHOP_MODULE_sTinyMCE_apikey' => 'optionaler API-Key aus Ihrer TinyMCE Registrierung',
'SHOP_MODULE_aTinyMCE_extjs' => '<h3>Externe JS Abhängigkeiten</h3>', 'SHOP_MODULE_aTinyMCE_extjs' => '<h3>Externe JS Abhängigkeiten</h3>',
'HELP_SHOP_MODULE_aTinyMCE_extjs' => 'Komplette URL mit http:// bzw https:// falls der Shop über HTTPS läuft.', 'HELP_SHOP_MODULE_aTinyMCE_extjs' => 'Komplette URL mit http:// bzw https:// falls der Shop über HTTPS läuft.',
'SHOP_MODULE_GROUP_tinyMceSettings' => 'TinyMCE Einstellungen &amp; Plugins', 'SHOP_MODULE_GROUP_tinyMceSettings' => 'TinyMCE Einstellungen &amp; Plugins',

View File

@ -29,6 +29,7 @@ $aLang = array(
'HELP_SHOP_MODULE_blTinyMCE_filemanager' => 'When enabled, you can upload pictures into this directory: out/pictures/wysiwigpro/', 'HELP_SHOP_MODULE_blTinyMCE_filemanager' => 'When enabled, you can upload pictures into this directory: out/pictures/wysiwigpro/',
'SHOP_MODULE_aTinyMCE_classes' => '<h3>Enable TinyMCE for following backend pages:</h3><ul><li>article_main (product details)</li><li>content_main (CMS pages)</li><li>category_text (category description)</li><li>newsletter_main (newsletter)</li><li>news_text (news text)</li></ul>', 'SHOP_MODULE_aTinyMCE_classes' => '<h3>Enable TinyMCE for following backend pages:</h3><ul><li>article_main (product details)</li><li>content_main (CMS pages)</li><li>category_text (category description)</li><li>newsletter_main (newsletter)</li><li>news_text (news text)</li></ul>',
'HELP_SHOP_MODULE_aTinyMCE_classes' => 'if you want to use TinyMCE for your custom controllers, you need to enter their class names here.', 'HELP_SHOP_MODULE_aTinyMCE_classes' => 'if you want to use TinyMCE for your custom controllers, you need to enter their class names here.',
'SHOP_MODULE_sTinyMCE_apikey' => 'optional API key from your TinyMCE registration',
'SHOP_MODULE_aTinyMCE_extjs' => '<h3>external JS dependencies</h3> (e.g. for plugins)', 'SHOP_MODULE_aTinyMCE_extjs' => '<h3>external JS dependencies</h3> (e.g. for plugins)',
'HELP_SHOP_MODULE_aTinyMCE_extjs' => 'full URL with http:// or https:// if your shop runs with HTTPS.', 'HELP_SHOP_MODULE_aTinyMCE_extjs' => 'full URL with http:// or https:// if your shop runs with HTTPS.',
'SHOP_MODULE_GROUP_tinyMceSettings' => 'TinyMCE Settings &amp; Plugins', 'SHOP_MODULE_GROUP_tinyMceSettings' => 'TinyMCE Settings &amp; Plugins',

View File

@ -67,12 +67,19 @@ $aModule = [
'value' => true, 'value' => true,
'position' => 2 'position' => 2
], ],
[
'group' => 'tinyMceMain',
'name' => 'sTinyMCE_apikey',
'type' => 'str',
'value' => '',
'position' => 3
],
[ [
'group' => 'tinyMceMain', 'group' => 'tinyMceMain',
'name' => 'aTinyMCE_extjs', 'name' => 'aTinyMCE_extjs',
'type' => 'arr', 'type' => 'arr',
'value' => [], 'value' => [],
'position' => 3 'position' => 4
] ]
] ]
]; ];