Compare commits

..

31 Commits

Author SHA1 Message Date
723df77a0e fix wrong admin menu section
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2024-12-12 09:23:38 +01:00
7d8d6a4fc3 update version information 2024-12-05 12:21:56 +01:00
a47d69b294 parse manufacturer longdesc through Smarty 2024-12-05 12:15:33 +01:00
81b48e7f58 generate field long name by shop method, assert return type 2024-12-05 12:13:37 +01:00
d7607ac7e2 remove unused assignment 2024-12-05 12:12:44 +01:00
7bc04bed10 update version information 2024-11-26 11:13:54 +01:00
73b378dd2c update README 2024-11-26 11:05:49 +01:00
c312b9b4ad rename incorrect language files by mistake ¯\(°_o)/¯ 2024-11-22 19:56:43 +01:00
a142cf8a7d
adjust version information 2024-11-21 20:39:37 +01:00
1dd784da4c
change logo 2024-11-21 20:29:39 +01:00
f32d0f5389
make displaying manufacturer information on manufacturer list page configurable 2024-11-21 20:28:16 +01:00
ca0770824d decode longdesc for manufacturer list page 2024-11-21 16:50:58 +01:00
b8a6e7e0e2 use customized tab description instead of shared term 2024-11-21 13:50:00 +01:00
6c00b79119 fix links in changelog 2024-11-21 13:27:08 +01:00
32eba8f6fe adjust version information 2024-11-21 11:47:00 +01:00
9de7f7e096 improve manufacturer block content 2024-11-21 11:20:53 +01:00
4777681f2d fix WYSIWYG editor content 2024-11-21 10:14:12 +01:00
e3ff45716a fix CHANGELOG 2024-11-21 08:03:40 +01:00
d973b37cb6 adjust version information 2024-11-19 10:53:13 +01:00
ef59e0a090 improve code style by CS Fixer 2024-11-19 10:50:33 +01:00
e4bc788538 add noencode 2024-11-19 09:57:38 +01:00
23cfaf0c32 improve code style 2024-11-19 09:54:00 +01:00
3a04e15579 don't hide "save" button on larger input form 2024-11-19 09:48:33 +01:00
221445573c show no content if it contains only empty elements 2024-11-19 09:47:27 +01:00
0f17c8726d fix installation instructions 2024-11-19 08:53:01 +01:00
4723b6ab4d adjust version information 2024-11-18 16:02:35 +01:00
f2dbf59717 change description property name to lowercase (UC is not allowed in OXID), fix HTML entity encode 2024-11-18 15:58:13 +01:00
20d9dd83a6 make displaying manufacturer tab on details page configurable 2024-11-18 13:41:28 +01:00
bcc215238a display manufacturer content as additional tab on article details page 2024-11-18 12:04:53 +01:00
e80d8e87f3 show manufacturer on article details page if manufacturer hasn't an icon 2024-11-18 11:18:31 +01:00
214bee4a2e update installation instructions 2024-11-18 10:54:56 +01:00
24 changed files with 141 additions and 466 deletions

View File

