From f2f940bf8ba73dd2af38a6e9dd19ffd8e70c1a28 Mon Sep 17 00:00:00 2001 From: Alexander Schnitzler Date: Mon, 15 Jun 2026 12:27:42 +0200 Subject: [PATCH 1/4] [TASK] Remove view rendering from TcpdfWrapper Rendering content used in pdf files should not take place in the Tcpfd Wrapper but the PdfService itself. This is separation of concerns where the concern of the TcpdfWrapper is to arrange the pdf contents whilst the concern of the PdFServices is to provide rendering configuration and contents to the TcpdfWrapper. Not only does this allow for an easy replacement of the StandaloneView logic, it also allows for an easier exchange of the pdf rendering package, i.e. switching from deprecated tecnickcom/tcpdf to tecnickcom/tc-lib-pdf. --- Classes/Service/PdfService.php | 132 ++++++++++++++++++++++++++++--- Classes/Service/TcpdfWrapper.php | 107 ++++--------------------- 2 files changed, 136 insertions(+), 103 deletions(-) diff --git a/Classes/Service/PdfService.php b/Classes/Service/PdfService.php index c7905a0..35be731 100644 --- a/Classes/Service/PdfService.php +++ b/Classes/Service/PdfService.php @@ -14,12 +14,15 @@ use Extcode\Cart\Domain\Model\Order\Item as OrderItem; use Extcode\CartPdf\Domain\Model\Dto\PdfDemand; use TYPO3\CMS\Core\Http\ApplicationType; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; +use TYPO3\CMS\Fluid\View\StandaloneView; readonly class PdfService implements DocumentRenderServiceInterface { private array $configuration; + private array $viewSettings; public function __construct( private readonly ConfigurationManager $configurationManager, @@ -40,12 +43,78 @@ public function __construct( ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'CartPdf' ); + + $viewSettings = $this->configuration['view'] ?? []; + $this->viewSettings = is_array($viewSettings) ? $viewSettings : []; + } + + public function getStandaloneView( + string $templatePath, + string $templateFileName = 'Default', + string $format = 'html', + ): StandaloneView { + $templatePathAndFileName = $templatePath . $templateFileName . '.' . $format; + + /** @var StandaloneView $view */ + $view = GeneralUtility::makeInstance(StandaloneView::class); + $view->setFormat($format); + + if (!empty($this->viewSettings)) { + $view->setLayoutRootPaths($this->viewSettings['layoutRootPaths']); + $view->setPartialRootPaths($this->viewSettings['partialRootPaths']); + + if ($this->viewSettings['templateRootPaths']) { + foreach ($this->viewSettings['templateRootPaths'] as $pathNameKey => $pathNameValue) { + $templateRootPath = GeneralUtility::getFileAbsFileName( + $pathNameValue + ); + + $completePath = $templateRootPath . $templatePathAndFileName; + + if (file_exists($completePath)) { + $view->setTemplatePathAndFilename($completePath); + } + } + } + } + + return $view; + } + + public function renderStandaloneView( + string $templatePath, + string $type, + array $config, + array $assignToView = [], + ): string { + $view = $this->getStandaloneView($templatePath, ucfirst($type)); + + if (!empty($config['file'])) { + $file = GeneralUtility::getFileAbsFileName($config['file']); + $view->assign('file', $file); + $view->assign('file_base64', base64_encode(file_get_contents($file))); + $view->assign('file_mimetype', mime_content_type($file)); + + if (!empty($config['width'])) { + $view->assign('width', $config['width']); + } + + if (!empty($config['height'])) { + $view->assign('height', $config['height']); + } + } + + $view->assignMultiple($assignToView); + + $content = (string)$view->render(); + return trim(preg_replace('~[\\n]+~', '', $content)); } public function renderDocument(OrderItem $orderItem, string $pdfType): string { $pdfType .= 'Pdf'; - $pdfSettings = $this->configuration[$pdfType]; + $pdfSettings = $this->configuration[$pdfType] ?? []; + $pdfSettings = is_array($pdfSettings) ? $pdfSettings : []; $pdfDemand = PdfDemand::createFromSettings($pdfSettings); $pdf = TcpdfWrapper::createWithTypeAndSettings( @@ -53,6 +122,40 @@ public function renderDocument(OrderItem $orderItem, string $pdfType): string $this->configuration, ); + foreach ($pdfSettings['header']['html'] ?? [] as $partName => $partConfig) { + $assignToView = []; + if ($partName === 'page') { + $assignToView['numPage'] = $pdf->getAliasNumPage(); + $assignToView['numPages'] = $pdf->getAliasNbPages(); + } + + $content = $this->renderStandaloneView( + $pdfSettings['header']['html'][$partName]['templatePath'], + $partName, + $partConfig, + $assignToView, + ); + + $pdf->addHeaderPart($content, $partConfig); + } + + foreach ($pdfSettings['footer']['html'] ?? [] as $partName => $partConfig) { + $assignToView = []; + if ($partName === 'page') { + $assignToView['numPage'] = $pdf->getAliasNumPage(); + $assignToView['numPages'] = $pdf->getAliasNbPages(); + } + + $content = $this->renderStandaloneView( + $pdfSettings['footer']['html'][$partName]['templatePath'], + $partName, + $partConfig, + $assignToView, + ); + + $pdf->addFooterPart($content, $partConfig); + } + if (empty($pdfSettings['header'])) { $pdf->setPrintHeader(false); } else { @@ -110,7 +213,8 @@ public function renderDocument(OrderItem $orderItem, string $pdfType): string foreach ($pdfSettings['letterhead']['html'] as $partName => $partConfig) { $templatePath = '/' . ucfirst($pdfType) . '/Letterhead/'; $assignToView = ['orderItem' => $orderItem]; - $pdf->renderStandaloneView($templatePath, $partName, $partConfig, $assignToView); + $content = $this->renderStandaloneView($templatePath, $partName, $partConfig, $assignToView); + $pdf->writeHtmlCellWithConfig($content, $partConfig); } } @@ -118,7 +222,8 @@ public function renderDocument(OrderItem $orderItem, string $pdfType): string foreach ($pdfSettings['body']['before']['html'] as $partName => $partConfig) { $templatePath = '/' . ucfirst($pdfType) . '/Body/Before/'; $assignToView = ['orderItem' => $orderItem]; - $pdf->renderStandaloneView($templatePath, $partName, $partConfig, $assignToView); + $content = $this->renderStandaloneView($templatePath, $partName, $partConfig, $assignToView); + $pdf->writeHtmlCellWithConfig($content, $partConfig); } } @@ -128,7 +233,8 @@ public function renderDocument(OrderItem $orderItem, string $pdfType): string foreach ($pdfSettings['body']['after']['html'] as $partName => $partConfig) { $templatePath = '/' . ucfirst($pdfType) . '/Body/After/'; $assignToView = ['orderItem' => $orderItem]; - $pdf->renderStandaloneView($templatePath, $partName, $partConfig, $assignToView); + $content = $this->renderStandaloneView($templatePath, $partName, $partConfig, $assignToView); + $pdf->writeHtmlCellWithConfig($content, $partConfig); } } @@ -172,27 +278,27 @@ private function renderCart(TcpdfWrapper $pdf, OrderItem $orderItem, string $pdf $config['spacingY'] = 5; } - $headerOut = $this->renderCartHeader($pdf, $orderItem, $pdfType); - $bodyOut = $this->renderCartBody($pdf, $orderItem, $pdfType); - $footerOut = $this->renderCartFooter($pdf, $orderItem, $pdfType); + $headerOut = $this->renderCartHeader($orderItem, $pdfType); + $bodyOut = $this->renderCartBody($orderItem, $pdfType); + $footerOut = $this->renderCartFooter($orderItem, $pdfType); $content = '' . $headerOut . $bodyOut . $footerOut . '
'; $pdf->writeHtmlCellWithConfig($content, $config); } - private function renderCartHeader(TcpdfWrapper $pdf, OrderItem $orderItem, string $pdfType): string + private function renderCartHeader(OrderItem $orderItem, string $pdfType): string { - $view = $pdf->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Header'); + $view = $this->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Header'); $view->assign('orderItem', $orderItem); $header = $view->render(); return trim(preg_replace('~[\\n]+~', '', $header)); } - private function renderCartBody(TcpdfWrapper $pdf, OrderItem $orderItem, string $pdfType): string + private function renderCartBody(OrderItem $orderItem, string $pdfType): string { - $view = $pdf->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Product'); + $view = $this->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Product'); $view->assign('orderItem', $orderItem); $bodyOut = ''; @@ -207,9 +313,9 @@ private function renderCartBody(TcpdfWrapper $pdf, OrderItem $orderItem, string return $bodyOut; } - private function renderCartFooter(TcpdfWrapper $pdf, OrderItem $orderItem, string $pdfType): string + private function renderCartFooter(OrderItem $orderItem, string $pdfType): string { - $view = $pdf->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Footer'); + $view = $this->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Footer'); $view->assign('orderSettings', $this->configuration[$pdfType]['body']['order']); $view->assign('orderItem', $orderItem); $footer = $view->render(); diff --git a/Classes/Service/TcpdfWrapper.php b/Classes/Service/TcpdfWrapper.php index df0d29b..c07a9b5 100644 --- a/Classes/Service/TcpdfWrapper.php +++ b/Classes/Service/TcpdfWrapper.php @@ -12,20 +12,18 @@ */ use TCPDF; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Fluid\View\StandaloneView; class TcpdfWrapper extends TCPDF { private readonly array $pdfSettings; - private readonly array $viewSettings; + private array $headerParts = []; + private array $footerParts = []; public function __construct( private readonly string $pdfType, array $settings, ) { $this->pdfSettings = $settings[$this->pdfType]; - $this->viewSettings = $settings['view']; parent::__construct(); } @@ -40,6 +38,16 @@ public static function createWithTypeAndSettings( ); } + public function addHeaderPart($content, array $config): void + { + $this->headerParts[] = ['content' => $content, 'config' => $config]; + } + + public function addFooterPart($content, array $config): void + { + $this->footerParts[] = ['content' => $content, 'config' => $config]; + } + public function getCartPdfType(): string { return $this->pdfType; @@ -55,14 +63,8 @@ public function header(): void $this->SetFontSize($this->pdfSettings['fontSize']); } - if (!empty($this->pdfSettings['header']['html'])) { - foreach ($this->pdfSettings['header']['html'] as $partName => $partConfig) { - $this->renderStandaloneView( - $this->pdfSettings['header']['html'][$partName]['templatePath'], - $partName, - $partConfig - ); - } + foreach ($this->headerParts as $headerPart) { + $this->writeHtmlCellWithConfig($headerPart['content'], $headerPart['config']); } if (!empty($this->pdfSettings['header']['line'])) { @@ -88,14 +90,8 @@ public function footer(): void $this->SetFontSize($this->pdfSettings['fontSize']); } - if (!empty($this->pdfSettings['footer']['html'])) { - foreach ($this->pdfSettings['footer']['html'] as $partName => $partConfig) { - $this->renderStandaloneView( - $this->pdfSettings['footer']['html'][$partName]['templatePath'], - $partName, - $partConfig - ); - } + foreach ($this->footerParts as $footerPart) { + $this->writeHtmlCellWithConfig($footerPart['content'], $footerPart['config']); } if (!empty($this->pdfSettings['footer']['line'])) { @@ -111,42 +107,6 @@ public function footer(): void } } - public function renderStandaloneView( - string $templatePath, - string $type, - array $config, - array $assignToView = [] - ): void { - $view = $this->getStandaloneView($templatePath, ucfirst($type)); - - if (!empty($config['file'])) { - $file = GeneralUtility::getFileAbsFileName($config['file']); - $view->assign('file', $file); - $view->assign('file_base64', base64_encode(file_get_contents($file))); - $view->assign('file_mimetype', mime_content_type($file)); - - if (!empty($config['width'])) { - $view->assign('width', $config['width']); - } - - if (!empty($config['height'])) { - $view->assign('height', $config['height']); - } - } - - if ($type === 'page') { - $view->assign('numPage', $this->getAliasNumPage()); - $view->assign('numPages', $this->getAliasNbPages()); - } - - $view->assignMultiple($assignToView); - - $content = (string)$view->render(); - $content = trim(preg_replace('~[\\n]+~', '', $content)); - - $this->writeHtmlCellWithConfig($content, $config); - } - public function writeHtmlCellWithConfig(string $content, array $config): void { $width = (float)($config['width'] ?? 0.0); @@ -167,7 +127,7 @@ public function writeHtmlCellWithConfig(string $content, array $config): void } $oldFontSize = null; - if (empty($config['fontSize']) && is_numeric($config['fontSize'])) { + if (isset($config['fontSize']) && is_numeric($config['fontSize'])) { $oldFontSize = $this->getFontSizePt(); $this->SetFontSize((float)$config['fontSize']); } @@ -194,37 +154,4 @@ public function writeHtmlCellWithConfig(string $content, array $config): void $this->SetFontSize($oldFontSize); } } - - public function getStandaloneView( - string $templatePath, - string $templateFileName = 'Default', - string $format = 'html' - ): StandaloneView { - $templatePathAndFileName = $templatePath . $templateFileName . '.' . $format; - - /** @var StandaloneView $view */ - $view = GeneralUtility::makeInstance(StandaloneView::class); - $view->setFormat($format); - - if (!empty($this->viewSettings)) { - $view->setLayoutRootPaths($this->viewSettings['layoutRootPaths']); - $view->setPartialRootPaths($this->viewSettings['partialRootPaths']); - - if ($this->viewSettings['templateRootPaths']) { - foreach ($this->viewSettings['templateRootPaths'] as $pathNameKey => $pathNameValue) { - $templateRootPath = GeneralUtility::getFileAbsFileName( - $pathNameValue - ); - - $completePath = $templateRootPath . $templatePathAndFileName; - - if (file_exists($completePath)) { - $view->setTemplatePathAndFilename($completePath); - } - } - } - } - - return $view; - } } From 95213653d1f721d84f9a96218cf15a186bb4ee37 Mon Sep 17 00:00:00 2001 From: Alexander Schnitzler Date: Mon, 15 Jun 2026 12:53:43 +0200 Subject: [PATCH 2/4] [TASK] Replace usage of deprecated StandaloneView This change replaces the StandaloneView with generating a view object via the ViewFactory of the core which is compatible with TYPO3 13.4 and TYPO3 14.3 --- Classes/Service/PdfService.php | 62 ++++++++++++---------------------- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/Classes/Service/PdfService.php b/Classes/Service/PdfService.php index 35be731..2111834 100644 --- a/Classes/Service/PdfService.php +++ b/Classes/Service/PdfService.php @@ -15,9 +15,11 @@ use Extcode\CartPdf\Domain\Model\Dto\PdfDemand; use TYPO3\CMS\Core\Http\ApplicationType; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\View\ViewFactoryData; +use TYPO3\CMS\Core\View\ViewFactoryInterface; +use TYPO3\CMS\Core\View\ViewInterface; use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; -use TYPO3\CMS\Fluid\View\StandaloneView; readonly class PdfService implements DocumentRenderServiceInterface { @@ -26,6 +28,7 @@ public function __construct( private readonly ConfigurationManager $configurationManager, + private ViewFactoryInterface $viewFactory, ) { if (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) { $pageId = (int)($GLOBALS['TYPO3_REQUEST']->getQueryParams()['id'] ?? 1); @@ -48,37 +51,16 @@ public function __construct( $this->viewSettings = is_array($viewSettings) ? $viewSettings : []; } - public function getStandaloneView( - string $templatePath, - string $templateFileName = 'Default', - string $format = 'html', - ): StandaloneView { - $templatePathAndFileName = $templatePath . $templateFileName . '.' . $format; - - /** @var StandaloneView $view */ - $view = GeneralUtility::makeInstance(StandaloneView::class); - $view->setFormat($format); - - if (!empty($this->viewSettings)) { - $view->setLayoutRootPaths($this->viewSettings['layoutRootPaths']); - $view->setPartialRootPaths($this->viewSettings['partialRootPaths']); - - if ($this->viewSettings['templateRootPaths']) { - foreach ($this->viewSettings['templateRootPaths'] as $pathNameKey => $pathNameValue) { - $templateRootPath = GeneralUtility::getFileAbsFileName( - $pathNameValue - ); - - $completePath = $templateRootPath . $templatePathAndFileName; - - if (file_exists($completePath)) { - $view->setTemplatePathAndFilename($completePath); - } - } - } - } - - return $view; + public function getStandaloneView(string $format = 'html'): ViewInterface + { + return $this->viewFactory->create(new ViewFactoryData( + $this->viewSettings['templateRootPaths'] ?? [], + $this->viewSettings['partialRootPaths'] ?? [], + $this->viewSettings['layoutRootPaths'] ?? [], + null, + $GLOBALS['TYPO3_REQUEST'] ?? null, + $format, + )); } public function renderStandaloneView( @@ -87,7 +69,7 @@ public function renderStandaloneView( array $config, array $assignToView = [], ): string { - $view = $this->getStandaloneView($templatePath, ucfirst($type)); + $view = $this->getStandaloneView(); if (!empty($config['file'])) { $file = GeneralUtility::getFileAbsFileName($config['file']); @@ -106,7 +88,7 @@ public function renderStandaloneView( $view->assignMultiple($assignToView); - $content = (string)$view->render(); + $content = (string)$view->render($templatePath . ucfirst($type)); return trim(preg_replace('~[\\n]+~', '', $content)); } @@ -289,23 +271,23 @@ private function renderCart(TcpdfWrapper $pdf, OrderItem $orderItem, string $pdf private function renderCartHeader(OrderItem $orderItem, string $pdfType): string { - $view = $this->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Header'); + $view = $this->getStandaloneView(); $view->assign('orderItem', $orderItem); - $header = $view->render(); + $header = $view->render('/' . ucfirst($pdfType) . '/Order/Header'); return trim(preg_replace('~[\\n]+~', '', $header)); } private function renderCartBody(OrderItem $orderItem, string $pdfType): string { - $view = $this->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Product'); + $view = $this->getStandaloneView(); $view->assign('orderItem', $orderItem); $bodyOut = ''; foreach ($orderItem->getProducts() as $product) { $view->assign('product', $product); - $product = $view->render(); + $product = $view->render('/' . ucfirst($pdfType) . '/Order/Product'); $bodyOut .= trim(preg_replace('~[\\n]+~', '', $product)); } @@ -315,10 +297,10 @@ private function renderCartBody(OrderItem $orderItem, string $pdfType): string private function renderCartFooter(OrderItem $orderItem, string $pdfType): string { - $view = $this->getStandaloneView('/' . ucfirst($pdfType) . '/Order/', 'Footer'); + $view = $this->getStandaloneView(); $view->assign('orderSettings', $this->configuration[$pdfType]['body']['order']); $view->assign('orderItem', $orderItem); - $footer = $view->render(); + $footer = $view->render('/' . ucfirst($pdfType) . '/Order/Footer'); return trim(preg_replace('~[\\n]+~', '', $footer)); } From 83a081958fd86c39513592c0117db36815627e29 Mon Sep 17 00:00:00 2001 From: Alexander Schnitzler Date: Mon, 15 Jun 2026 13:02:25 +0200 Subject: [PATCH 3/4] [TASK] Correct casing of method calls --- Classes/Service/PdfService.php | 14 +++++++------- Classes/Service/TcpdfWrapper.php | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Classes/Service/PdfService.php b/Classes/Service/PdfService.php index 2111834..d7ced68 100644 --- a/Classes/Service/PdfService.php +++ b/Classes/Service/PdfService.php @@ -143,9 +143,9 @@ public function renderDocument(OrderItem $orderItem, string $pdfType): string } else { if (!empty($pdfSettings['header']['margin'])) { $pdf->setHeaderMargin((int)$pdfSettings['header']['margin']); - $pdf->SetMargins(PDF_MARGIN_LEFT, (float)$pdfSettings['header']['margin'], PDF_MARGIN_RIGHT); + $pdf->setMargins(PDF_MARGIN_LEFT, (float)$pdfSettings['header']['margin'], PDF_MARGIN_RIGHT); } else { - $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + $pdf->setMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); } } @@ -180,7 +180,7 @@ public function renderDocument(OrderItem $orderItem, string $pdfType): string $fontSize = $pdfSettings['fontSize']; } - $pdf->SetFont($font, $fontStyle, $fontSize); + $pdf->setFont($font, $fontStyle, $fontSize); $colorArray = [0, 0, 0]; @@ -226,15 +226,15 @@ public function renderDocument(OrderItem $orderItem, string $pdfType): string private function renderMarker(TcpdfWrapper $pdf, PdfDemand $pdfDemand): void { if ($pdfDemand->getFoldMarksEnabled()) { - $pdf->SetLineWidth(0.1); + $pdf->setLineWidth(0.1); $pdf->Line(6.0, 105.0, 8.0, 105.0); $pdf->Line(6.0, 148.5, 10.0, 148.5); $pdf->Line(6.0, 210.0, 8.0, 210.0); - $pdf->SetLineWidth(0.2); + $pdf->setLineWidth(0.2); } if ($pdfDemand->getAddressFieldMarksEnabled()) { - $pdf->SetLineWidth(0.1); + $pdf->setLineWidth(0.1); $pdf->Line(20.0, 45.0, 21.0, 45.0); $pdf->Line(20.0, 45.0, 20.0, 46.0); @@ -247,7 +247,7 @@ private function renderMarker(TcpdfWrapper $pdf, PdfDemand $pdfDemand): void $pdf->Line(105.0, 90.0, 104.0, 90.0); $pdf->Line(105.0, 90.0, 105.0, 89.0); - $pdf->SetLineWidth(0.2); + $pdf->setLineWidth(0.2); } } diff --git a/Classes/Service/TcpdfWrapper.php b/Classes/Service/TcpdfWrapper.php index c07a9b5..34dfb7a 100644 --- a/Classes/Service/TcpdfWrapper.php +++ b/Classes/Service/TcpdfWrapper.php @@ -53,14 +53,14 @@ public function getCartPdfType(): string return $this->pdfType; } - public function header(): void + public function Header(): void { if (empty($this->pdfSettings['header'] ?? [])) { return; } if (!empty($this->pdfSettings['fontSize'])) { - $this->SetFontSize($this->pdfSettings['fontSize']); + $this->setFontSize($this->pdfSettings['fontSize']); } foreach ($this->headerParts as $headerPart) { @@ -80,14 +80,14 @@ public function header(): void } } - public function footer(): void + public function Footer(): void { if (empty($this->pdfSettings['footer'] ?? [])) { return; } if (!empty($this->pdfSettings['fontSize'])) { - $this->SetFontSize($this->pdfSettings['fontSize']); + $this->setFontSize($this->pdfSettings['fontSize']); } foreach ($this->footerParts as $footerPart) { @@ -129,7 +129,7 @@ public function writeHtmlCellWithConfig(string $content, array $config): void $oldFontSize = null; if (isset($config['fontSize']) && is_numeric($config['fontSize'])) { $oldFontSize = $this->getFontSizePt(); - $this->SetFontSize((float)$config['fontSize']); + $this->setFontSize((float)$config['fontSize']); } if (isset($config['spacingY']) && is_numeric($config['spacingY'])) { @@ -151,7 +151,7 @@ public function writeHtmlCellWithConfig(string $content, array $config): void ); if (is_null($oldFontSize) === false) { - $this->SetFontSize($oldFontSize); + $this->setFontSize($oldFontSize); } } } From 71e7742a8abe033112b573e18c8fab6ba80c6aec Mon Sep 17 00:00:00 2001 From: Alexander Schnitzler Date: Mon, 15 Jun 2026 13:52:48 +0200 Subject: [PATCH 4/4] [FEATURE] Allow loading of typoscript via site set --- Configuration/Sets/CartPdf/config.yaml | 2 + .../Sets/CartPdf/constants.typoscript | 15 ++ Configuration/Sets/CartPdf/setup.typoscript | 28 ++++ Configuration/Sets/DeliveryPdf/config.yaml | 4 + .../Sets/DeliveryPdf/constants.typoscript | 6 + .../Sets/DeliveryPdf/setup.typoscript | 152 +++++++++++++++++ Configuration/Sets/InvoicePdf/config.yaml | 4 + .../Sets/InvoicePdf/constants.typoscript | 6 + .../Sets/InvoicePdf/setup.typoscript | 152 +++++++++++++++++ Configuration/Sets/OrderPdf/config.yaml | 4 + .../Sets/OrderPdf/constants.typoscript | 6 + Configuration/Sets/OrderPdf/setup.typoscript | 152 +++++++++++++++++ .../DeliveryPdf/constants.typoscript | 7 +- .../TypoScript/DeliveryPdf/setup.typoscript | 153 +----------------- .../InvoicePdf/constants.typoscript | 7 +- .../TypoScript/InvoicePdf/setup.typoscript | 153 +----------------- .../TypoScript/OrderPdf/constants.typoscript | 7 +- .../TypoScript/OrderPdf/setup.typoscript | 153 +----------------- Configuration/TypoScript/constants.typoscript | 17 +- Configuration/TypoScript/setup.typoscript | 29 +--- 20 files changed, 539 insertions(+), 518 deletions(-) create mode 100644 Configuration/Sets/CartPdf/config.yaml create mode 100644 Configuration/Sets/CartPdf/constants.typoscript create mode 100644 Configuration/Sets/CartPdf/setup.typoscript create mode 100644 Configuration/Sets/DeliveryPdf/config.yaml create mode 100644 Configuration/Sets/DeliveryPdf/constants.typoscript create mode 100644 Configuration/Sets/DeliveryPdf/setup.typoscript create mode 100644 Configuration/Sets/InvoicePdf/config.yaml create mode 100644 Configuration/Sets/InvoicePdf/constants.typoscript create mode 100644 Configuration/Sets/InvoicePdf/setup.typoscript create mode 100644 Configuration/Sets/OrderPdf/config.yaml create mode 100644 Configuration/Sets/OrderPdf/constants.typoscript create mode 100644 Configuration/Sets/OrderPdf/setup.typoscript diff --git a/Configuration/Sets/CartPdf/config.yaml b/Configuration/Sets/CartPdf/config.yaml new file mode 100644 index 0000000..be7e0aa --- /dev/null +++ b/Configuration/Sets/CartPdf/config.yaml @@ -0,0 +1,2 @@ +name: extcode/cart-pdf +label: Shopping Cart - Cart Pdf diff --git a/Configuration/Sets/CartPdf/constants.typoscript b/Configuration/Sets/CartPdf/constants.typoscript new file mode 100644 index 0000000..816a581 --- /dev/null +++ b/Configuration/Sets/CartPdf/constants.typoscript @@ -0,0 +1,15 @@ +plugin.tx_cartpdf { + view { + templateRootPath = EXT:cart_pdf/Resources/Private/Templates/ + partialRootPath = EXT:cart_pdf/Resources/Private/Partials/ + layoutRootPath = EXT:cart_pdf/Resources/Private/Layouts/ + } +} + +module.tx_cartpdf { + view { + templateRootPath = EXT:cart_pdf/Resources/Private/Templates/ + partialRootPath = EXT:cart_pdf/Resources/Private/Partials/ + layoutRootPath = EXT:cart_pdf/Resources/Private/Layouts/ + } +} diff --git a/Configuration/Sets/CartPdf/setup.typoscript b/Configuration/Sets/CartPdf/setup.typoscript new file mode 100644 index 0000000..1dd3dec --- /dev/null +++ b/Configuration/Sets/CartPdf/setup.typoscript @@ -0,0 +1,28 @@ +plugin.tx_cartpdf { + view { + templateRootPaths { + 0 = {$plugin.tx_cartpdf.view.templateRootPath} + } + partialRootPaths { + 0 = {$plugin.tx_cartpdf.view.partialRootPath} + } + layoutRootPaths { + 0 = {$plugin.tx_cartpdf.view.layoutRootPath} + } + } +} + +module.tx_cartpdf { + view { + templateRootPaths { + 0 = {$module.tx_cartpdf.view.templateRootPath} + } + partialRootPaths { + 0 = {$module.tx_cartpdf.view.partialRootPath} + } + layoutRootPaths { + 0 = {$module.tx_cartpdf.view.layoutRootPath} + } + } +} + diff --git a/Configuration/Sets/DeliveryPdf/config.yaml b/Configuration/Sets/DeliveryPdf/config.yaml new file mode 100644 index 0000000..0397bcf --- /dev/null +++ b/Configuration/Sets/DeliveryPdf/config.yaml @@ -0,0 +1,4 @@ +name: extcode/cart-pdf-delivery-pdf +label: Shopping Cart - Cart Pdf - Delivery PDF +dependencies: + - extcode/cart-pdf diff --git a/Configuration/Sets/DeliveryPdf/constants.typoscript b/Configuration/Sets/DeliveryPdf/constants.typoscript new file mode 100644 index 0000000..eb12695 --- /dev/null +++ b/Configuration/Sets/DeliveryPdf/constants.typoscript @@ -0,0 +1,6 @@ +plugin.tx_cartpdf { + deliveryPdf { + storageRepository = 1 + storageFolder = tx_cart/delivery_pdf + } +} diff --git a/Configuration/Sets/DeliveryPdf/setup.typoscript b/Configuration/Sets/DeliveryPdf/setup.typoscript new file mode 100644 index 0000000..e01722a --- /dev/null +++ b/Configuration/Sets/DeliveryPdf/setup.typoscript @@ -0,0 +1,152 @@ +plugin.tx_cartpdf { + invoicePdf { + storageRepository = {$plugin.tx_cartpdf.invoicePdf.storageRepository} + storageFolder = {$plugin.tx_cartpdf.invoicePdf.storageFolder} + + debug = 0 + + # font = Helvetica + # fontStyle = + fontSize = 10 + + # drawColor = 0,0,0 + + enableFoldMarks = 1 + enableAddressFieldMarks = 1 + + header { + margin = 30mm + html { + logo { + width = 50 + positionX = 10 + positionY = 5 + templatePath = /InvoicePdf/Header/ + file = EXT:cart_pdf/Documentation/Images/cart_pdf_logo.png + } + + content { + width = 120 + positionX = 80 + positionY = 5 + templatePath = /InvoicePdf/Header/ + fontSize = 8 + align = R + } + } + + line { + 1 { + x1 = 10 + y1 = 24 + x2 = 200 + y2 = 24 + style { + width = 0.5 + } + } + } + } + + footer { + margin = 40mm + + html { + content { + width = 190 + height = 35 + positionX = 15 + positionY = 265 + templatePath = /InvoicePdf/Footer/ + fontSize = 8 + } + + page { + width = 100 + height = 10 + positionX = 115 + positionY = 290 + templatePath = /InvoicePdf/Footer/ + fontSize = 8 + align = R + } + } + + line { + 1 { + x1 = 10 + y1 = 262 + x2 = 200 + y2 = 262 + style { + width = 0.5 + } + } + } + } + + letterhead { + html { + envelopeAddress { + width = 83 + height = 10 + positionX = 21 + positionY = 46 + fontSize = 6 + } + + invoiceAddress { + width = 83 + height = 33 + positionX = 21 + positionY = 56 + } + + date { + width = 60 + height = 5 + positionX = 130 + positionY = 84 + align = R + } + } + } + + body { + before { + html { + overview { + width = 170 + positionX = 20 + positionY = 100 + fontSize = 12 + } + } + } + + order { + width=170 + positionX=20 + spacingY = 10 + fontSize=8 + + summary < plugin.tx_cart.settings.showCartAction.summary + } + + after { + html { + greetings { + width = 170 + height = 20 + positionX = 20 + spacingY = 20 + } + } + } + } + } +} + +module.tx_cartpdf { + invoicePdf < plugin.tx_cartpdf.invoicePdf +} diff --git a/Configuration/Sets/InvoicePdf/config.yaml b/Configuration/Sets/InvoicePdf/config.yaml new file mode 100644 index 0000000..c277edc --- /dev/null +++ b/Configuration/Sets/InvoicePdf/config.yaml @@ -0,0 +1,4 @@ +name: extcode/cart-pdf-invoice-pdf +label: Shopping Cart - Cart Pdf - Invoice PDF +dependencies: + - extcode/cart-pdf diff --git a/Configuration/Sets/InvoicePdf/constants.typoscript b/Configuration/Sets/InvoicePdf/constants.typoscript new file mode 100644 index 0000000..181dbd6 --- /dev/null +++ b/Configuration/Sets/InvoicePdf/constants.typoscript @@ -0,0 +1,6 @@ +plugin.tx_cartpdf { + invoicePdf { + storageRepository = 1 + storageFolder = tx_cart/invoice_pdf + } +} diff --git a/Configuration/Sets/InvoicePdf/setup.typoscript b/Configuration/Sets/InvoicePdf/setup.typoscript new file mode 100644 index 0000000..d0eaef6 --- /dev/null +++ b/Configuration/Sets/InvoicePdf/setup.typoscript @@ -0,0 +1,152 @@ +plugin.tx_cartpdf { + invoicePdf { + storageRepository = {$plugin.tx_cartpdf.invoicePdf.storageRepository} + storageFolder = {$plugin.tx_cartpdf.invoicePdf.storageFolder} + + debug = 0 + + # font = Helvetica + # fontStyle = + fontSize = 10 + + # drawColor = 0,0,0 + + enableFoldMarks = 1 + enableAddressFieldMarks = 1 + + header { + margin = 30mm + html { + logo { + width = 50 + positionX = 10 + positionY = 5 + templatePath = /InvoicePdf/Header/ + file = EXT:cart_pdf/Documentation/Images/cart_pdf_logo.png + } + + content { + width = 120 + positionX = 80 + positionY = 5 + templatePath = /InvoicePdf/Header/ + fontSize = 8 + align = R + } + } + + line { + 1 { + x1 = 10 + y1 = 24 + x2 = 200 + y2 = 24 + style { + width = 0.5 + } + } + } + } + + footer { + margin = 40mm + + html { + content { + width = 190 + height = 35 + positionX = 15 + positionY = 265 + templatePath = /InvoicePdf/Footer/ + fontSize = 8 + } + + page { + width = 100 + height = 10 + positionX = 115 + positionY = 290 + templatePath = /InvoicePdf/Footer/ + fontSize = 8 + align = R + } + } + + line { + 1 { + x1 = 10 + y1 = 262 + x2 = 200 + y2 = 262 + style { + width = 0.5 + } + } + } + } + + letterhead { + html { + envelopeAddress { + width = 83 + height = 10 + positionX = 21 + positionY = 46 + fontSize = 6 + } + + invoiceAddress { + width = 83 + height = 33 + positionX = 21 + positionY = 56 + } + + date { + width = 60 + height = 5 + positionX = 130 + positionY = 84 + align = R + } + } + } + + body { + before { + html { + overview { + width = 170 + positionX = 20 + positionY = 100 + fontSize = 12 + } + } + } + + order { + width=170 + positionX=20 + spacingY = 10 + fontSize=8 + + summary < plugin.tx_cart.settings.showCartAction.summary + } + + after { + html { + greetings { + width = 170 + height = 20 + positionX = 20 + spacingY = 20 + } + } + } + } + } +} + +module.tx_cartpdf { + invoicePdf < plugin.tx_cartpdf.invoicePdf +} \ No newline at end of file diff --git a/Configuration/Sets/OrderPdf/config.yaml b/Configuration/Sets/OrderPdf/config.yaml new file mode 100644 index 0000000..e121d7d --- /dev/null +++ b/Configuration/Sets/OrderPdf/config.yaml @@ -0,0 +1,4 @@ +name: extcode/cart-pdf-order-pdf +label: Shopping Cart - Cart Pdf - Order PDF +dependencies: + - extcode/cart-pdf diff --git a/Configuration/Sets/OrderPdf/constants.typoscript b/Configuration/Sets/OrderPdf/constants.typoscript new file mode 100644 index 0000000..9606ec1 --- /dev/null +++ b/Configuration/Sets/OrderPdf/constants.typoscript @@ -0,0 +1,6 @@ +plugin.tx_cartpdf { + orderPdf { + storageRepository = 1 + storageFolder = tx_cart/order_pdf + } +} diff --git a/Configuration/Sets/OrderPdf/setup.typoscript b/Configuration/Sets/OrderPdf/setup.typoscript new file mode 100644 index 0000000..62f2be0 --- /dev/null +++ b/Configuration/Sets/OrderPdf/setup.typoscript @@ -0,0 +1,152 @@ +plugin.tx_cartpdf { + orderPdf { + storageRepository = {$plugin.tx_cartpdf.orderPdf.storageRepository} + storageFolder = {$plugin.tx_cartpdf.orderPdf.storageFolder} + + debug = 0 + + # font = Helvetica + # fontStyle = + fontSize = 10 + + # drawColor = 0,0,0 + + enableFoldMarks = 1 + enableAddressFieldMarks = 1 + + header { + margin = 30mm + html { + logo { + width = 50 + positionX = 10 + positionY = 5 + templatePath = /OrderPdf/Header/ + file = EXT:cart_pdf/Documentation/Images/cart_pdf_logo.png + } + + content { + width = 120 + positionX = 80 + positionY = 5 + templatePath = /OrderPdf/Header/ + fontSize = 8 + align = R + } + } + + line { + 1 { + x1 = 10 + y1 = 24 + x2 = 200 + y2 = 24 + style { + width = 0.5 + } + } + } + } + + footer { + margin = 40mm + + html { + content { + width = 190 + height = 35 + positionX = 15 + positionY = 265 + templatePath = /OrderPdf/Footer/ + fontSize = 8 + } + + page { + width = 100 + height = 10 + positionX = 115 + positionY = 290 + templatePath = /OrderPdf/Footer/ + fontSize = 8 + align = R + } + } + + line { + 1 { + x1 = 10 + y1 = 262 + x2 = 200 + y2 = 262 + style { + width = 0.5 + } + } + } + } + + letterhead { + html { + envelopeAddress { + width = 83 + height = 10 + positionX = 21 + positionY = 46 + fontSize = 6 + } + + invoiceAddress { + width = 83 + height = 33 + positionX = 21 + positionY = 56 + } + + date { + width = 60 + height = 5 + positionX = 130 + positionY = 84 + align = R + } + } + } + + body { + before { + html { + overview { + width = 170 + positionX = 20 + positionY = 100 + fontSize = 12 + } + } + } + + order { + width=170 + positionX=20 + spacingY = 10 + fontSize=8 + + summary < plugin.tx_cart.settings.showCartAction.summary + } + + after { + html { + greetings { + width = 170 + height = 20 + positionX = 20 + spacingY = 20 + } + } + } + } + } +} + +module.tx_cartpdf { + orderPdf < plugin.tx_cartpdf.orderPdf +} \ No newline at end of file diff --git a/Configuration/TypoScript/DeliveryPdf/constants.typoscript b/Configuration/TypoScript/DeliveryPdf/constants.typoscript index eb12695..4fed724 100644 --- a/Configuration/TypoScript/DeliveryPdf/constants.typoscript +++ b/Configuration/TypoScript/DeliveryPdf/constants.typoscript @@ -1,6 +1 @@ -plugin.tx_cartpdf { - deliveryPdf { - storageRepository = 1 - storageFolder = tx_cart/delivery_pdf - } -} +@import 'EXT:cart_pdf/Configuration/Sets/DeliveryPdf/constants.typoscript' diff --git a/Configuration/TypoScript/DeliveryPdf/setup.typoscript b/Configuration/TypoScript/DeliveryPdf/setup.typoscript index e983104..1b6c38d 100644 --- a/Configuration/TypoScript/DeliveryPdf/setup.typoscript +++ b/Configuration/TypoScript/DeliveryPdf/setup.typoscript @@ -1,152 +1 @@ -plugin.tx_cartpdf { - deliveryPdf { - storageRepository = {$plugin.tx_cartpdf.deliveryPdf.storageRepository} - storageFolder = {$plugin.tx_cartpdf.deliveryPdf.storageFolder} - - debug = 0 - - # font = Helvetica - # fontStyle = - fontSize = 10 - - # drawColor = 0,0,0 - - enableFoldMarks = 1 - enableAddressFieldMarks = 1 - - header { - margin = 30mm - html { - logo { - width = 50 - positionX = 10 - positionY = 5 - templatePath = /DeliveryPdf/Header/ - file = EXT:cart_pdf/Documentation/Images/cart_pdf_logo.png - } - - content { - width = 120 - positionX = 80 - positionY = 5 - templatePath = /DeliveryPdf/Header/ - fontSize = 8 - align = R - } - } - - line { - 1 { - x1 = 10 - y1 = 24 - x2 = 200 - y2 = 24 - style { - width = 0.5 - } - } - } - } - - footer { - margin = 40mm - - html { - content { - width = 190 - height = 35 - positionX = 15 - positionY = 265 - templatePath = /DeliveryPdf/Footer/ - fontSize = 8 - } - - page { - width = 100 - height = 10 - positionX = 115 - positionY = 290 - templatePath = /DeliveryPdf/Footer/ - fontSize = 8 - align = R - } - } - - line { - 1 { - x1 = 10 - y1 = 262 - x2 = 200 - y2 = 262 - style { - width = 0.5 - } - } - } - } - - letterhead { - html { - envelopeAddress { - width = 83 - height = 10 - positionX = 21 - positionY = 46 - fontSize = 6 - } - - invoiceAddress { - width = 83 - height = 33 - positionX = 21 - positionY = 56 - } - - date { - width = 60 - height = 5 - positionX = 130 - positionY = 84 - align = R - } - } - } - - body { - before { - html { - overview { - width = 170 - positionX = 20 - positionY = 100 - fontSize = 12 - } - } - } - - order { - width=170 - positionX=20 - spacingY = 10 - fontSize=8 - - summary < plugin.tx_cart.settings.showCartAction.summary - } - - after { - html { - greetings { - width = 170 - height = 20 - positionX = 20 - spacingY = 20 - } - } - } - } - } -} - -module.tx_cartpdf { - deliveryPdf < plugin.tx_cartpdf.deliveryPdf -} \ No newline at end of file +@import 'EXT:cart_pdf/Configuration/Sets/DeliveryPdf/setup.typoscript' diff --git a/Configuration/TypoScript/InvoicePdf/constants.typoscript b/Configuration/TypoScript/InvoicePdf/constants.typoscript index 181dbd6..141b870 100644 --- a/Configuration/TypoScript/InvoicePdf/constants.typoscript +++ b/Configuration/TypoScript/InvoicePdf/constants.typoscript @@ -1,6 +1 @@ -plugin.tx_cartpdf { - invoicePdf { - storageRepository = 1 - storageFolder = tx_cart/invoice_pdf - } -} +@import 'EXT:cart_pdf/Configuration/Sets/InvoicePdf/constants.typoscript' diff --git a/Configuration/TypoScript/InvoicePdf/setup.typoscript b/Configuration/TypoScript/InvoicePdf/setup.typoscript index d0eaef6..2c2ec80 100644 --- a/Configuration/TypoScript/InvoicePdf/setup.typoscript +++ b/Configuration/TypoScript/InvoicePdf/setup.typoscript @@ -1,152 +1 @@ -plugin.tx_cartpdf { - invoicePdf { - storageRepository = {$plugin.tx_cartpdf.invoicePdf.storageRepository} - storageFolder = {$plugin.tx_cartpdf.invoicePdf.storageFolder} - - debug = 0 - - # font = Helvetica - # fontStyle = - fontSize = 10 - - # drawColor = 0,0,0 - - enableFoldMarks = 1 - enableAddressFieldMarks = 1 - - header { - margin = 30mm - html { - logo { - width = 50 - positionX = 10 - positionY = 5 - templatePath = /InvoicePdf/Header/ - file = EXT:cart_pdf/Documentation/Images/cart_pdf_logo.png - } - - content { - width = 120 - positionX = 80 - positionY = 5 - templatePath = /InvoicePdf/Header/ - fontSize = 8 - align = R - } - } - - line { - 1 { - x1 = 10 - y1 = 24 - x2 = 200 - y2 = 24 - style { - width = 0.5 - } - } - } - } - - footer { - margin = 40mm - - html { - content { - width = 190 - height = 35 - positionX = 15 - positionY = 265 - templatePath = /InvoicePdf/Footer/ - fontSize = 8 - } - - page { - width = 100 - height = 10 - positionX = 115 - positionY = 290 - templatePath = /InvoicePdf/Footer/ - fontSize = 8 - align = R - } - } - - line { - 1 { - x1 = 10 - y1 = 262 - x2 = 200 - y2 = 262 - style { - width = 0.5 - } - } - } - } - - letterhead { - html { - envelopeAddress { - width = 83 - height = 10 - positionX = 21 - positionY = 46 - fontSize = 6 - } - - invoiceAddress { - width = 83 - height = 33 - positionX = 21 - positionY = 56 - } - - date { - width = 60 - height = 5 - positionX = 130 - positionY = 84 - align = R - } - } - } - - body { - before { - html { - overview { - width = 170 - positionX = 20 - positionY = 100 - fontSize = 12 - } - } - } - - order { - width=170 - positionX=20 - spacingY = 10 - fontSize=8 - - summary < plugin.tx_cart.settings.showCartAction.summary - } - - after { - html { - greetings { - width = 170 - height = 20 - positionX = 20 - spacingY = 20 - } - } - } - } - } -} - -module.tx_cartpdf { - invoicePdf < plugin.tx_cartpdf.invoicePdf -} \ No newline at end of file +@import 'EXT:cart_pdf/Configuration/Sets/InvoicePdf/setup.typoscript' diff --git a/Configuration/TypoScript/OrderPdf/constants.typoscript b/Configuration/TypoScript/OrderPdf/constants.typoscript index 9606ec1..a608319 100644 --- a/Configuration/TypoScript/OrderPdf/constants.typoscript +++ b/Configuration/TypoScript/OrderPdf/constants.typoscript @@ -1,6 +1 @@ -plugin.tx_cartpdf { - orderPdf { - storageRepository = 1 - storageFolder = tx_cart/order_pdf - } -} +@import 'EXT:cart_pdf/Configuration/Sets/OrderPdf/constants.typoscript' diff --git a/Configuration/TypoScript/OrderPdf/setup.typoscript b/Configuration/TypoScript/OrderPdf/setup.typoscript index 62f2be0..172f08f 100644 --- a/Configuration/TypoScript/OrderPdf/setup.typoscript +++ b/Configuration/TypoScript/OrderPdf/setup.typoscript @@ -1,152 +1 @@ -plugin.tx_cartpdf { - orderPdf { - storageRepository = {$plugin.tx_cartpdf.orderPdf.storageRepository} - storageFolder = {$plugin.tx_cartpdf.orderPdf.storageFolder} - - debug = 0 - - # font = Helvetica - # fontStyle = - fontSize = 10 - - # drawColor = 0,0,0 - - enableFoldMarks = 1 - enableAddressFieldMarks = 1 - - header { - margin = 30mm - html { - logo { - width = 50 - positionX = 10 - positionY = 5 - templatePath = /OrderPdf/Header/ - file = EXT:cart_pdf/Documentation/Images/cart_pdf_logo.png - } - - content { - width = 120 - positionX = 80 - positionY = 5 - templatePath = /OrderPdf/Header/ - fontSize = 8 - align = R - } - } - - line { - 1 { - x1 = 10 - y1 = 24 - x2 = 200 - y2 = 24 - style { - width = 0.5 - } - } - } - } - - footer { - margin = 40mm - - html { - content { - width = 190 - height = 35 - positionX = 15 - positionY = 265 - templatePath = /OrderPdf/Footer/ - fontSize = 8 - } - - page { - width = 100 - height = 10 - positionX = 115 - positionY = 290 - templatePath = /OrderPdf/Footer/ - fontSize = 8 - align = R - } - } - - line { - 1 { - x1 = 10 - y1 = 262 - x2 = 200 - y2 = 262 - style { - width = 0.5 - } - } - } - } - - letterhead { - html { - envelopeAddress { - width = 83 - height = 10 - positionX = 21 - positionY = 46 - fontSize = 6 - } - - invoiceAddress { - width = 83 - height = 33 - positionX = 21 - positionY = 56 - } - - date { - width = 60 - height = 5 - positionX = 130 - positionY = 84 - align = R - } - } - } - - body { - before { - html { - overview { - width = 170 - positionX = 20 - positionY = 100 - fontSize = 12 - } - } - } - - order { - width=170 - positionX=20 - spacingY = 10 - fontSize=8 - - summary < plugin.tx_cart.settings.showCartAction.summary - } - - after { - html { - greetings { - width = 170 - height = 20 - positionX = 20 - spacingY = 20 - } - } - } - } - } -} - -module.tx_cartpdf { - orderPdf < plugin.tx_cartpdf.orderPdf -} \ No newline at end of file +@import 'EXT:cart_pdf/Configuration/Sets/OrderPdf/setup.typoscript' diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index 7163963..ccb1013 100644 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -1,16 +1 @@ -plugin.tx_cartpdf { - view { - templateRootPath = EXT:cart_pdf/Resources/Private/Templates/ - partialRootPath = EXT:cart_pdf/Resources/Private/Partials/ - layoutRootPath = EXT:cart_pdf/Resources/Private/Layouts/ - } -} - -module.tx_cartpdf { - view { - templateRootPath = EXT:cart_pdf/Resources/Private/Templates/ - partialRootPath = EXT:cart_pdf/Resources/Private/Partials/ - layoutRootPath = EXT:cart_pdf/Resources/Private/Layouts/ - } -} - +@import 'EXT:cart_pdf/Configuration/Sets/CartPdf/constants.typoscript' diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 1dd3dec..9dc7570 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -1,28 +1 @@ -plugin.tx_cartpdf { - view { - templateRootPaths { - 0 = {$plugin.tx_cartpdf.view.templateRootPath} - } - partialRootPaths { - 0 = {$plugin.tx_cartpdf.view.partialRootPath} - } - layoutRootPaths { - 0 = {$plugin.tx_cartpdf.view.layoutRootPath} - } - } -} - -module.tx_cartpdf { - view { - templateRootPaths { - 0 = {$module.tx_cartpdf.view.templateRootPath} - } - partialRootPaths { - 0 = {$module.tx_cartpdf.view.partialRootPath} - } - layoutRootPaths { - 0 = {$module.tx_cartpdf.view.layoutRootPath} - } - } -} - +@import 'EXT:cart_pdf/Configuration/Sets/CartPdf/setup.typoscript'