From 199e63e64b489adc46629ac6e192fbc706afe166 Mon Sep 17 00:00:00 2001 From: MaxBuhe01 Date: Wed, 23 Oct 2024 20:18:20 +0200 Subject: [PATCH] [Added] admin template and controller --- .../Admin/ManufacturerInfoLongdesc.php | 54 +++++++++++++++++++ .../admin/tpl/d3manufacturer_longdesc.tpl | 46 ++++++++++++++++ metadata.php | 10 ++-- 3 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 Application/Controller/Admin/ManufacturerInfoLongdesc.php create mode 100644 Application/views/admin/tpl/d3manufacturer_longdesc.tpl diff --git a/Application/Controller/Admin/ManufacturerInfoLongdesc.php b/Application/Controller/Admin/ManufacturerInfoLongdesc.php new file mode 100644 index 0000000..3e6349d --- /dev/null +++ b/Application/Controller/Admin/ManufacturerInfoLongdesc.php @@ -0,0 +1,54 @@ +_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class); + + $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId(); + if (isset($soxId) && $soxId != "-1") { + // load object + $d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("d3manufacturerlang"); + + if (!isset($d3manufacturerlang)) { + $d3manufacturerlang = $this->_iEditLang; + } + + $this->_aViewData["d3manufacturerlang"] = $d3manufacturerlang; + + $oManufacturer->loadInLang($d3manufacturerlang, $soxId); + + + + //Disable editing for derived items + if ($oManufacturer->isDerived()) { + $this->_aViewData['readonly'] = true; + } + + foreach (\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames() as $id => $language) { + $oLang = new \stdClass(); + $oLang->sLangDesc = $language; + $oLang->selected = ($id == $this->_iEditLang); + $this->_aViewData["otherlang"][$id] = clone $oLang; + } + } + + $this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, "D3DESCRIPTION", "list.tpl.css"); + + return "d3manufacturerlongdesc.tpl"; + } + + public function save() + { + parent::save(); + } +} \ No newline at end of file diff --git a/Application/views/admin/tpl/d3manufacturer_longdesc.tpl b/Application/views/admin/tpl/d3manufacturer_longdesc.tpl new file mode 100644 index 0000000..930fd60 --- /dev/null +++ b/Application/views/admin/tpl/d3manufacturer_longdesc.tpl @@ -0,0 +1,46 @@ +[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}] + + + +[{if $readonly}] + [{assign var="readonly" value="readonly disabled"}] + [{else}] + [{assign var="readonly" value=""}] + [{/if}] + +
+ [{$oViewConf->getHiddenSid()}] + + + +
+ +
+ [{$oViewConf->getHiddenSid()}] + + + + + + + + + [{include file="include/category_text_editor.tpl"}] + +
+ +[{include file="bottomnaviitem.tpl"}] + +[{include file="bottomitem.tpl"}] diff --git a/metadata.php b/metadata.php index 25a9e7f..3aa2732 100644 --- a/metadata.php +++ b/metadata.php @@ -12,8 +12,10 @@ */ declare(strict_types=1); - -$sMetadataVersion = '2.1'; + + use D3\ManufacturerInformation\Application\Controller\Admin\ManufacturerInfoLongdesc; + + $sMetadataVersion = '2.1'; $sModuleId = 'd3manufacturerinformation'; $logo = '(D3)'; @@ -34,7 +36,7 @@ $aModule = [ 'email' => 'support@shopmodule.com', 'url' => 'https://www.oxidmodule.com/', 'controllers' => [ -// 'd3ControllerAlias' => D3\ThisModule\Application\Controller\Admin\d3Controller::class, + "d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class ], 'extend' => [ // \OxidEsales\Eshop\Core\ShopControl::class => \D3\ThisModule\Modules\Core\ShopControl_MyModule::class @@ -44,7 +46,7 @@ $aModule = [ // 'onDeactivate' => '\D3\ThisModule\Setup\Events::onDeactivate', ], 'templates' => [ -// 'd3TemplateAlias.tpl' => 'd3/thismodule/Application/views/admin/tpl/d3Template.tpl', + 'd3manufacturerlongdesc.tpl' => 'd3/manufacturerinformation/Application/views/admin/tpl/d3manufacturer_longdesc.tpl', // 'flow_theme' => [ // 'd3FlowTemplateAlias.tpl' => 'd3/thismodule/Application/views/tpl/d3FlowTheme.tpl', // ],