@ -17,12 +17,11 @@ declare(strict_types=1);
namespace D3\ManufacturerInformation\Application\Controller\Admin; namespace D3\ManufacturerInformation\Application\Controller\Admin;
use D3\ManufacturerInformation\Application\Model\Constants;
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc; use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
use Exception;
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController; use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
use OxidEsales\Eshop\Application\Model\Manufacturer; use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
use stdClass;
class ManufacturerInfoLongdesc extends AdminDetailsController class ManufacturerInfoLongdesc extends AdminDetailsController
{ {
@ -33,13 +32,12 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
{ {
parent::render(); 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(); $sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($sOXID) && $sOXID != "-1") { if (isset($sOXID) && $sOXID != "-1") {
// load object // load object
$d3manufacturerlang = Registry::getRequest()->getRequestEscapedParameter("catlang"); $d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang");
if (!isset($d3manufacturerlang)) { if (!isset($d3manufacturerlang)) {
$d3manufacturerlang = $this->_iEditLang; $d3manufacturerlang = $this->_iEditLang;
@ -54,28 +52,28 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
$this->_aViewData['readonly'] = true; $this->_aViewData['readonly'] = true;
} }
foreach (Registry::getLang()->getLanguageNames() as $id => $language) { foreach (\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames() as $id => $language) {
$oLang = new stdClass(); $oLang = new \stdClass();
$oLang->sLangDesc = $language; $oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang); $oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang; $this->_aViewData["otherlang"][$id] = clone $oLang;
} }
} }
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, $oManufacturer->getD3LongDescTableColumnName(), "list.css"); $this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, "oxmanufacturers__d3description", "list.tpl.css");
return "@d3manufacturerinformation/admin/d3manufacturerlongdesc"; return "d3manufacturerlongdesc.tpl";
} }
/** /**
* @return void * @return void
* @throws Exception * @throws \Exception
*/ */
public function save(): void public function save()
{ {
parent::save(); parent::save();
$iManufacturerLang = intval(Registry::getRequest()->getRequestEscapedParameter("catlang")); $iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("catlang"));
$sOXID = $this->getEditObjectId(); $sOXID = $this->getEditObjectId();
$this->setEditObjectId($sOXID); $this->setEditObjectId($sOXID);
@ -94,8 +92,8 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
$aParams = Registry::getRequest()->getRequestEscapedParameter("editval"); $aParams = Registry::getRequest()->getRequestEscapedParameter("editval");
$oManufacturer->assign($aParams); $oManufacturer->assign($aParams);
if (false === is_null($this->d3GetLongdescParamValue($oManufacturer))) { if (false === is_null($this->d3GetLongdescParamValue())) {
$oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue($oManufacturer)); $oManufacturer->d3SetLongdesc($this->d3GetLongdescParamValue());
$oManufacturer->save(); $oManufacturer->save();
} }
} }
@ -103,7 +101,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
/** /**
* @return string * @return string
*/ */
public function d3GetLongdescParamValue(Manufacturer $oManufacturer): string public function d3GetLongdescParamValue(): string
{ {
return (string) Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description']; return (string) Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
} }
@ -116,7 +114,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
* *
* @return mixed * @return mixed
*/ */
protected function processLongDesc($sValue): mixed protected function _processLongDesc($sValue)
{ {
$aSearch = ['&amp;nbsp;', '&amp;', '&quot;', '&lang=', '<p>&nbsp;</p>', '<p>&nbsp; </p>']; $aSearch = ['&amp;nbsp;', '&amp;', '&quot;', '&lang=', '<p>&nbsp;</p>', '<p>&nbsp; </p>'];
$aReplace = ['&nbsp;', '&', '"', '&amp;lang=', '', '']; $aReplace = ['&nbsp;', '&', '"', '&amp;lang=', '', ''];

View File

@ -20,8 +20,8 @@ $sLangName = "Deutsch";
$aLang = [ $aLang = [
'charset' => 'UTF-8', 'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Text', 'mxd3manufacturerinfolongdesc' => 'Langtext',
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings', 'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'show existing manufacturer texts on item details page as a tab', 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page', 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen',
]; ];

View File

@ -20,8 +20,8 @@ $sLangName = "Deutsch";
$aLang = [ $aLang = [
'charset' => 'UTF-8', 'charset' => 'UTF-8',
'mxd3manufacturerinfolongdesc' => 'Langtext', 'mxd3manufacturerinfolongdesc' => 'Text',
'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Einstellungen', 'SHOP_MODULE_GROUP_d3manufacturerinformation_main' => 'Settings',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'vorhandene Herstellertexte auf Artikeldetails als Tab anzeigen', 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnDetailsPage' => 'show existing manufacturer texts on item details page as a tab',
'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'Herstellertexte auf Herstellerseite anzeigen', 'SHOP_MODULE_d3manufacturerinformation_showManufacturertextOnManufacturerPage' => 'show manufacturer texts on manufacturer page',
]; ];

View File

@ -25,7 +25,7 @@
<input type="hidden" name="editlanguage" value="[{$editlanguage}]"> <input type="hidden" name="editlanguage" value="[{$editlanguage}]">
</form> </form>
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__d3description' );" style="padding: 0px;margin: 0px;height:0px;"> <form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__d3description' );" style="padding: 0;margin: 0;height:0;">
[{$oViewConf->getHiddenSid()}] [{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc"> <input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
<input type="hidden" name="fnc" value=""> <input type="hidden" name="fnc" value="">

View File

@ -1,27 +0,0 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = [
'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',
];

View File

@ -1,27 +0,0 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = [
'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',
];

View File

@ -1,14 +1,12 @@
[{$smarty.block.parent}] [{$smarty.block.parent}]
[{assign var="registry" value="\OxidEsales\Eshop\Core\Registry"|@oxNew}]
[{assign var="oConfig" value=$registry->getConfig()}]
[{assign var="oManufacturer" value=$oView->getManufacturer()}] [{assign var="oManufacturer" value=$oView->getManufacturer()}]
[{if $oManufacturer && $oManufacturer->getId()}] [{if $oManufacturer && $oManufacturer->getId()}]
[{assign var="oConfig" value=$oViewConf->getConfig()}]
[{assign var="sShopURL" value=$oConfig->getConfigParam('sShopURL')}] [{assign var="sShopURL" value=$oConfig->getConfigParam('sShopURL')}]
[{assign var="description" value=$oManufacturer->d3GetLongdesc()}] [{assign var="description" value=$oManufacturer->d3GetLongdesc()}]
[{if $oConfig->d3GetBoolModuleSettingByName('_showManufacturertextOnDetailsPage') && $description|strip_tags|trim}] [{if $oConfig->getConfigParam('d3manufacturerinformation_showManufacturertextOnDetailsPage') && $description->rawValue|strip_tags|trim}]
[{capture append="tabs"}]<a href="#manufacturertab" class="nav-link[{if $blFirstTab}] active[{/if}]" data-toggle="tab">[{oxmultilang ident="D3_MANUFACTURERINFO_TAB"}]</a>[{/capture}] [{capture append="tabs"}]<a href="#manufacturertab" class="nav-link[{if $blFirstTab}] active[{/if}]" data-toggle="tab">[{oxmultilang ident="D3_MANUFACTURERINFO_TAB"}]</a>[{/capture}]
[{capture append="tabsContent"}] [{capture append="tabsContent"}]
<div id="manufacturertab" class="tab-pane[{if $blFirstTab}] active[{/if}]"> <div id="manufacturertab" class="tab-pane[{if $blFirstTab}] active[{/if}]">

View File

@ -4,52 +4,35 @@ 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/), 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). 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.1.0.0...rel_2.x) ## [unreleased](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.4.1...rel_1.1.x)
## [2.0.3.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.2.0...2.0.3.0) - 2024-12-19 ## [1.1.4.1](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.4.0...1.1.4.1) - 2024-12-12
### 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 ### Fixed
- template code - fix wrong admin menu section
- module image file
### Added
- Config method and extension
- missing twig translation
## [2.0.1.0](https://git.d3data.de/D3Private/manufacturer-information/compare/2.0.0.0...2.0.1.0) - 2024-11-20 ## [1.1.4.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.3.1...1.1.4.0) - 2024-12-05
### Added
- longdesc will parsed by Smarty
## [1.1.3.1](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.3.0...1.1.3.1) - 2024-11-26
### Fixed ### Fixed
- show hidden save button - rename language files
- installation instructions
- show manufacturer link on article details page, if manufacturer hasn't an icon ### Changed
- prevent encoding HTML entities - switch to open source
## [1.1.3.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.2.1...1.1.3.0) - 2024-11-22
### Fixed
- content encoding on manufacturers list page
### Added ### Added
- display manufacturer content as additional tab on article details page - displaying content on manufacturers list page configurable
- make displaying manufacturer tab on details page configurable
- hide empty HTML elements content
## [2.0.0.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.2.1...2.0.0.0) - 2024-11-16
### Added
- installability OXID 7.0 - 7.1
## [1.1.2.1](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.2.0...1.1.2.1) - 2024-11-21 ## [1.1.2.1](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.2.0...1.1.2.1) - 2024-11-21
### Fixed ### Fixed
- show hidden save button - tab class for Wave based theme
- installation instructions - encoding error when using the WYSIWYG editor
- show manufacturer link on article details page, if manufacturer hasn't an icon
- prevent encoding HTML entities
### Added
- display manufacturer content as additional tab on article details page
- make displaying manufacturer tab on details page configurable
- hide empty HTML elements content
## [2.0.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.0.0...1.1.0.0) - 2024-11-16
### Added
- installability OXID 7.0 - 7.1
## [1.1.2.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.1.0...1.1.2.0) - 2024-11-19 ## [1.1.2.0](https://git.d3data.de/D3Private/manufacturer-information/compare/1.1.1.0...1.1.2.0) - 2024-11-19
### Fixed ### Fixed

