diff --git a/src/system/RoutesModule/Base/bootstrap.php b/src/system/RoutesModule/Base/bootstrap.php index 497d721e1e..7c70e573b3 100644 --- a/src/system/RoutesModule/Base/bootstrap.php +++ b/src/system/RoutesModule/Base/bootstrap.php @@ -7,7 +7,7 @@ * @author Zikula contributors . * @link http://www.zikula.org * @link http://zikula.org - * @version Generated by ModuleStudio 1.0.1 (https://modulestudio.de) at Wed Aug 30 15:50:40 CEST 2017. + * @version Generated by ModuleStudio 1.0.1 (https://modulestudio.de) at Thu Aug 31 12:47:48 CEST 2017. */ /** diff --git a/src/system/RoutesModule/Helper/Base/AbstractViewHelper.php b/src/system/RoutesModule/Helper/Base/AbstractViewHelper.php index 5e2079152b..804321f833 100644 --- a/src/system/RoutesModule/Helper/Base/AbstractViewHelper.php +++ b/src/system/RoutesModule/Helper/Base/AbstractViewHelper.php @@ -142,12 +142,6 @@ public function processTemplate($type, $func, array $templateParameters = [], $t $template = $this->getViewTemplate($type, $func); } - if ($templateExtension == 'pdf.twig') { - $template = str_replace('.pdf', '.html', $template); - - return $this->processPdf($templateParameters, $template); - } - // look whether we need output with or without the theme $raw = $this->request->query->getBoolean('raw', false); if (!$raw && $templateExtension != 'html.twig') { @@ -219,52 +213,4 @@ public function availableExtensions($type, $func) return $extensions; } - - /** - * Processes a template file using dompdf (LGPL). - * - * @param array $templateParameters Template data - * @param string $template Name of template to use - * - * @return mixed Output - */ - protected function processPdf(array $templateParameters = [], $template) - { - // first the content, to set page vars - $output = $this->twig->render($template, $templateParameters); - - // make local images absolute - $output = str_replace('img src="/', 'img src="' . $this->request->server->get('DOCUMENT_ROOT') . '/', $output); - - // then the surrounding - $output = $this->twig->render('@ZikulaRoutesModule/includePdfHeader.html.twig') . $output . ''; - - // create name of the pdf output file - $siteName = $this->variableApi->getSystemVar('sitename'); - $pageTitle = iconv('UTF-8', 'ASCII//TRANSLIT', $this->pageVars->get('title', '')); - $fileTitle = iconv('UTF-8', 'ASCII//TRANSLIT', $siteName) - . '-' - . ($pageTitle != '' ? $pageTitle . '-' : '') - . date('Ymd') . '.pdf'; - $fileTitle = str_replace(' ', '_', $fileTitle); - - /* - if (true === $this->request->query->getBoolean('dbg', false)) { - die($output); - } - */ - - // instantiate pdf object - $pdf = new \Dompdf\Dompdf(); - // define page properties - $pdf->setPaper('A4', 'portrait'); - // load html input data - $pdf->loadHtml($output); - // create the actual pdf file - $pdf->render(); - // stream output to browser - $pdf->stream($fileTitle); - - return new Response(); - } } diff --git a/src/system/RoutesModule/bootstrap.php b/src/system/RoutesModule/bootstrap.php index 8b20c4cf66..32af2d3f77 100644 --- a/src/system/RoutesModule/bootstrap.php +++ b/src/system/RoutesModule/bootstrap.php @@ -7,7 +7,7 @@ * @author Zikula contributors . * @link http://www.zikula.org * @link http://zikula.org - * @version Generated by ModuleStudio 1.0.1 (https://modulestudio.de) at Wed Aug 30 15:50:40 CEST 2017. + * @version Generated by ModuleStudio 1.0.1 (https://modulestudio.de) at Thu Aug 31 12:47:48 CEST 2017. */ /**