Files
wyczarujprezent.pl/modules/configurator/HTMLTemplateConfigurator.php
2024-10-28 22:14:22 +01:00

74 lines
1.7 KiB
PHP

<?php
class HTMLTemplateConfigurator extends HTMLTemplate
{
public $configurator_fields;
/**
* @param array $configurator_fields
* @param Smarty $smarty
* @param bool $bulk_mode
*
* @throws PrestaShopException
*/
public function __construct(array $configurator_fields, Smarty $smarty, $bulk_mode = false)
{
$this->configurator_fields = $configurator_fields;
$this->smarty = $smarty;
$this->shop = new Shop(Context::getContext()->shop->id);
$this->title = Context::getContext()->getTranslator()->trans('Config', [], 'Shop.Pdf');
}
/**
* Returns the template's HTML header.
*
* @return string HTML header
*/
public function getHeader()
{
return $this->smarty->fetch('module:configurator/header.tpl');
}
/**
* Returns the template's HTML content.
*
* @return string HTML content
*/
public function getContent()
{
$this->smarty->assign('configurator_fields', $this->configurator_fields['configurator_fields']);
return $this->smarty->fetch('module:configurator/configurator.tpl');
}
/**
* Returns the template filename when using bulk rendering
* @return string filename
*/
public function getBulkFilename()
{
return 'config.pdf';
}
public function getFooter()
{
return $this->smarty->fetch('module:configurator/footer.tpl');
}
public function getLogo()
{
return $this->smarty->fetch('module:configurator/logo.tpl');
}
/**
* Returns the template filename.
*
* @return string filename
*/
public function getFilename()
{
return 'config.pdf';
}
}