View File

@ -16,22 +16,8 @@
namespace D3\ManufacturerInformation\Modules\Application\Model{ namespace D3\ManufacturerInformation\Modules\Application\Model{
use OxidEsales\Eshop\Application\Model\Manufacturer; use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList;
class D3ManufacturerLongDesc_parent extends Manufacturer class D3ManufacturerLongDesc_parent extends Manufacturer
{ {
} }
class ManufacturerInfoList_parent extends ManufacturerList
{
}
}
namespace D3\ManufacturerInformation\Modules\Core{
use OxidEsales\Eshop\Core\Config;
class ManufacturerConfig_parent extends Config
{
}
} }

View File

@ -18,6 +18,7 @@ declare(strict_types=1);
namespace D3\ManufacturerInformation\Modules\Application\Model; namespace D3\ManufacturerInformation\Modules\Application\Model;
use D3\ManufacturerInformation\Application\Model\Constants; use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Core\Field; use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
@ -25,7 +26,7 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
{ {
/** /**
* @param string $sValue * @param string $sValue
* @return bool * @return void
*/ */
public function d3SetLongdesc(string $sValue): bool public function d3SetLongdesc(string $sValue): bool
{ {
@ -42,20 +43,11 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
} }
/** /**
* @return field * @return Field
*/ */
public function d3GetLongdesc(): field public function d3GetLongdesc(): Field
{ {
$longName = $this->getFieldLongName(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME); $longName = $this->_getFieldLongName(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
return $this->$longName ?: oxNew(Field::class); return $this->$longName ?: oxNew(Field::class);
} }
/**
* @return string
*/
public function getD3LongDescTableColumnName(): string
{
return $this->getViewName(true).'__'.Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME;
}
} }

View File

@ -17,15 +17,11 @@ declare(strict_types=1);
namespace D3\ManufacturerInformation\Modules\Application\Model; namespace D3\ManufacturerInformation\Modules\Application\Model;
use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\Eshop\Application\Model\Manufacturer; use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList;
use OxidEsales\Eshop\Core\Field; use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Core\Registry; 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 class ManufacturerInfoList extends ManufacturerInfoList_parent
{ {
@ -33,33 +29,27 @@ class ManufacturerInfoList extends ManufacturerInfoList_parent
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer * @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
* @return void * @return void
*/ */
protected function addCategoryFields($oManufacturer): void protected function _addCategoryFields($oManufacturer)
{ {
parent::addCategoryFields($oManufacturer); parent::_addCategoryFields($oManufacturer);
/** @var ModuleSettingService $setting */ if (Registry::getConfig()->getConfigParam('d3manufacturerinformation_showManufacturertextOnManufacturerPage')) {
$setting = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class); /** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */
if ($setting->getBoolean('d3manufacturerinformation_showManufacturertextOnManufacturerPage', 'd3manufacturerinformation')) {
/** @var UtilsView $oUtilsView */
$oUtilsView = Registry::getUtilsView(); $oUtilsView = Registry::getUtilsView();
$longdesc = $oManufacturer->d3GetLongdesc()->getRawValue() ?? ''; $longdesc = $oManufacturer->d3GetLongdesc()->getRawValue() ?? '';
$deactivateSmarty = Registry::getConfig()->getConfigParam('deactivateSmartyForCmsContent'); $deactivateSmarty = Registry::getConfig()->getConfigParam('deactivateSmartyForCmsContent');
$processLongDescriptions = Registry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty'); $processLongDescriptions = Registry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty');
if (!$deactivateSmarty && $processLongDescriptions) { if (!$deactivateSmarty && $processLongDescriptions) {
$longdesc = $this->getRenderer()->renderFragment( $longdesc = $oUtilsView->parseThroughSmarty(
$longdesc, $longdesc,
$oManufacturer->getId() . $oManufacturer->getLanguage(), $oManufacturer->getId() . $oManufacturer->getLanguage(),
[], null,
true true
) ?? ''; ) ?? '';
} }
$oManufacturer->oxcategories__oxlongdesc = new Field(html_entity_decode($longdesc), Field::T_RAW); $oManufacturer->oxcategories__oxlongdesc = new Field(html_entity_decode($longdesc), Field::T_RAW);
} }
} }
private function getRenderer(): TemplateRendererInterface
{
return $this->getContainer()->get(TemplateRendererBridgeInterface::class)->getTemplateRenderer();
}
} }

