first commit
This commit is contained in:
45
modules/higallery/controllers/front/ajax.php
Normal file
45
modules/higallery/controllers/front/ajax.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* 2012 - 2020 HiPresta
|
||||
*
|
||||
* MODULE Gallery
|
||||
*
|
||||
* @author HiPresta <support@hipresta.com>
|
||||
* @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));
|
||||
}
|
||||
}
|
||||
54
modules/higallery/controllers/front/gallery.php
Normal file
54
modules/higallery/controllers/front/gallery.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* 2012 - 2020 HiPresta
|
||||
*
|
||||
* MODULE Gallery
|
||||
*
|
||||
* @author HiPresta <support@hipresta.com>
|
||||
* @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 HiGalleryGalleryModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public $display_column_left = false;
|
||||
public $display_column_right = false;
|
||||
|
||||
public function getBreadcrumbLinks()
|
||||
{
|
||||
$breadcrumb = parent::getBreadcrumbLinks();
|
||||
$breadcrumb['links'][] = array(
|
||||
'title' => $this->module->l('Gallery', 'gallery'),
|
||||
'url' => $this->module->getGalleryFrontUrl(),
|
||||
);
|
||||
return $breadcrumb;
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'psv' => $this->module->psv,
|
||||
'meta_title' => $this->module->gallery_meta_title[$this->context->language->id],
|
||||
'meta_description' => $this->module->gallery_meta_description[$this->context->language->id],
|
||||
'meta_keywords' => $this->module->gallery_meta_keywords[$this->context->language->id],
|
||||
'gallery_controller_name' => Dispatcher::getInstance()->getController(),
|
||||
'upload_img_path' => __PS_BASE_URI__.'modules/'.$this->module->name.'/views/img/upload/',
|
||||
'galleries' => GalleryItem::getAllGalleries('active', 'gallery_page'),
|
||||
'gallery_title' => Configuration::get('HI_GALLERY_PAGE_TITLE', $this->context->language->id),
|
||||
'gallery_description' => Configuration::get('HI_GALLERY_PAGE_DESCRIPTION', $this->context->language->id)
|
||||
));
|
||||
if ($this->module->psv >= 1.7) {
|
||||
$this->setTemplate('module:'.$this->module->name.'/views/templates/front/galleries17.tpl');
|
||||
} else {
|
||||
$this->setTemplate('galleries.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
61
modules/higallery/controllers/front/galleryimage.php
Normal file
61
modules/higallery/controllers/front/galleryimage.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* 2012 - 2020 HiPresta
|
||||
*
|
||||
* MODULE Gallery
|
||||
*
|
||||
* @author HiPresta <support@hipresta.com>
|
||||
* @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 HiGalleryGalleryImageModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public $display_column_left = false;
|
||||
public $display_column_right = false;
|
||||
|
||||
// getBreadcrumbLinks() Add breadcrumb in Ps 1.7 Work only in PS 1.7
|
||||
public function getBreadcrumbLinks()
|
||||
{
|
||||
$breadcrumb = parent::getBreadcrumbLinks();
|
||||
$breadcrumb['links'][] = array(
|
||||
'title' => $this->module->l('Gallery', 'galleryimage'),
|
||||
'url' => $this->module->getGalleryFrontUrl(),
|
||||
);
|
||||
|
||||
$galleryimage = GalleryItem::getGalleriesContentByFriendlyUrl(Tools::getValue('link_rewrite'));
|
||||
if (!empty($galleryimage) && isset($galleryimage['name'])) {
|
||||
$breadcrumb['links'][] = array(
|
||||
'title' => $galleryimage['name'],
|
||||
'url' => ''
|
||||
);
|
||||
}
|
||||
return $breadcrumb;
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
$galleryimage = GalleryItem::getGalleriesContentByFriendlyUrl(Tools::getValue('link_rewrite'));
|
||||
$this->context->smarty->assign(array(
|
||||
'gallery_front_controller' => $this->module->getGalleryFrontUrl(),
|
||||
'meta_title' => !empty($galleryimage) ? $galleryimage['meta_title'] : '',
|
||||
'meta_description' => !empty($galleryimage) ? $galleryimage['meta_description'] : '',
|
||||
'meta_keywords' => !empty($galleryimage) ? $galleryimage['meta_keywords'] : '',
|
||||
'psv' => $this->module->psv,
|
||||
'galleryimage' => $galleryimage,
|
||||
'upload_img_path' => __PS_BASE_URI__.'modules/'.$this->module->name.'/views/img/upload/',
|
||||
));
|
||||
if ($this->module->psv >= 1.7) {
|
||||
$this->setTemplate('module:'.$this->module->name.'/views/templates/front/galleryimage17.tpl');
|
||||
} else {
|
||||
$this->setTemplate('galleryimage.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
27
modules/higallery/controllers/front/index.php
Normal file
27
modules/higallery/controllers/front/index.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* 2012 - 2020 HiPresta
|
||||
*
|
||||
* MODULE Gallery
|
||||
*
|
||||
* @author HiPresta <support@hipresta.com>
|
||||
* @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.
|
||||
*/
|
||||
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
Reference in New Issue
Block a user