62 lines
2.2 KiB
PHP
62 lines
2.2 KiB
PHP
<?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');
|
|
}
|
|
}
|
|
}
|