View File

@ -1,36 +0,0 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Max Buhe, Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\ManufacturerInformation\Modules\Core;
use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\EshopCommunity\Core\Di\ContainerFacade;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
class ManufacturerConfig extends ManufacturerConfig_parent
{
/**
* @param string $sName
* @return bool
*/
public function d3GetBoolModuleSettingByName(string $sName): bool
{
$moduleSettingService = ContainerFacade::get(ModuleSettingServiceInterface::class);
return $moduleSettingService->getBoolean(Constants::OXID_MODULE_ID.$sName, Constants::OXID_MODULE_ID);
}
}

View File

@ -2,7 +2,10 @@
# ![D3 Logo](https://logos.oxidmodule.com/d3logo_24x24.svg) Herstellerinformationen für OXID eShop # ![D3 Logo](https://logos.oxidmodule.com/d3logo_24x24.svg) Herstellerinformationen für OXID eShop
Fügt die Möglichkeit zur Langtextbeschreibung den Hersteller hinzu Fügt die Möglichkeit zur Langtextbeschreibung den Herstellern hinzu. Die Anzeige der Informationen erfolgt einstellbar auf der Herstellerübersicht und/oder als Infotab an den Artikeln der Herstellers.
**Diese Software wird unter einer kommerziellen Lizenz vertrieben.**
Kontaktieren Sie uns für eine Nutzungslizenz vor der Installation.
## Inhaltsverzeichnis ## Inhaltsverzeichnis
@ -15,10 +18,9 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
Öffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). Führen Sie die folgenden Befehle aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an. Öffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). Führen Sie die folgenden Befehle aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
```bash ```bash
composer config repositories.d3manufacturerinformation vcs https://git.d3data.de/D3Public/manufacturer-information.git composer config repositories.d3manufacturerinformation vcs https://git.d3data.de/D3Public/manufacturer-information.git
composer require d3/manufacturerinformation:"~2.0.0" composer require d3/manufacturerinformation:"~1.1.0"
``` ```
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen. Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
@ -26,18 +28,17 @@ Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code aus
```bash ```bash
./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation ./vendor/bin/oe-eshop-db_migrate migrations:migrate d3manufacturerinformation
./vendor/bin/oe-console oe:module:install source/modules/d3/manufacturerinformation ./vendor/bin/oe-console o:m:i source/modules/d3/manufacturerinformation
./vendor/bin/oe-console oe:module:deactivate d3manufacturerinformation ./vendor/bin/oe-console o:m:deact d3manufacturerinformation
./vendor/bin/oe-console oe:module:activate d3manufacturerinformation ./vendor/bin/oe-console o:m:act d3manufacturerinformation
./vendor/bin/oe-eshop-db_views_generate ./vendor/bin/oe-eshop-db_views_generate
``` ```
Leeren Sie anschließend den Temp Ordner des Shops. Leeren Sie anschließend den Temp Ordner des Shops.
## Lizenz ## Lizenz
(Stand: 19.12.2024) (Stand: 13.11.2024)
``` ```
Copyright (c) D3 Data Development (Inh. Thomas Dartsch) Copyright (c) D3 Data Development (Inh. Thomas Dartsch)

