From 57a0b0005ef33be708ffca69e652093990b02fed Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 11 Feb 2015 15:15:37 +0100 Subject: [PATCH] doc/lib: Fix PDF rendering refs #6630 --- .../application/views/scripts/chapter.phtml | 2 +- .../doc/application/views/scripts/pdf.phtml | 10 ++++----- .../doc/application/views/scripts/toc.phtml | 2 +- modules/doc/library/Doc/DocController.php | 22 +++++++++---------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/modules/doc/application/views/scripts/chapter.phtml b/modules/doc/application/views/scripts/chapter.phtml index 4341967ba..eefe6f65f 100644 --- a/modules/doc/application/views/scripts/chapter.phtml +++ b/modules/doc/application/views/scripts/chapter.phtml @@ -2,5 +2,5 @@ showOnlyCloseButton() ?>
- +
diff --git a/modules/doc/application/views/scripts/pdf.phtml b/modules/doc/application/views/scripts/pdf.phtml index 72d77f3c0..e76ded957 100644 --- a/modules/doc/application/views/scripts/pdf.phtml +++ b/modules/doc/application/views/scripts/pdf.phtml @@ -1,7 +1,5 @@ -

translate('Documentation'); ?>

-
- render($this, $this->getHelper('Url')); ?> -
-
- render($this, $this->getHelper('Url')); ?> +
+

+ +
diff --git a/modules/doc/application/views/scripts/toc.phtml b/modules/doc/application/views/scripts/toc.phtml index 09e3adf51..daec9b177 100644 --- a/modules/doc/application/views/scripts/toc.phtml +++ b/modules/doc/application/views/scripts/toc.phtml @@ -3,5 +3,5 @@

- +
diff --git a/modules/doc/library/Doc/DocController.php b/modules/doc/library/Doc/DocController.php index f555c2442..de02a3bae 100644 --- a/modules/doc/library/Doc/DocController.php +++ b/modules/doc/library/Doc/DocController.php @@ -45,7 +45,6 @@ class DocController extends ModuleActionController ->setUrl($url) ->setUrlParams($urlParams); $name = ucfirst($name); - $this->view->docName = $name; $this->view->title = sprintf($this->translate('%s Documentation'), $name); $this->render('toc', null, true); } @@ -61,17 +60,16 @@ class DocController extends ModuleActionController protected function renderPdf($path, $name, $url, array $urlParams = array()) { $parser = new DocParser($path); - $docTree = $parser->getDocTree(); - $this->view->tocRenderer = new TocRenderer($docTree, $url, $urlParams); - $this->view->sectionRenderer = new SectionRenderer( - $docTree, - null, - null, - $url, - $urlParams - ); - $this->view->docName = $name; + $toc = new DocTocRenderer($parser->getDocTree()->getIterator()); + $this->view->toc = $toc + ->setUrl($url) + ->setUrlParams($urlParams); + $section = new DocSectionRenderer($parser->getDocTree()); + $this->view->section = $section + ->setUrl($url) + ->setUrlParams($urlParams); + $this->view->title = sprintf($this->translate('%s Documentation'), $name); $this->_request->setParam('format', 'pdf'); - $this->render('pdf', null, true); + $this->_helper->viewRenderer->setRender('pdf', null, true); } }