get dev mode from module setting service

This commit is contained in:
Daniel Seifert 2024-09-09 16:29:13 +02:00
parent ec6a0920d0
commit beaa79c0e9

View File

@ -26,6 +26,8 @@ use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateEngineInterf
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRenderer; use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRenderer;
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface; use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
use OxidEsales\Twig\Resolver\TemplateChain\TemplateNotInChainException; use OxidEsales\Twig\Resolver\TemplateChain\TemplateNotInChainException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Smarty; use Smarty;
use Spipu\Html2Pdf\Exception\Html2PdfException; use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Html2Pdf; use Spipu\Html2Pdf\Html2Pdf;
@ -345,12 +347,16 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
* @param $sFilename * @param $sFilename
* @param $target * @param $target
* @param $html * @param $html
*
* @return string|null * @return string|null
* @throws Html2PdfException * @throws Html2PdfException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function output(Html2Pdf $oPdf, $sFilename, $target, $html) public function output(Html2Pdf $oPdf, $sFilename, $target, $html)
{ {
if ((bool) Registry::getConfig()->getConfigParam('d3PdfDocumentsbDev') === true) { $moduleSettings = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingServiceInterface::class);
if ($moduleSettings->getBoolean( 'd3PdfDocumentsbDev', Constants::OXID_MODULE_ID )) {
return $this->outputDev($oPdf, $sFilename, $target, $html); return $this->outputDev($oPdf, $sFilename, $target, $html);
} else { } else {
return $oPdf->output($sFilename, $target); return $oPdf->output($sFilename, $target);