View File

@ -6,9 +6,7 @@
"oxid", "oxid",
"modules", "modules",
"eShop", "eShop",
"d3", "d3"
"manufacturer",
"information"
], ],
"authors": [ "authors": [
{ {
@ -26,21 +24,30 @@
"proprietary" "proprietary"
], ],
"require": { "require": {
"php": "^8.0", "php": "~7.1 || ~8.0",
"oxid-esales/oxideshop-ce": "7.0 - 7.2" "oxid-esales/oxideshop-ce": "v6.6.0 - v6.14.3"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^3.9", "oxid-esales/oxideshop-ce": "~6.14.0",
"phpunit/phpunit": "^9.1.1" "friendsofphp/php-cs-fixer": "^3.9"
},
"extra": {
"oxideshop": {
"blacklist-filter": [
"*.md",
"composer.json",
".php-cs-fixer.php",
"*.neon"
],
"target-directory": "d3/manufacturerinformation"
}
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"D3\\ManufacturerInformation\\": "" "D3\\ManufacturerInformation\\": "../../../source/modules/d3/manufacturerinformation"
} }
}, },
"scripts": { "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_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" "php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/manufacturerinformation/.php-cs-fixer.php"
} }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-15"?> <?xml version="1.0" encoding="ISO-8859-15"?>
<OX> <OX>
<OXMENU id="NAVIGATION_ESHOPADMIN"> <OXMENU id="NAVIGATION_ESHOPADMIN">
<MAINMENU id="mxuadmin"> <MAINMENU id="mxmainmenu">
<SUBMENU id="mxmanufacturer" cl="manufacturer" list="manufacturer_list"> <SUBMENU id="mxmanufacturer" cl="manufacturer" list="manufacturer_list">
<TAB id="mxd3manufacturerinfolongdesc" cl="d3manufacturerinfolongdesc" /> <TAB id="mxd3manufacturerinfolongdesc" cl="d3manufacturerinfolongdesc" />
</SUBMENU> </SUBMENU>

