diff --git a/Application/Core/TinyMCE/Configuration.php b/Application/Core/TinyMCE/Configuration.php index 9aa4ccf..0b0bdbc 100644 --- a/Application/Core/TinyMCE/Configuration.php +++ b/Application/Core/TinyMCE/Configuration.php @@ -85,8 +85,10 @@ class Configuration $this->options[$optionInstance->getKey()] = $option; } - public function getConfig() + public function getConfig(): string { + $sConfig = ''; + foreach ($this->options as $param => $value) { $sConfig .= "$param: $value, "; } diff --git a/Application/Core/TinyMCE/Loader.php b/Application/Core/TinyMCE/Loader.php index fb594c2..26b0731 100644 --- a/Application/Core/TinyMCE/Loader.php +++ b/Application/Core/TinyMCE/Loader.php @@ -25,6 +25,7 @@ namespace O3\TinyMCE\Application\Core\TinyMCE; use OxidEsales\Eshop\Application\Model\Content; use OxidEsales\Eshop\Core\Config; +use OxidEsales\Eshop\Core\Exception\FileException; use OxidEsales\Eshop\Core\Language; use OxidEsales\Eshop\Core\Model\BaseModel; use OxidEsales\Eshop\Core\Registry; @@ -42,6 +43,7 @@ class Loader /** * @return string + * @throws FileException */ public function getEditorCode(): string { @@ -74,7 +76,7 @@ class Loader */ protected function contentIsPlain(): bool { - /** @var BaseModel $oEditObject */ + /** @var BaseModel|Content $oEditObject */ $oEditObject = $this->getShopConfig()->getActiveView()->getViewDataElement( "edit" ); return $oEditObject instanceof Content && $oEditObject->isPlain(); } @@ -109,7 +111,6 @@ class Loader $configuration->getConfig(), file_get_contents(__DIR__.'/../../../out/scripts/init.js') ); -dumpvar($sInit.PHP_EOL, 1); $smarty = Registry::getUtilsView()->getSmarty(); $sSufix = ($smarty->_tpl_vars["__oxid_include_dynamic"]) ? '_dynamic' : ''; @@ -123,7 +124,7 @@ dumpvar($sInit.PHP_EOL, 1); /** * @return void - * @throws \oxFileException + * @throws FileException */ protected function registerIncludes(): void { diff --git a/Application/Core/TinyMCE/Options/ExternalPlugins.php b/Application/Core/TinyMCE/Options/ExternalPlugins.php index 293200c..fa1563e 100644 --- a/Application/Core/TinyMCE/Options/ExternalPlugins.php +++ b/Application/Core/TinyMCE/Options/ExternalPlugins.php @@ -51,13 +51,5 @@ class ExternalPlugins extends AbstractOption ); return '{ '.$list.' }'; - - // plugins for newsletter emails - if ( $this->getActiveClassName() === "newsletter_main" ) { - $aPlugins["legacyoutput"] = ""; - $aPlugins["fullpage"] = "fullpage"; - } - - return 350; } } \ No newline at end of file diff --git a/Application/Core/TinyMCE/Options/Language.php b/Application/Core/TinyMCE/Options/Language.php index ab90eea..905a467 100644 --- a/Application/Core/TinyMCE/Options/Language.php +++ b/Application/Core/TinyMCE/Options/Language.php @@ -46,9 +46,7 @@ class Language extends AbstractOption "nl" => "nl", "ru" => "ru" ); - $sLang = $aLang[ $oLang->getLanguageAbbr( $oLang->getTplLanguage() ) ] ?? "en"; - - return $sLang; + return $aLang[ $oLang->getLanguageAbbr( $oLang->getTplLanguage() ) ] ?? "en"; } public function mustQuote(): bool diff --git a/Application/Core/TinyMCE/Options/Promotion.php b/Application/Core/TinyMCE/Options/Promotion.php index b24c87a..2e27455 100644 --- a/Application/Core/TinyMCE/Options/Promotion.php +++ b/Application/Core/TinyMCE/Options/Promotion.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace O3\TinyMCE\Application\Core\TinyMCE\Options; -use OxidEsales\Eshop\Core\Registry; - class Promotion extends AbstractOption { protected string $key = 'promotion'; diff --git a/Application/Core/TinyMCE/Options/QuickbarsInsertToolbar.php b/Application/Core/TinyMCE/Options/QuickbarsInsertToolbar.php index f020fab..5489b2b 100644 --- a/Application/Core/TinyMCE/Options/QuickbarsInsertToolbar.php +++ b/Application/Core/TinyMCE/Options/QuickbarsInsertToolbar.php @@ -26,7 +26,6 @@ namespace O3\TinyMCE\Application\Core\TinyMCE\Options; use O3\TinyMCE\Application\Core\TinyMCE\PluginList; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\PluginInterface; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Quickbars; -use O3\TinyMCE\Application\Core\TinyMCE\Utils; class QuickbarsInsertToolbar extends AbstractOption { @@ -67,4 +66,4 @@ class QuickbarsInsertToolbar extends AbstractOption ) ); } -} \ No newline at end of file +} diff --git a/Application/Core/TinyMCE/Options/Selector.php b/Application/Core/TinyMCE/Options/Selector.php index 6d97839..ce0ee5c 100644 --- a/Application/Core/TinyMCE/Options/Selector.php +++ b/Application/Core/TinyMCE/Options/Selector.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace O3\TinyMCE\Application\Core\TinyMCE\Options; -use O3\TinyMCE\Application\Core\TinyMCE\Loader; - class Selector extends AbstractOption { protected string $key = 'selector'; @@ -33,4 +31,4 @@ class Selector extends AbstractOption { return '"textarea:not(.mceNoEditor)"'; } -} \ No newline at end of file +} diff --git a/Application/Core/TinyMCE/Options/Skin.php b/Application/Core/TinyMCE/Options/Skin.php index fbcc7db..5ac3d44 100644 --- a/Application/Core/TinyMCE/Options/Skin.php +++ b/Application/Core/TinyMCE/Options/Skin.php @@ -24,8 +24,6 @@ declare(strict_types=1); namespace O3\TinyMCE\Application\Core\TinyMCE\Options; use O3\TinyMCE\Application\Core\TinyMCE\Loader; -use OxidEsales\Eshop\Core\Registry; -use OxidEsales\Eshop\Core\UtilsServer; class Skin extends AbstractOption { @@ -44,4 +42,4 @@ class Skin extends AbstractOption { return true; } -} \ No newline at end of file +} diff --git a/Application/Core/TinyMCE/Options/Toolbar.php b/Application/Core/TinyMCE/Options/Toolbar.php index 203e21b..79265d4 100644 --- a/Application/Core/TinyMCE/Options/Toolbar.php +++ b/Application/Core/TinyMCE/Options/Toolbar.php @@ -48,7 +48,7 @@ class Toolbar extends AbstractOption $this->getMultiLineToolbar($toolbarList); } - protected function getSingleLineToolbar($toolbarList) + protected function getSingleLineToolbar($toolbarList): string { $all = []; @@ -90,7 +90,7 @@ class Toolbar extends AbstractOption return $toolbarElements . ' | ' . $pluginToolbarElements; } - protected function getMultiLineToolbar($toolbarList) + protected function getMultiLineToolbar($toolbarList): string { $list = []; @@ -112,7 +112,7 @@ class Toolbar extends AbstractOption } $pluginList = oxNew(PluginList::class); - $list[] = $pluginToolbarElements = implode( + $list[] = implode( ' | ', array_filter( array_map( diff --git a/Application/Core/TinyMCE/PluginList.php b/Application/Core/TinyMCE/PluginList.php index 49287db..368385a 100644 --- a/Application/Core/TinyMCE/PluginList.php +++ b/Application/Core/TinyMCE/PluginList.php @@ -30,7 +30,6 @@ use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Charmap; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Code; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\FullPage; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\FullScreen; -use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Hr; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Image; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Legacyoutput; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Link; @@ -38,7 +37,6 @@ use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Lists; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Media; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Nonbreaking; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Pagebreak; -use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Paste; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Preview; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Quickbars; use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Roxy; @@ -75,4 +73,4 @@ class PluginList 'roxy' => oxNew(Roxy::class), ]; } -} \ No newline at end of file +} diff --git a/Application/Core/TinyMCE/Plugins/FullScreen.php b/Application/Core/TinyMCE/Plugins/FullScreen.php index ed36544..e33ea34 100644 --- a/Application/Core/TinyMCE/Plugins/FullScreen.php +++ b/Application/Core/TinyMCE/Plugins/FullScreen.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace O3\TinyMCE\Application\Core\TinyMCE\Plugins; +use OxidEsales\Eshop\Core\Exception\FileException; use OxidEsales\Eshop\Core\Registry; class FullScreen extends AbstractPlugin @@ -39,6 +40,10 @@ class FullScreen extends AbstractPlugin ]; } + /** + * @return string|null + * @throws FileException + */ public function getScriptPath(): ?string { return Registry::getConfig()->getActiveView()->getViewConfig()->getModuleUrl( diff --git a/Application/Core/TinyMCE/Plugins/Roxy.php b/Application/Core/TinyMCE/Plugins/Roxy.php index 66110fc..397f1a4 100644 --- a/Application/Core/TinyMCE/Plugins/Roxy.php +++ b/Application/Core/TinyMCE/Plugins/Roxy.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace O3\TinyMCE\Application\Core\TinyMCE\Plugins; +use OxidEsales\Eshop\Core\Exception\FileException; use OxidEsales\Eshop\Core\Registry; class Roxy extends AbstractPlugin @@ -32,6 +33,10 @@ class Roxy extends AbstractPlugin return 'roxy'; } + /** + * @return string|null + * @throws FileException + */ public function getScriptPath(): ?string { return Registry::getConfig()->getActiveView()->getViewConfig()->getModuleUrl( diff --git a/Application/Core/TinyMCE/ToolbarList.php b/Application/Core/TinyMCE/ToolbarList.php index 75b7d1b..50acdd6 100644 --- a/Application/Core/TinyMCE/ToolbarList.php +++ b/Application/Core/TinyMCE/ToolbarList.php @@ -26,15 +26,11 @@ namespace O3\TinyMCE\Application\Core\TinyMCE; use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Align; use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Blockquote; use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Color; -use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\CopyPaste; use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Font; use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Blocks; use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Indent; use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Lists; use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\RemoveFormat; -use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Subscript; -use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Superscript; -use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Undo; class ToolbarList { diff --git a/Application/Core/ViewConfig.php b/Application/Core/ViewConfig.php index 7531369..f129a15 100755 --- a/Application/Core/ViewConfig.php +++ b/Application/Core/ViewConfig.php @@ -24,12 +24,14 @@ declare(strict_types=1); namespace O3\TinyMCE\Application\Core; use O3\TinyMCE\Application\Core\TinyMCE\Loader; +use OxidEsales\Eshop\Core\Exception\FileException; use OxidEsales\Eshop\Core\Registry; class ViewConfig extends ViewConfig_parent { /** * @return string + * @throws FileException */ public function loadTinyMce(): string { diff --git a/Application/views/admin/de/module_options.php b/Application/views/admin/de/module_options.php index 2c1a5ab..7d7eebf 100644 --- a/Application/views/admin/de/module_options.php +++ b/Application/views/admin/de/module_options.php @@ -31,6 +31,6 @@ $aLang = array( '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' => '