Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
df236f4bfd | |||
2af2e3bbcc | |||
ba123ad789 | |||
889f721279 | |||
0f6c3c41af | |||
a4bd6d5bfd | |||
2b0a3dc2a1 | |||
47a0759ced | |||
2838ab70be | |||
3a34f0e5f5 | |||
07224f9530 | |||
b278f8a185 | |||
bb6b465445 | |||
6f7acce537 |
@ -17,11 +17,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\ManufacturerInformation\Application\Controller\Admin;
|
||||
|
||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
||||
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
|
||||
use Exception;
|
||||
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
|
||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use stdClass;
|
||||
|
||||
class ManufacturerInfoLongdesc extends AdminDetailsController
|
||||
{
|
||||
@ -33,12 +34,12 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
||||
parent::render();
|
||||
|
||||
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
|
||||
$this->_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
|
||||
$this->_aViewData['edit'] = $oManufacturer = oxNew(Manufacturer::class);
|
||||
|
||||
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
|
||||
if (isset($sOXID) && $sOXID != "-1") {
|
||||
// load object
|
||||
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang");
|
||||
$d3manufacturerlang = Registry::getRequest()->getRequestEscapedParameter("catlang");
|
||||
|
||||
if (!isset($d3manufacturerlang)) {
|
||||
$d3manufacturerlang = $this->_iEditLang;
|
||||
@ -53,8 +54,8 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
||||
$this->_aViewData['readonly'] = true;
|
||||
}
|
||||
|
||||
foreach (\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames() as $id => $language) {
|
||||
$oLang = new \stdClass();
|
||||
foreach (Registry::getLang()->getLanguageNames() as $id => $language) {
|
||||
$oLang = new stdClass();
|
||||
$oLang->sLangDesc = $language;
|
||||
$oLang->selected = ($id == $this->_iEditLang);
|
||||
$this->_aViewData["otherlang"][$id] = clone $oLang;
|
||||
@ -68,13 +69,13 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function save()
|
||||
public function save(): void
|
||||
{
|
||||
parent::save();
|
||||
|
||||
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang"));
|
||||
$iManufacturerLang = intval(Registry::getRequest()->getRequestEscapedParameter("catlang"));
|
||||
$sOXID = $this->getEditObjectId();
|
||||
$this->setEditObjectId($sOXID);
|
||||
|
||||
@ -104,7 +105,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
||||
*/
|
||||
public function d3GetLongdescParamValue(Manufacturer $oManufacturer): string
|
||||
{
|
||||
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")[$oManufacturer->getD3LongDescTableColumnName()];
|
||||
return (string) Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -115,7 +116,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function processLongDesc($sValue)
|
||||
protected function processLongDesc($sValue): mixed
|
||||
{
|
||||
$aSearch = ['&nbsp;', '&', '"', '&lang=', '<p> </p>', '<p> </p>'];
|
||||
$aReplace = [' ', '&', '"', '&lang=', '', ''];
|
||||
|
@ -18,10 +18,10 @@ $sLangName = "Deutsch";
|
||||
// RESOURCE IDENTITFIER = STRING
|
||||
// -------------------------------
|
||||
$aLang = [
|
||||
'charset' => 'UTF-8',
|
||||
'charset' => 'UTF-8',
|
||||
|
||||
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
|
||||
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
|
||||
];
|
||||
|
@ -18,10 +18,10 @@ $sLangName = "Deutsch";
|
||||
// RESOURCE IDENTITFIER = STRING
|
||||
// -------------------------------
|
||||
$aLang = [
|
||||
'charset' => 'UTF-8',
|
||||
'charset' => 'UTF-8',
|
||||
|
||||
'mxd3manufacturerinfolongdesc' => 'Text',
|
||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'show existing manufacturer texts on item details page as a tab',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
|
||||
'mxd3manufacturerinfolongdesc' => 'Text',
|
||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'show existing manufacturer texts on item details page as a tab',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
|
||||
];
|
||||
|
@ -18,10 +18,10 @@ $sLangName = "Deutsch";
|
||||
// RESOURCE IDENTITFIER = STRING
|
||||
// -------------------------------
|
||||
$aLang = [
|
||||
'charset' => 'UTF-8',
|
||||
'charset' => 'UTF-8',
|
||||
|
||||
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
|
||||
'mxd3manufacturerinfolongdesc' => 'Langtext',
|
||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
|
||||
];
|
||||
|
@ -18,10 +18,10 @@ $sLangName = "Deutsch";
|
||||
// RESOURCE IDENTITFIER = STRING
|
||||
// -------------------------------
|
||||
$aLang = [
|
||||
'charset' => 'UTF-8',
|
||||
'charset' => 'UTF-8',
|
||||
|
||||
'mxd3manufacturerinfolongdesc' => 'Text',
|
||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'display existing manufacturer texts on item details as a tab',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
|
||||
'mxd3manufacturerinfolongdesc' => 'Text',
|
||||
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'display existing manufacturer texts on item details as a tab',
|
||||
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
|
||||
];
|
||||
|
@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [unreleased](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.1.0...rel_2.x)
|
||||
## [unreleased](https://git.d3data.de/D3Private/manufacturer-information/compare/2.1.0.0...rel_2.x)
|
||||
|
||||
## [2.0.3.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.2.0...2.0.3.0) - 2024-12-19
|
||||
### Added
|
||||
- Dynamic Template Renderer Support
|
||||
- Support for OXID 7.2
|
||||
|
||||
## [2.0.2.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.1.0...2.0.2.0) - 2024-11-22
|
||||
### Fixed
|
||||
|
@ -18,7 +18,7 @@ declare(strict_types=1);
|
||||
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
||||
|
||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
||||
use OxidEsales\Eshop\Core\Field;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
||||
@ -42,11 +42,12 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return field
|
||||
*/
|
||||
public function d3GetLongdesc(): string
|
||||
public function d3GetLongdesc(): field
|
||||
{
|
||||
return $this->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
|
||||
$longName = $this->getFieldLongName(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
|
||||
return $this->$longName ?: oxNew(Field::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,4 +57,5 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
|
||||
{
|
||||
return $this->getViewName(true).'__'.Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,11 +17,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\ManufacturerInformation\Modules\Application\Model;
|
||||
|
||||
use D3\ManufacturerInformation\Application\Model\Constants;
|
||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
||||
use OxidEsales\Eshop\Application\Model\ManufacturerList;
|
||||
use OxidEsales\Eshop\Core\Field;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\UtilsView;
|
||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingService;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererInterface;
|
||||
|
||||
class ManufacturerInfoList extends ManufacturerInfoList_parent
|
||||
{
|
||||
@ -29,17 +33,33 @@ class ManufacturerInfoList extends ManufacturerInfoList_parent
|
||||
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
|
||||
* @return void
|
||||
*/
|
||||
protected function addCategoryFields($oManufacturer)
|
||||
protected function addCategoryFields($oManufacturer): void
|
||||
{
|
||||
parent::addCategoryFields($oManufacturer);
|
||||
|
||||
if (Registry::getConfig()->d3GetBoolModuleSettingByName('_showManufacturertextOnManufacturerPage')) {
|
||||
$oManufacturer->oxcategories__oxlongdesc = new Field(
|
||||
html_entity_decode(
|
||||
$oManufacturer->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME) ?? ''
|
||||
),
|
||||
Field::T_RAW
|
||||
);
|
||||
/** @var ModuleSettingService $setting */
|
||||
$setting = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class);
|
||||
|
||||
if ($setting->getBoolean('d3manufacturerinformation_showManufacturertextOnManufacturerPage', 'd3manufacturerinformation')) {
|
||||
/** @var UtilsView $oUtilsView */
|
||||
$oUtilsView = Registry::getUtilsView();
|
||||
$longdesc = $oManufacturer->d3GetLongdesc( )->getRawValue() ?? '';
|
||||
$deactivateSmarty = Registry::getConfig()->getConfigParam('deactivateSmartyForCmsContent');
|
||||
$processLongDescriptions = Registry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty');
|
||||
if (!$deactivateSmarty && $processLongDescriptions) {
|
||||
$longdesc = $this->getRenderer()->renderFragment(
|
||||
$longdesc,
|
||||
$oManufacturer->getId() . $oManufacturer->getLanguage(),
|
||||
[],
|
||||
true
|
||||
) ?? '';
|
||||
}
|
||||
$oManufacturer->oxcategories__oxlongdesc = new Field(html_entity_decode($longdesc), Field::T_RAW);
|
||||
}
|
||||
}
|
||||
|
||||
private function getRenderer(): TemplateRendererInterface
|
||||
{
|
||||
return $this->getContainer()->get(TemplateRendererBridgeInterface::class)->getTemplateRenderer();
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
|
||||
|
||||
|
||||
```bash
|
||||
composer config repositories.d3manufacturerinformation vcs https://git.d3data.de/D3Public/manufacturer-information.git
|
||||
composer require d3/manufacturerinformation:"~2.0.0"
|
||||
```
|
||||
|
||||
@ -25,9 +26,9 @@ Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code aus
|
||||
```bash
|
||||
./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation
|
||||
|
||||
./vendor/bin/oe-console o:m:i source/modules/d3/manufacturerinformation
|
||||
./vendor/bin/oe-console o:m:deact d3manufacturerinformation
|
||||
./vendor/bin/oe-console o:m:act d3manufacturerinformation
|
||||
./vendor/bin/oe-console oe:module:install source/modules/d3/manufacturerinformation
|
||||
./vendor/bin/oe-console oe:module:deactivate d3manufacturerinformation
|
||||
./vendor/bin/oe-console oe:module:activate d3manufacturerinformation
|
||||
|
||||
./vendor/bin/oe-eshop-db_views_generate
|
||||
```
|
||||
@ -36,7 +37,7 @@ Leeren Sie anschließend den Temp Ordner des Shops.
|
||||
|
||||
|
||||
## Lizenz
|
||||
(Stand: 16.11.2024)
|
||||
(Stand: 19.12.2024)
|
||||
|
||||
```
|
||||
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
||||
|
@ -27,11 +27,11 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.0",
|
||||
"oxid-esales/oxideshop-ce": "7.0 - 7.1"
|
||||
"oxid-esales/oxideshop-ce": "7.0 - 7.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"oxid-esales/oxideshop-ce": "~6.14.0",
|
||||
"friendsofphp/php-cs-fixer": "^3.9"
|
||||
"friendsofphp/php-cs-fixer": "^3.9",
|
||||
"phpunit/phpunit": "^9.1.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@ -39,6 +39,8 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"phpunit": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --config=vendor/d3/manufacturerinformation/Tests/ --no-coverage",
|
||||
"phpunit-coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --config=vendor/d3/manufacturerinformation/Tests/ --coverage-html=vendor/d3/manufacturerinformation/tests/result/coverage",
|
||||
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/manufacturerinformation/.php-cs-fixer.php",
|
||||
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/manufacturerinformation/.php-cs-fixer.php"
|
||||
}
|
||||
|
34
metadata.php
34
metadata.php
@ -30,32 +30,32 @@ $sModuleId = Constants::OXID_MODULE_ID;
|
||||
* Module information
|
||||
*/
|
||||
$aModule = [
|
||||
'id' => $sModuleId,
|
||||
'id' => $sModuleId,
|
||||
'title' => [
|
||||
'de' => '(D3) Herstellerinformationen',
|
||||
'en' => '(D3) Manufacturer information',
|
||||
],
|
||||
'description' => [
|
||||
'description' => [
|
||||
'de' => 'fügt Informationen der Hersteller zur Artikelliste hinzu',
|
||||
'en' => 'adds manufacturer information to the article list',
|
||||
],
|
||||
'thumbnail' => 'picture.svg',
|
||||
'version' => '2.0.2.0',
|
||||
'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
'controllers' => [
|
||||
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class,
|
||||
'thumbnail' => 'picture.svg',
|
||||
'version' => '2.0.3.0',
|
||||
'author' => '(D3) Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
'controllers' => [
|
||||
"d3manufacturerinfolongdesc" => ManufacturerInfoLongdesc::class,
|
||||
],
|
||||
'extend' => [
|
||||
OEManufacturer::class => D3ManufacturerLongDesc::class,
|
||||
OEManufacturerList::class => ManufacturerInfoList::class,
|
||||
OEConfig::class => ManufacturerConfig::class,
|
||||
'extend' => [
|
||||
OEManufacturer::class => D3ManufacturerLongDesc::class,
|
||||
OEManufacturerList::class => ManufacturerInfoList::class,
|
||||
OEConfig::class => ManufacturerConfig::class,
|
||||
],
|
||||
'templates' => [
|
||||
'@' . Constants::OXID_MODULE_ID . '/admin/d3manufacturerlongdesc.tpl' => 'views/smarty/admin/d3manufacturerlongdesc.tpl',
|
||||
'templates' => [
|
||||
'@' . Constants::OXID_MODULE_ID . '/admin/d3manufacturerlongdesc.tpl' => 'views/smarty/admin/d3manufacturerlongdesc.tpl',
|
||||
],
|
||||
'settings' => [
|
||||
'settings' => [
|
||||
[
|
||||
'group' => $sModuleId.'_main',
|
||||
'name' => $sModuleId.'_showManufacturertextOnDetailsPage',
|
||||
@ -69,7 +69,7 @@ $aModule = [
|
||||
'value' => true,
|
||||
],
|
||||
],
|
||||
'blocks' => [
|
||||
'blocks' => [
|
||||
[
|
||||
'template' => 'page/details/inc/productmain.tpl',
|
||||
'block' => 'details_productmain_manufacturersicon',
|
||||
|
Reference in New Issue
Block a user