From db0e810653e4251c50951169d111f7a67bf65671 Mon Sep 17 00:00:00 2001 From: O3-Shop Date: Sun, 2 Apr 2023 23:49:41 +0200 Subject: [PATCH] change namespace --- .../Core/.ide-helper.php => .ide-helper.php | 6 +++-- .../Controller/Admin/TinyFileManager.php | 6 ++--- Application/Controller/Admin/TinyHelper.php | 12 +++++----- Application/Core/ViewConfig.php | 22 ++++++++----------- .../bottomnaviitem_admin_bottomnaviitem.tpl | 1 + composer.json | 2 +- metadata.php | 6 ++--- 7 files changed, 28 insertions(+), 27 deletions(-) rename Application/Core/.ide-helper.php => .ide-helper.php (83%) diff --git a/Application/Core/.ide-helper.php b/.ide-helper.php similarity index 83% rename from Application/Core/.ide-helper.php rename to .ide-helper.php index 3b43b32..db29075 100755 --- a/Application/Core/.ide-helper.php +++ b/.ide-helper.php @@ -19,7 +19,9 @@ * @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3) */ -namespace VanillaThunder\TinyMCE\Application\Core; +namespace O3\TinyMCE\Application\Core { + use OxidEsales\Eshop\Core\ViewConfig; -class_alias(\OxidEsales\EshopCommunity\Core\ViewConfig::class,"VanillaThunder\TinyMCE\Application\Core\ViewConfig_parent"); \ No newline at end of file + class ViewConfig_parent extends ViewConfig {} +} diff --git a/Application/Controller/Admin/TinyFileManager.php b/Application/Controller/Admin/TinyFileManager.php index 8938b62..46da34c 100755 --- a/Application/Controller/Admin/TinyFileManager.php +++ b/Application/Controller/Admin/TinyFileManager.php @@ -19,11 +19,11 @@ * @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3) */ -namespace VanillaThunder\TinyMCE\Application\Controller\Admin; +namespace O3\TinyMCE\Application\Controller\Admin; -use OxidEsales\Eshop\Core\Registry; +use OxidEsales\Eshop\Application\Controller\Admin\AdminController; -class TinyFileManager extends \OxidEsales\Eshop\Application\Controller\Admin\AdminController +class TinyFileManager extends AdminController { protected $_sThisTemplate = "tiny/filemanager.tpl"; diff --git a/Application/Controller/Admin/TinyHelper.php b/Application/Controller/Admin/TinyHelper.php index ad260c2..4931312 100755 --- a/Application/Controller/Admin/TinyHelper.php +++ b/Application/Controller/Admin/TinyHelper.php @@ -19,10 +19,12 @@ * @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3) */ -namespace VanillaThunder\TinyMCE\Application\Controller\Admin; +namespace O3\TinyMCE\Application\Controller\Admin; +use OxidEsales\Eshop\Application\Controller\Admin\AdminController; +use OxidEsales\Eshop\Core\Output; -class TinyHelper extends \OxidEsales\Eshop\Application\Controller\Admin\AdminController +class TinyHelper extends AdminController { protected $_sThisTemplate = "tiny/helper.tpl"; @@ -31,13 +33,13 @@ class TinyHelper extends \OxidEsales\Eshop\Application\Controller\Admin\AdminCon public function render() { - $oOutput = oxRegistry::get("oxOutput"); + /** @var Output $oOutput */ + $oOutput = oxNew(Output::class); $oOutput->setCharset($this->getCharSet()); - $oOutput->setOutputFormat(oxOutput::OUTPUT_FORMAT_JSON); + $oOutput->setOutputFormat(Output::OUTPUT_FORMAT_JSON); $oOutput->sendHeaders(); $oOutput->output('errors', $this->_errors); $oOutput->output('content', $this->_content); exit; } - } diff --git a/Application/Core/ViewConfig.php b/Application/Core/ViewConfig.php index 62ac190..3fd9963 100755 --- a/Application/Core/ViewConfig.php +++ b/Application/Core/ViewConfig.php @@ -19,11 +19,13 @@ * @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3) */ -namespace VanillaThunder\TinyMCE\Application\Core; -use \OxidEsales\Eshop\Core\Registry; +namespace O3\TinyMCE\Application\Core; + +use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\UtilsServer; -/** funtion for adding quotes to config variables +/** + * funtion for adding quotes to config variables * @param $string * @return string */ @@ -305,19 +307,15 @@ copyLongDesc = function(sIdent) { protected function _getTinyToolbarControls() { - $aControls = (method_exists( - get_parent_class(__CLASS__), - __FUNCTION__ - )) ? parent::_getTinyToolbarControls() : array(); + $aControls = []; + return $aControls; } protected function _getTinyExtPlugins() { $aPlugins = Registry::getConfig()->getConfigParam("aTinyMCE_external_plugins"); - if (method_exists(get_parent_class(__CLASS__), __FUNCTION__)) { - $aPlugins = array_merge(parent::_getTinyExtPlugins(), $aPlugins); - } + return $aPlugins; } @@ -327,9 +325,7 @@ copyLongDesc = function(sIdent) { //$oModCfg->get('setting-name', 'module-id'); $aConfig = Registry::getConfig()->getConfigParam("aTinyMCE_config"); - if (method_exists(get_parent_class(__CLASS__), __FUNCTION__)) { - $aConfig = array_merge(parent::_getTinyCustConfig(), $aConfig); - } + return $aConfig; } } diff --git a/Application/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl b/Application/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl index 392151a..b991781 100755 --- a/Application/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl +++ b/Application/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl @@ -1,2 +1,3 @@ [{$smarty.block.parent}] + [{if method_exists($oViewConf,'loadTinyMce') }][{ $oViewConf->loadTinyMce() }][{/if}] \ No newline at end of file diff --git a/composer.json b/composer.json index 2a8d46f..eaa5f84 100755 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "autoload": { "psr-4": { - "VanillaThunder\\TinyMCE\\": "../../../source/modules/o3-shop/tinymce-editor" + "O3\\TinyMCE\\": "../../../source/modules/o3-shop/tinymce-editor" } } } diff --git a/metadata.php b/metadata.php index 29e5d2d..20090fb 100755 --- a/metadata.php +++ b/metadata.php @@ -30,11 +30,11 @@ $aModule = [ 'author' => 'Marat Bedoev, O3-Shop', 'url' => 'https://www.o3-shop.com/', 'extend' => [ - OxidEsales\Eshop\Core\ViewConfig::class => VanillaThunder\TinyMCE\Application\Core\ViewConfig::class + OxidEsales\Eshop\Core\ViewConfig::class => O3\TinyMCE\Application\Core\ViewConfig::class ], 'controllers' => [ - 'tinyfilemanager' => VanillaThunder\TinyMCE\Application\Controller\Admin\TinyFileManager::class, - 'tinyhelper' => VanillaThunder\TinyMCE\Application\Controller\Admin\TinyHelper::class + 'tinyfilemanager' => O3\TinyMCE\Application\Controller\Admin\TinyFileManager::class, + 'tinyhelper' => O3\TinyMCE\Application\Controller\Admin\TinyHelper::class ], 'templates' => [ 'tiny/filemanager.tpl' => 'vt/TinyMCE/Application/views/admin/filemanager.tpl',