8
0

[Changed] engine handler

adjust it for twit ( no safe changes! )
Dieser Commit ist enthalten in:
MaxBuhe01 2024-09-02 22:58:49 +02:00
Ursprung ce05a811a9
Commit 8392de0566
2 geänderte Dateien mit 16 neuen und 15 gelöschten Zeilen

Datei anzeigen

@ -38,7 +38,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
public $filenameExtension = 'pdf';
/** @var Smarty */
public $oSmarty;
public $oTemplateEngine;
/** @var string */
public $filename;
@ -55,7 +55,8 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
->get(TemplateRendererBridgeInterface::class)
->getTemplateRenderer();
$this->oSmarty = $oTemplateRenderer->getTemplateEngine()->getSmarty();
//ToDo: hier nochmal prüfen, wie das mit smarty aussieht!
$this->oTemplateEngine = $oTemplateRenderer->getTemplateEngine();
}
public function runPreAction()
@ -161,15 +162,15 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
/**
* @param int $iSelLang
*/
public function setSmartyVars($iSelLang)
public function setTemplateEngineVars($iSelLang)
{
unset($iSelLang);
$this->oSmarty->assign('config', Registry::getConfig());
$this->oSmarty->assign('viewConfig', Registry::getConfig()->getActiveView()->getViewConfig());
$this->oSmarty->assign('shop', Registry::getConfig()->getActiveShop());
$this->oSmarty->assign('lang', Registry::getLang());
$this->oSmarty->assign('document', $this);
$this->oTemplateEngine->addGlobal('config', Registry::getConfig());
$this->oTemplateEngine->addGlobal('viewConfig', Registry::getConfig()->getActiveView()->getViewConfig());
$this->oTemplateEngine->addGlobal('shop', Registry::getConfig()->getActiveShop());
$this->oTemplateEngine->addGlobal('lang', Registry::getLang());
$this->oTemplateEngine->addGlobal('document', $this);
}
/**
@ -188,9 +189,9 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
$currTplLang = $lang->getTplLanguage();
$lang->setTplLanguage($iSelLang);
$this->setSmartyVars($iSelLang);
$this->setTemplateEngineVars($iSelLang);
$content = $this->oSmarty->fetch($this->getTemplate());
$content = $this->oTemplateEngine->render($this->getTemplate());
$lang->setTplLanguage($currTplLang);

Datei anzeigen

@ -57,19 +57,19 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
* @param int $iSelLang
* @throws InvalidArgumentException
*/
public function setSmartyVars($iSelLang)
public function setTemplateEngineVars($iSelLang)
{
parent::setSmartyVars($iSelLang);
parent::setTemplateEngineVars($iSelLang);
$this->oSmarty->assign('order', $this->getOrder());
$this->oTemplateEngine->addGlobal('order', $this->getOrder());
$oUser = oxNew(User::Class);
$oUser->load($this->getOrder()->getFieldData('oxuserid'));
$this->oSmarty->assign('user', $oUser);
$this->oTemplateEngine->addGlobal('user', $oUser);
$oPayment = oxNew(Payment::class);
$oPayment->loadInLang($iSelLang, $this->getOrder()->getFieldData('oxpaymenttype'));
$this->oSmarty->assign('payment', $oPayment);
$this->oTemplateEngine->addGlobal('payment', $oPayment);
}
/**