From 430524a0c7d7535efce7aa8f0975a356c9911eed Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Wed, 2 Aug 2023 11:35:37 +0200 Subject: [PATCH] fix namespace, add frontend blocks --- .../Admin/d3manufacturerlongtext.php | 39 +++++++++++++++++-- .../Admin/d3manufacturerlongtext1.php | 2 +- .../Admin/d3manufacturerlongtext2.php | 2 +- .../blocks/list_second_longdescription.tpl | 10 ++++- CHANGELOG.md | 4 ++ README.md | 2 +- metadata.php | 24 ++++++------ 7 files changed, 63 insertions(+), 20 deletions(-) diff --git a/Application/Controllers/Admin/d3manufacturerlongtext.php b/Application/Controllers/Admin/d3manufacturerlongtext.php index 72302c7..4d89084 100644 --- a/Application/Controllers/Admin/d3manufacturerlongtext.php +++ b/Application/Controllers/Admin/d3manufacturerlongtext.php @@ -1,13 +1,13 @@ _aViewData["editor"] = $this->_generateTextEditor("100%", 300, $oManufacturer, "oxmanufacturer__".$this->sFieldName, "list.tpl.css"); + $this->_aViewData["editor"] = $this->_generateTextEditor("100%", 300, $oManufacturer, "oxmanufacturers__".$this->sFieldName, "list.tpl.css"); return $tpl; } + public function save() + { + parent::save(); + + $soxId = $this->getEditObjectId(); + $aParams = Registry::getRequest()->getRequestEscapedParameter("editval"); + + $manufacturer = oxNew( Manufacturer::class); + $selectedLang = Registry::getRequest()->getRequestEscapedParameter( "selectedlang"); + $selectedLang = $selectedLang ?: 0; + + if ($soxId != "-1") { + $manufacturer->loadInLang($selectedLang, $soxId); + } else { + $aParams['oxmanufacturers__oxid'] = null; + } + + //Disable editing for derived items + if ($manufacturer->isDerived()) { + return; + } + + $manufacturer->setLanguage(0); + $manufacturer->assign($aParams); + $manufacturer->setLanguage($selectedLang); + $manufacturer->save(); + + // set oxid if inserted + $this->setEditObjectId($manufacturer->getId()); + } + public function getFieldName() { return $this->sFieldName; diff --git a/Application/Controllers/Admin/d3manufacturerlongtext1.php b/Application/Controllers/Admin/d3manufacturerlongtext1.php index c78224c..e626810 100644 --- a/Application/Controllers/Admin/d3manufacturerlongtext1.php +++ b/Application/Controllers/Admin/d3manufacturerlongtext1.php @@ -1,6 +1,6 @@ getActiveClassName() == 'manufacturerlist' && $actCategory && $actCategory->oxmanufacturers__d3longdesc1->value }] +
[{oxeval var=$actCategory->oxmanufacturers__d3longdesc1}]
+[{/if}] + [{$smarty.block.parent}] -[{if $actCategory && $actCategory->oxcategories__d3longdesc2->value }] +[{if $oViewConf->getActiveClassName() == 'alist' && $actCategory && $actCategory->oxcategories__d3longdesc2->value }]
[{oxeval var=$actCategory->oxcategories__d3longdesc2}]
+[{/if}] + +[{if $oViewConf->getActiveClassName() == 'manufacturerlist' && $actCategory && $actCategory->oxmanufacturers__d3longdesc2->value }] +
[{oxeval var=$actCategory->oxmanufacturers__d3longdesc2}]
[{/if}] \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2741f41..dad6871 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://git.d3data.de/D3Private/SecondLongDesc/compare/1.4.0...rel_1.x) +## [1.5.0](https://git.d3data.de/D3Private/SecondLongDesc/compare/1.4.0...1.5.0) - 2023-08-02 +### Added +- 2 longtexts for manufacturers + ## [1.4.0](https://git.d3data.de/D3Private/SecondLongDesc/compare/1.3.0...1.4.0) - 2023-04-04 ### Removed - composer.json version entry diff --git a/README.md b/README.md index 9c0ec8d..a8cf3d4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # ![D3 Logo](https://logos.oxidmodule.com/d3logo_24x24.svg) Zweiter Langtext für OXID eShop -Zweiter Kategorielangtext +zusätzliche Langtexte ## Inhaltsverzeichnis diff --git a/metadata.php b/metadata.php index 40efbdb..44999a0 100644 --- a/metadata.php +++ b/metadata.php @@ -13,8 +13,8 @@ declare(strict_types=1); use D3\CategoryLongtext\Application\Controllers\Admin\AdminDetailsController; -use D3\CategoryLongtext\Application\Controller\Admin\d3manufacturerlongtext1; -use D3\CategoryLongtext\Application\Controller\Admin\d3manufacturerlongtext2; +use D3\CategoryLongtext\Application\Controllers\Admin\d3manufacturerlongtext1; +use D3\CategoryLongtext\Application\Controllers\Admin\d3manufacturerlongtext2; $sMetadataVersion = '2.1'; $sModuleId = 'd3categorylongtext'; @@ -24,15 +24,15 @@ $features = <<
  • #11735 - 2. Kategorielangtext - Hinweise:' - . 'Voraussetzungen:
    ' - . 'Datenbank-Felder:
    ' - . '- oxcategories__d3longdesc2
    ' - . '- oxcategories__d3longdesc2_1
    ' - . '- oxcategories__d3longdesc2_2
    ' - . '- oxcategories__d3longdesc2_3
    ' - . 'Diese Erweiterung bietet einen zweiten Kategorielangtext.
    ' // - . 'Angezeigt wird der zweite Langtext unter der Artikelauflistung in der Listenansicht. + Hinweise: + Voraussetzungen:
    + Datenbank-Felder:
    + - oxcategories__d3longdesc2
    + - oxcategories__d3longdesc2_1
    + - oxcategories__d3longdesc2_2
    + - oxcategories__d3longdesc2_3
    + Diese Erweiterung bietet einen zweiten Kategorielangtext.
    + Angezeigt wird der zweite Langtext unter der Artikelauflistung in der Listenansicht.
  • #12128 - Herstellerlangtexte
  • @@ -62,7 +62,7 @@ $aModule = [ 'template' => 'page/list/list.tpl', 'block' => 'page_list_listbody', 'file' => 'Application/views/blocks/list_second_longdescription.tpl', - ], + ] ], 'events' => [ 'onActivate' => '\D3\CategoryLongtext\Setup\Events::onActivate',