fix namespace, add frontend blocks
Cette révision appartient à :
Parent
05bc43d566
révision
430524a0c7
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace D3\CategoryLongtext\Application\Controller\Admin;
|
||||
namespace D3\CategoryLongtext\Application\Controllers\Admin;
|
||||
|
||||
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Application\Controller\Admin\CategoryText;
|
||||
use OxidEsales\Eshop\Application\Model\Manufacturer;
|
||||
use stdClass;
|
||||
|
||||
abstract class d3manufacturerlongtext extends CategoryText
|
||||
abstract class d3manufacturerlongtext extends AdminDetailsController
|
||||
{
|
||||
public $sFieldName = 'd3longdesc1';
|
||||
public $_sThisTemplate = 'd3_manufacturer_longtext.tpl';
|
||||
@ -44,11 +44,42 @@ abstract class d3manufacturerlongtext extends CategoryText
|
||||
}
|
||||
}
|
||||
|
||||
$this->_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;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace D3\CategoryLongtext\Application\Controller\Admin;
|
||||
namespace D3\CategoryLongtext\Application\Controllers\Admin;
|
||||
|
||||
class d3manufacturerlongtext1 extends d3manufacturerlongtext
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace D3\CategoryLongtext\Application\Controller\Admin;
|
||||
namespace D3\CategoryLongtext\Application\Controllers\Admin;
|
||||
|
||||
class d3manufacturerlongtext2 extends d3manufacturerlongtext
|
||||
{
|
||||
|
@ -1,5 +1,13 @@
|
||||
[{if $oViewConf->getActiveClassName() == 'manufacturerlist' && $actCategory && $actCategory->oxmanufacturers__d3longdesc1->value }]
|
||||
<div class="manufacturerDescription desc1" id="mnfLongDesc1">[{oxeval var=$actCategory->oxmanufacturers__d3longdesc1}]</div>
|
||||
[{/if}]
|
||||
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{if $actCategory && $actCategory->oxcategories__d3longdesc2->value }]
|
||||
[{if $oViewConf->getActiveClassName() == 'alist' && $actCategory && $actCategory->oxcategories__d3longdesc2->value }]
|
||||
<div class="categoryDescription" id="catLongDesc">[{oxeval var=$actCategory->oxcategories__d3longdesc2}]</div>
|
||||
[{/if}]
|
||||
|
||||
[{if $oViewConf->getActiveClassName() == 'manufacturerlist' && $actCategory && $actCategory->oxmanufacturers__d3longdesc2->value }]
|
||||
<div class="manufacturerDescription desc2" id="mnfLongDesc2">[{oxeval var=$actCategory->oxmanufacturers__d3longdesc2}]</div>
|
||||
[{/if}]
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
24
metadata.php
24
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 = <<<FEATURES
|
||||
<ul>
|
||||
<li><a href="https://manager.oxidmodule.com/view.php?id=11735">#11735 - 2. Kategorielangtext</a>
|
||||
<quote>
|
||||
<strong>Hinweise:</strong>'
|
||||
. '<b>Voraussetzungen:</b><br>'
|
||||
. 'Datenbank-Felder: <br>'
|
||||
. '- oxcategories__d3longdesc2<br>'
|
||||
. '- oxcategories__d3longdesc2_1<br>'
|
||||
. '- oxcategories__d3longdesc2_2<br>'
|
||||
. '- oxcategories__d3longdesc2_3<br>'
|
||||
. 'Diese Erweiterung bietet einen zweiten Kategorielangtext.<br>' //
|
||||
. 'Angezeigt wird der zweite Langtext unter der Artikelauflistung in der Listenansicht.
|
||||
<strong>Hinweise:</strong>
|
||||
<b>Voraussetzungen:</b><br>
|
||||
Datenbank-Felder: <br>
|
||||
- oxcategories__d3longdesc2<br>
|
||||
- oxcategories__d3longdesc2_1<br>
|
||||
- oxcategories__d3longdesc2_2<br>
|
||||
- oxcategories__d3longdesc2_3<br>
|
||||
Diese Erweiterung bietet einen zweiten Kategorielangtext.<br>
|
||||
Angezeigt wird der zweite Langtext unter der Artikelauflistung in der Listenansicht.
|
||||
</quote>
|
||||
</li>
|
||||
<li><a href="https://manager.oxidmodule.com/view.php?id=12128">#12128 - Herstellerlangtexte</a></li>
|
||||
@ -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',
|
||||
|
Chargement…
x
Référencer dans un nouveau ticket
Bloquer un utilisateur