View File

@ -19,29 +19,27 @@ use D3\ManufacturerInformation\Application\Controller\Admin\ManufacturerInfoLong
use D3\ManufacturerInformation\Application\Model\Constants; use D3\ManufacturerInformation\Application\Model\Constants;
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc; use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
use D3\ManufacturerInformation\Modules\Application\Model\ManufacturerInfoList; use D3\ManufacturerInformation\Modules\Application\Model\ManufacturerInfoList;
use D3\ManufacturerInformation\Modules\Core\ManufacturerConfig;
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer; use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
use OxidEsales\Eshop\Application\Model\ManufacturerList as OEManufacturerList; use OxidEsales\Eshop\Application\Model\ManufacturerList as OEManufacturerList;
use OxidEsales\Eshop\Core\Config as OEConfig;
$sMetadataVersion = '2.1'; $sMetadataVersion = '2.1';
$sModuleId = Constants::OXID_MODULE_ID; $sModuleId = Constants::OXID_MODULE_ID;
$logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em">';
/** /**
* Module information * Module information
*/ */
$aModule = [ $aModule = [
'id' => $sModuleId, 'id' => $sModuleId,
'title' => [ 'title' => $logo.' Herstellerinformationen',
'de' => '(D3) Herstellerinformationen',
'en' => '(D3) Manufacturer information',
],
'description' => [ 'description' => [
'de' => 'fügt Informationen der Hersteller zur Artikelliste hinzu', 'de' => 'fügt Informationen der Hersteller zur Artikelliste hinzu',
'en' => 'adds manufacturer information to the article list', 'en' => 'adds manufacturer information to the article list',
], ],
'thumbnail' => 'picture.svg', 'thumbnail' => 'picture.svg',
'version' => '2.0.3.0', 'version' => '1.1.4.1',
'author' => '(D3) Data Development (Inh.: Thomas Dartsch)', 'author' => $logo.' Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com', 'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/', 'url' => 'https://www.oxidmodule.com/',
'controllers' => [ 'controllers' => [
@ -50,10 +48,9 @@ $aModule = [
'extend' => [ 'extend' => [
OEManufacturer::class => D3ManufacturerLongDesc::class, OEManufacturer::class => D3ManufacturerLongDesc::class,
OEManufacturerList::class => ManufacturerInfoList::class, OEManufacturerList::class => ManufacturerInfoList::class,
OEConfig::class => ManufacturerConfig::class,
], ],
'templates' => [ 'templates' => [
'@' . Constants::OXID_MODULE_ID . '/admin/d3manufacturerlongdesc.tpl' => 'views/smarty/admin/d3manufacturerlongdesc.tpl', 'd3manufacturerlongdesc.tpl' => 'd3/manufacturerinformation/Application/views/admin/tpl/d3manufacturer_longdesc.tpl',
], ],
'settings' => [ 'settings' => [
[ [

View File

@ -28,7 +28,7 @@ final class Version20241023154223 extends AbstractMigration
{ {
public function getDescription(): string public function getDescription(): string
{ {
return 'Adds the D3 manufacturer longdesc column'; return 'Add the D3 manufacturer longdesc column';
} }
public function up(Schema $schema): void public function up(Schema $schema): void

View File

@ -28,7 +28,7 @@ final class Version20241028172608 extends AbstractMigration
{ {
public function getDescription(): string public function getDescription(): string
{ {
return 'Adds multilang tables for the D3 manufacturer longdesc'; return 'Add multilang tables for the D3 manufacturer longdesc';
} }
public function up(Schema $schema): void public function up(Schema $schema): void

View File

@ -1,4 +1,4 @@
table_storage: name: D3 manufacturerinformation
migrations_namespace: D3\ManufacturerInformation\Migrations
table_name: d3migrations_manufacturerinformation table_name: d3migrations_manufacturerinformation
migrations_paths: migrations_directory: data
'D3\ManufacturerInformation\Migrations': data

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -1,41 +0,0 @@
{% include "headitem.html.twig" with {title: "GENERAL_ADMIN_TITLE"|translate} %}
<script type="text/javascript">
function loadLang(obj)
{
var langvar = document.getElementById("catlang");
if (langvar != null )
langvar.value = obj.value;
document.myedit.submit();
}
</script>
{% if readonly %}
{% set readonly = "readonly disabled" %}
{% else %}
{% set readonly = "" %}
{% endif %}
<form name="transfer" id="transfer" action="{{ oViewConf.getSelfLink() }}" method="post">
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="oxid" value="{{ oxid }}">
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
<input type="hidden" name="editlanguage" value="{{ editlanguage }}">
</form>
<form name="myedit" id="myedit" action="{{ oViewConf.getSelfLink() }}" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__d3description' );" style="padding: 0px;margin: 0px;height:0px;">
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
<input type="hidden" name="fnc" value="">
<input type="hidden" name="oxid" value="{{ oxid }}">
<input type="hidden" name="voxid" value="{{ oxid }}">
<input type="hidden" name="editval[oxmanufacturers__oxid]" value="{{ oxid }}">
<input type="hidden" name="catlang" value="{{ catlang }}">
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
{% include "include/category_text_editor.html.twig" %}
</form>
{% include "bottomnaviitem.html.twig" %}
{% include "bottomitem.html.twig" %}

View File

@ -1,20 +0,0 @@
{% extends "page/details/inc/accordeon.html.twig" %}
{% block details_longdescription %}
{{ parent() }}
{% set oManufacturer = oView.getManufacturer() %}
{% set sShopURL = config.getConfigParam('sShopURL') %}
{% set description = oManufacturer.d3GetLongdesc() %}
{% if oManufacturer and config.d3GetBoolModuleSettingByName('_showManufacturertextOnDetailsPage') and description|striptags|trim %}
<div class="col-12 col-md-6">
<div id="manufacturer-collapsible" class="h4" data-bs-target="#manufacturer" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="manufacturer">
{{ translate({ ident: "D3_MANUFACTURERINFO_TAB" }) }}
</div>
<div id="manufacturer" class="collapse" aria-labelledby="manufacturer-collapsible">
{{ include(template_from_string(description)) }}
</div>
</div>
{% endif %}
{% endblock %}

View File

@ -1,126 +0,0 @@
{% extends "page/list/list.html.twig" %}
{% block page_list_listhead %}
{% if listType=='manufacturer' or listType=='vendor'%}
<div class="bg-white list-header mb-4">
<div class="container-xxl">
<div class="row">
<div class="col-12{% if actCategory.getIconUrl() %} col-md-6 order-2 order-md-1 {% endif %}">
{% if showPopBreadcrump %}
<div class="row">
{% include "widget/breadcrumb.html.twig" %}
</div>
{% endif %}
<h1{% if actCategory.oxcategories__oxthumb.value and actCategory.getThumbUrl() %} class="text-white"{% endif %}>
{{ actCategory.getTitle() }}
</h1>
{% if actCategory and actCategory.getShortDescription() and oPageNavigation.actPage == 1 %}
<div id="catDescLocator" class="categoryDescription pb-5">
{{ actCategory.getShortDescription()|raw() }}
</div>
{% endif %}
{% if actCategory.oxcategories__oxlongdesc.value and oPageNavigation.actPage == 1 %}
{% block d3_page_list_long_desc %}
<div id="d3catLongDescLocator" class="categoryDescription">
{{ include(template_from_string(actCategory.oxcategories__oxlongdesc)) }}
</div>
{% endblock %}
{% endif %}
</div>
{% if actCategory.getIconUrl() %}
<div class="col-12 col-md-6 order-1 order-md-1 py-4">
<img src="{{ actCategory.getIconUrl()|raw }}" alt="{{ translate({ ident: "MANUFACTURER_IMAGE_ALT", args: actCategory.getTitle() }) }}">
</div>
{% endif %}
</div>
</div>
</div>
{% else %}
<div class="bg-white list-header mb-4">
<div class="container-xxl">
<div class="row">
<div class="col-12{% if actCategory.oxcategories__oxthumb.value and actCategory.getThumbUrl() %} col-md-6 order-2 order-md-1 {% endif %}">
{% if showPopBreadcrump %}
<div class="row">
{% include "widget/breadcrumb.html.twig" %}
</div>
{% endif %}
<h1 class="h2">
{{ oView.getTitle() }}
</h1>
{% if actCategory and actCategory.getShortDescription() and oPageNavigation.actPage == 1 %}
<div id="catDescLocator" class="categoryDescription pb-3">
{{ actCategory.getShortDescription()|raw() }}
</div>
{% endif %}
{% if actCategory.oxcategories__oxlongdesc.value and oPageNavigation.actPage == 1 %}
{% block page_list_long_desc %}
<div id="catLongDescLocator" class="categoryDescription">
{{ include(template_from_string(actCategory.oxcategories__oxlongdesc)) }}
</div>
{% endblock %}
{% endif %}
</div>
{% if actCategory.oxcategories__oxthumb.value and actCategory.getThumbUrl() %}
<div class="col-12 col-md-6 order-1 order-md-1 py-4 text-right">
<img src="{{ actCategory.getThumbUrl()|raw }}" alt="{{ translate({ ident: "CATEGORY_IMAGE_ALT", args: actCategory.oxcategories__oxtitle.value }) }}" class="w-100 img-fluid">
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% if oView.hasVisibleSubCats() %}
<div class="container-xxl">
{% set iSubCategoriesCount = 0 %}
<div class="cat-list mb-4 pb-3">
{% for category in oView.getSubCatList() %}
{% if category.getIsVisible() %}
{% set iSubCategoriesCount = iSubCategoriesCount+1 %}
{% set iconUrl = category.getIconUrl() %}
{% if listType=='manufacturer' or listType=='vendor' %}
{% set iconAltAttribute = translate({ ident: "MANUFACTURER_IMAGE_ALT", args: category.oxcategories__oxtitle.value }) %}
{% else %}
{% set iconAltAttribute = translate({ ident: "CATEGORY_IMAGE_ALT", args: category.oxcategories__oxtitle.value }) %}
{% endif %}
<a href="{{ category.getLink()|raw }}" class="cat-list-item">
{% if iconUrl %}
<img loading="lazy" src="{{ category.getIconUrl()|raw }}" alt="{{ iconAltAttribute }}" class="cat-list-item-img">
{% else %}
<img loading="lazy" src="{{ oViewConf.getImageUrl('subcat-placeholder.png')|raw }}" alt="{{ iconAltAttribute }}" class="cat-list-item-img">
{% endif %}
<span class="cat-list-item-name">
{{ category.oxcategories__oxtitle.value }}
{% if oView.showCategoryArticlesCount() and (category.getNrOfArticles() > 0) %}
<span class="text-muted">({{ category.getNrOfArticles() }})</span>
{% endif %}
</span>
</a>
{% endif %}
{% if category.getContentCats() %}
{% for ocont in category.getContentCats() %}
<a href="{{ ocont.getLink()|raw }}" class="cat-list-item">
{% if listType=='manufacturer' or listType=='vendor' %}
{% set iconAltAttribute = translate({ ident: "MANUFACTURER_IMAGE_ALT", args: category.oxcategories__oxtitle.value }) %}
{% else %}
{% set iconAltAttribute = translate({ ident: "CATEGORY_IMAGE_ALT", args: category.oxcategories__oxtitle.value }) %}
{% endif %}
<img loading="lazy" src="{{ oViewConf.getImageUrl('subcat-placeholder.png')|raw }}" alt="{{ iconAltAttribute }}" class="cat-list-item-img">
<span class="cat-list-item-name">
{{ ocont.oxcontents__oxtitle.value }}
</span>
</a>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% endblock %}