From 6d0d0bab1f5046731d68e453f7a522122928d12c Mon Sep 17 00:00:00 2001 From: oleacorner Date: Wed, 28 Nov 2012 13:55:08 +0100 Subject: [PATCH] Update classes/pdf/PDFGenerator.php Proposal to enhance the $display parameter. The proposal supports the true/false value, but also the 'D', 'I' and 'S' of fpdf. The behavior of the true value is changed to 'D' instead of 'I'. So, in fornt or back office, while cliking on a button to retrieve a PDF, the download windows is proposed instead of displaying the PDF inside the navigator. --- classes/pdf/PDFGenerator.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/pdf/PDFGenerator.php b/classes/pdf/PDFGenerator.php index d9e840364..9bf30d3d6 100755 --- a/classes/pdf/PDFGenerator.php +++ b/classes/pdf/PDFGenerator.php @@ -132,7 +132,17 @@ class PDFGeneratorCore extends TCPDF $this->lastPage(); - $output = $display ? 'I' : 'S'; + if ($display === true) + $output = 'D'; + elseif ($display === false) + $output = 'S'; + elseif (display == 'D') + $output = 'D'; + elseif (display == 'S') + $output = 'S'; + else + $output = 'I'; + return $this->output($filename, $output); }