[*] PDF : Display Hook

This commit is contained in:
fBrignoli
2011-12-06 08:55:01 +00:00
parent e3c76e03b5
commit d24fcec613
2 changed files with 18 additions and 16 deletions
+8 -7
View File
@@ -54,7 +54,6 @@ class PDFCore
public function render()
{
$render = false;
$this->pdf_renderer->setFontForLang('fr');
foreach ($this->objects as $object)
@@ -69,6 +68,8 @@ class PDFCore
if (count($this->objects) > 1)
$this->filename = $template->getBulkFilename();
}
$template->assignHookData($object);
$this->pdf_renderer->createHeader($template->getHeader());
$this->pdf_renderer->createFooter($template->getFooter());
@@ -89,12 +90,12 @@ class PDFCore
$class = false;
$classname = 'HTMLTemplate'.$this->template;
if (class_exists($classname))
{
$class = new $classname($object, $this->smarty);
if (!($class instanceof HTMLTemplate))
throw new PrestashopException('Invalid class. It should be an instance of HTMLTemplate');
}
if (class_exists($classname))
{
$class = new $classname($object, $this->smarty);
if (!($class instanceof HTMLTemplate))
throw new PrestashopException('Invalid class. It should be an instance of HTMLTemplate');
}
return $class;
}