8
0
SecondLongDesc/Application/Controllers/Admin/d3manufacturerlongtext.php

57 Zeilen
1.7 KiB
PHP

<?php
namespace D3\CategoryLongtext\Application\Controller\Admin;
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
{
public $sFieldName = 'd3longdesc1';
public $_sThisTemplate = 'd3_manufacturer_longtext.tpl';
public function render()
{
$tpl = parent::render();
$this->_aViewData['edit'] = $oManufacturer = oxNew(Manufacturer::class);
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($soxId) && $soxId != "-1") {
// load object
$selectedLang = Registry::getRequest()->getRequestEscapedParameter( "selectedlang");
if (!isset($selectedLang)) {
$selectedLang = $this->_iEditLang;
}
$this->_aViewData["selectedlang"] = $selectedLang;
$oManufacturer->loadInLang($selectedLang, $soxId);
//Disable editing for derived items
if ($oManufacturer->isDerived()) {
$this->_aViewData['readonly'] = true;
}
foreach ( 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%", 300, $oManufacturer, "oxmanufacturer__".$this->sFieldName, "list.tpl.css");
return $tpl;
}
public function getFieldName()
{
return $this->sFieldName;
}
}