archive.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. //use PrestaShop\PrestaShop\Core\Product\Search\Pagination;
  3. include_once _PS_MODULE_DIR_.'chcreateur/classes/chcreapost.php';
  4. class ChcreateurArchiveModuleFrontController extends ModuleFrontController
  5. {
  6. public function __construct()
  7. {
  8. parent::__construct();
  9. $this->controller_type = 'modulefront';
  10. $this->page_name = $this->module->name.'-archive';
  11. }
  12. public function init()
  13. {
  14. parent::init();
  15. }
  16. public function setMedia($isNewTheme = false)
  17. {
  18. parent::setMedia();
  19. $this->context->controller->addJS(chcrea_js_dir.'chslider.js');
  20. }
  21. public function initContent()
  22. {
  23. parent::initContent();
  24. $id_lang = (int)Context::getContext()->language->id;
  25. $chcreavars = [];
  26. $chcreavars['name'] = configuration::get('CHCREATEUR_TITLE');
  27. $chcreavars['description'] = configuration::get('CHCREATEUR_DESCRIPTION');
  28. $this->context->smarty->assign('chvars', $chcreavars);
  29. $this->context->smarty->assign('chposts', Chcreapost::getAllSelections());
  30. $this->setTemplate('module:chcreateur/views/templates/front/archive.tpl');
  31. }
  32. public function getBreadcrumbLinks()
  33. {
  34. $breadcrumb = parent::getBreadcrumbLinks();
  35. $breadcrumb['links'][] = [
  36. 'title' => Configuration::get(strtoupper($this->module->name).'_TITLE'),
  37. 'url' => '/'.Configuration::get('CHCREATEUR_URL'),
  38. ];
  39. return $breadcrumb;
  40. }
  41. }