N°3912 - Polishing: Export

This commit is contained in:
acognet
2021-06-17 10:43:06 +02:00
parent 13f6f6ebe6
commit 77cf879f4f
6 changed files with 41 additions and 45 deletions

View File

@@ -17,6 +17,8 @@
* You should have received a copy of the GNU Affero General Public License
*/
use Combodo\iTop\Renderer\BlockRenderer;
/**
* Special class of WebPage for printing into a PDF document
@@ -107,17 +109,16 @@ EOF
*/
public function flush()
{
if (strlen($this->s_content) > 0)
{
$sHtml = '';
if (count($this->a_styles) > 0)
{
$sHtml .= "<style>\n".implode("\n", $this->a_styles)."\n</style>\n";
}
$sHtml = '';
if (count($this->a_styles) > 0) {
$sHtml .= "<style>\n".implode("\n", $this->a_styles)."\n</style>\n";
}
if (strlen($this->s_content) > 0) {
$sHtml .= $this->s_content;
$this->oPdf->writeHTML($sHtml); // The style(s) must be supplied each time we call writeHtml
$this->s_content = '';
}
$sHtml .= BlockRenderer::RenderBlockTemplates($this->oContentLayout);
$this->oPdf->writeHTML($sHtml); // The style(s) must be supplied each time we call writeHtml
}
/**