* @copyright HiPresta 2020 * @license Addons PrestaShop license limitation * @link https://hipresta.com * * NOTICE OF LICENSE * * Don't use this module on several shops. The license provided by PrestaShop Addons * for all its modules is valid only once for a single shop. */ class HiGalleryAjaxModuleFrontController extends ModuleFrontController { public function __construct() { $this->secure_key = Tools::getValue('secure_key'); parent::__construct(); } public function postProcess() { if ($this->secure_key != $this->module->secure_key || Tools::getValue('action') != 'renderGallery' || !$this->ajax) { $ret = array( 'error' => true, 'message' => 'Bad Request!' ); header('Content-Type: application/json'); $this->ajaxDie(json_encode($ret)); } $ret = array( 'error' => false, 'content' => $this->module->renderGallery(Tools::getValue('id_gallery')) ); header('Content-Type: application/json'); $this->ajaxDie(json_encode($ret)); } }