first commit

This commit is contained in:
2024-10-28 22:14:22 +01:00
commit b65352c452
40581 changed files with 5712079 additions and 0 deletions

View File

@@ -0,0 +1,323 @@
<?php
/**
* 2007-2022 Leotheme
*
* NOTICE OF LICENSE
*
* LeoElements is module help you can build content for your shop
*
* DISCLAIMER
*
* @author Leotheme <leotheme@gmail.com>
* @copyright 2007-2022 Leotheme
* @license http://leotheme.com - prestashop template provider
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use LeoElements\Leo_Helper;
use LeoElements\Plugin;
require_once(_PS_MODULE_DIR_.'leoelements/src/Leo_Helper.php');
require_once(_PS_MODULE_DIR_.'leoelements/includes/plugin.php');
class LeoElementsAction_ElementModuleFrontController extends ModuleFrontController {
public function init() {
parent::init();
Leo_Helper::add_action( 'wp_ajax_leo_get_products_title_by_id', [ $this, 'leo_get_products_title_by_id' ] );
Leo_Helper::add_action( 'wp_ajax_leo_get_products_by_query', [ $this, 'leo_get_products_by_query' ] );
Leo_Helper::add_action( 'wp_ajax_leo_get_manu_title_by_id', [ $this, 'leo_get_manu_title_by_id' ] );
Leo_Helper::add_action( 'wp_ajax_leo_get_manu_by_query', [ $this, 'leo_get_manu_by_query' ] );
}
public function postProcess() {
parent::initContent();
$post = $GLOBALS['_POST'];
define( 'DOING_AJAX', true );
$GLOBALS['gb_leoelements'] = json_decode( Configuration::get('GBLEOELEMENTS', ''), true);
if( Leo_Helper::set_global_var() ){
Plugin::instance()->on_rest_api_init();
if ( isset( $post['action'] ) ) {
$action = $post['action'];
Leo_Helper::do_action( 'wp_ajax_' . $action );
} elseif ( Tools::getIsset('action') ) {
$action = Tools::getValue('action');
Leo_Helper::do_action( 'wp_ajax_' . $action );
}
}
die( 'exit' );
}
public function leo_get_products_title_by_id()
{
header('Content-Type: application/json');
$product_ids = Tools::getValue( 'ids' );
if ( !$product_ids ) {
die();
}
$id_lang = (int) Leo_Helper::$id_lang;
$id_shop = (int) Leo_Helper::$id_shop;
$sql = 'SELECT p.`id_product`, product_shop.`id_product`,
pl.`name`, pl.`link_rewrite`,
image_shop.`id_image` id_image
FROM `' . _DB_PREFIX_ . 'product` p
' . Shop::addSqlAssociation('product', 'p') . '
LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl ON (
p.`id_product` = pl.`id_product`
AND pl.`id_lang` = ' . (int) $id_lang . Shop::addSqlRestrictionOnLang('pl') . '
)
LEFT JOIN `' . _DB_PREFIX_ . 'image_shop` image_shop
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop=' . (int) $id_shop . ')
WHERE p.id_product IN (' . $product_ids . ')' . '
ORDER BY FIELD(product_shop.id_product, ' . $product_ids . ')';
if ( !$items = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS( $sql ) ) {
return;
}
$results = [];
foreach ( $items as $item ) {
$results[ (int)$item['id_product'] ] = '(Id: ' . (int)( $item['id_product'] ) . ') ' . $item['name'];
}
die( json_encode( $results ) );
}
public function leo_get_products_by_query() {
header('Content-Type: application/json');
$query = Tools::getValue( 'q', false );
if ( !$query or $query == '' or Tools::strlen( $query ) < 1 ) {
die();
}
if ( $pos = strpos( $query, ' (ref:' ) ) {
$query = Tools::substr( $query, 0, $pos );
}
$excludeIds = Tools::getValue( 'excludeIds', false );
if ( $excludeIds && $excludeIds != 'NaN' ) {
$excludeIds = implode( ',', array_map( 'intval', explode( ',', $excludeIds ) ) );
} else {
$excludeIds = '';
}
$excludeVirtuals = false;
$exclude_packs = false;
$context = \Context::getContext();
$id_lang = (int) $context->language->id;
$id_shop = (int) Leo_Helper::$id_shop;
$sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, p.`cache_default_attribute`
FROM `' . _DB_PREFIX_ . 'product` p
' . Shop::addSqlAssociation('product', 'p') . '
LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl ON (pl.id_product = p.id_product AND pl.id_lang = ' . (int) $id_lang . Shop::addSqlRestrictionOnLang('pl') . ')
WHERE (pl.name LIKE \'%' . pSQL($query) . '%\' OR p.reference LIKE \'%' . pSQL($query) . '%\') AND p.`active` = 1' .
( !empty( $excludeIds ) ? ' AND p.id_product NOT IN (' . $excludeIds . ') ' : ' ' ) .
' GROUP BY p.id_product';
$items = Db::getInstance()->executeS($sql);
if ( $items ) {
$results = [];
foreach ( $items as $item ) {
$product = [
'id' => (int)($item['id_product']),
'text' => '(Id: ' . (int)( $item['id_product'] ) . ') ' . $item['name'],
];
array_push( $results, $product );
}
$results = array_values( $results );
die( json_encode( $results ) );
}
}
public function leo_get_manu_by_query()
{
header('Content-Type: application/json');
$query = Tools::getValue( 'q', false );
if ( !$query or $query == '' or Tools::strlen( $query ) < 1 ) {
die();
}
if ( $pos = strpos( $query, ' (ref:' ) ) {
$query = Tools::substr( $query, 0, $pos );
}
$excludeIds = Tools::getValue( 'excludeIds', false );
if ( $excludeIds && $excludeIds != 'NaN' ) {
$excludeIds = implode( ',', array_map( 'intval', explode( ',', $excludeIds ) ) );
} else {
$excludeIds = '';
}
// $excludeVirtuals = false;
// $exclude_packs = false;
// $context = \Context::getContext();
// $id_lang = (int) $context->language->id;
// $id_shop = (int) Leo_Helper::$id_shop;
$withProduct = false;
$group_by = false;
$getNbProducts = false;
$idLang = 0;
$active = false;
$p = false;
$n = false;
$allGroup = false;
$group_by = false;
$withProduct = false;
if (!$idLang) {
$idLang = (int) Configuration::get('PS_LANG_DEFAULT');
}
if (!Group::isFeatureActive()) {
$allGroup = true;
}
$sql = '
SELECT m.*, ml.`description`, ml.`short_description`
FROM `' . _DB_PREFIX_ . 'manufacturer` m'
. Shop::addSqlAssociation('manufacturer', 'm') .
'INNER JOIN `' . _DB_PREFIX_ . 'manufacturer_lang` ml ON (m.`id_manufacturer` = ml.`id_manufacturer` AND ml.`id_lang` = ' . (int) $idLang . ')' .
'WHERE 1 AND (m.name LIKE \'%' . pSQL($query) . '%\') ' .
($active ? 'AND m.`active` = 1 ' : '') .
// ($withProduct ? 'AND m.`id_manufacturer` IN (SELECT `id_manufacturer` FROM `' . _DB_PREFIX_ . 'product`) ' : '') .
($group_by ? ' GROUP BY m.`id_manufacturer`' : '') .
'ORDER BY m.`name` ASC
' . ($p ? ' LIMIT ' . (((int) $p - 1) * (int) $n) . ',' . (int) $n : '');
$items = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
//WHERE (pl.name LIKE \'%' . pSQL($query) . '%\' OR p.reference LIKE \'%' . pSQL($query) . '%\') AND p.`active` = 1' .
// ( !empty( $excludeIds ) ? ' AND p.id_product NOT IN (' . $excludeIds . ') ' : ' ' ) .
// ' GROUP BY p.id_product';
// $items = Db::getInstance()->executeS($sql);
if ( $items ) {
$results = [];
foreach ( $items as $item ) {
$product = [
'id' => (int)($item['id_manufacturer']),
'text' => '(Id: ' . (int)( $item['id_manufacturer'] ) . ') ' . $item['name'],
];
array_push( $results, $product );
}
$results = array_values( $results );
die( json_encode( $results ) );
}
}
public function leo_get_manu_title_by_id()
{
header('Content-Type: application/json');
$manu_ids = Tools::getValue( 'ids' );
if ( !$manu_ids ) {
die();
}
$id_lang = (int) Leo_Helper::$id_lang;
$id_shop = (int) Leo_Helper::$id_shop;
$withProduct = false;
$group_by = false;
$getNbProducts = false;
$idLang = 0;
$active = false;
$p = false;
$n = false;
$allGroup = false;
$group_by = false;
$withProduct = false;
if (!$idLang) {
$idLang = (int) Configuration::get('PS_LANG_DEFAULT');
}
if (!Group::isFeatureActive()) {
$allGroup = true;
}
$sql = '
SELECT m.*, ml.`description`, ml.`short_description`
FROM `' . _DB_PREFIX_ . 'manufacturer` m'
. Shop::addSqlAssociation('manufacturer', 'm') .
'INNER JOIN `' . _DB_PREFIX_ . 'manufacturer_lang` ml ON (m.`id_manufacturer` = ml.`id_manufacturer` AND ml.`id_lang` = ' . (int) $idLang . ')' .
'WHERE 1 ' .
($active ? 'AND m.`active` = 1 ' : '') .
(isset($params['ids']) && $params['ids'] ? 'AND m.`id_manufacturer` IN ('.pSQL(implode(",",$params['ids'])).')' : '') .
// ($withProduct ? 'AND m.`id_manufacturer` IN (SELECT `id_manufacturer` FROM `' . _DB_PREFIX_ . 'product`) ' : '') .
($group_by ? ' GROUP BY m.`id_manufacturer`' : '') .
'ORDER BY m.`name` ASC
' . ($p ? ' LIMIT ' . (((int) $p - 1) * (int) $n) . ',' . (int) $n : '');
if ( !$items = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS( $sql ) ) {
return;
}
$results = [];
foreach ( $items as $item ) {
$results[ (int)$item['id_product'] ] = '(Id: ' . (int)( $item['id_manufacturer'] ) . ') ' . $item['name'];
}
die( json_encode( $results ) );
}
}

View File

@@ -0,0 +1,204 @@
<?php
/**
* 2007-2022 Leotheme
*
* NOTICE OF LICENSE
*
* LeoElements is module help you can build content for your shop
*
* DISCLAIMER
*
* @author Leotheme <leotheme@gmail.com>
* @copyright 2007-2022 Leotheme
* @license http://leotheme.com - prestashop template provider
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class LeoElementsAjaxModuleFrontController extends ModuleFrontController
{
public function init()
{
parent::init();
}
public function postProcess()
{
parent::initContent();
if (Tools::getValue('leoajax') == 1) {
$module = $this->module;
# process category
$list_cat = Tools::getValue('cat_list');
$product_list_image = Tools::getValue('product_list_image');
$product_one_img = Tools::getValue('product_one_img');
$product_attribute_one_img = Tools::getValue('product_attribute_one_img');
$product_all_one_img = Tools::getValue('product_all_one_img');
$leo_pro_cdown = Tools::getValue('pro_cdown');
// $ap_extra = Tools::getValue('product_apextra');
//add function wishlist compare
$wishlist_compare = Tools::getValue('wishlist_compare');
$result = array();
// get number product of compare + wishlist
if ($wishlist_compare) {
$wishlist_products = 0;
if (Configuration::get('LEOFEATURE_ENABLE_PRODUCTWISHLIST') && isset(Context::getContext()->cookie->id_customer)) {
$current_user = (int)Context::getContext()->cookie->id_customer;
$list_wishlist = Db::getInstance()->executeS("SELECT id_wishlist FROM `"._DB_PREFIX_."leofeature_wishlist` WHERE id_customer = '" . (int)$current_user."'");
foreach ($list_wishlist as $list_wishlist_item) {
$number_product_wishlist = Db::getInstance()->getValue("SELECT COUNT(id_wishlist_product) FROM `"._DB_PREFIX_."leofeature_wishlist_product` WHERE id_wishlist = ".(int)$list_wishlist_item['id_wishlist']);
$wishlist_products += $number_product_wishlist;
}
}
$compared_products = array();
if (Configuration::get('LEOFEATURE_ENABLE_PRODUCTCOMPARE') && Configuration::get('LEOFEATURE_COMPARATOR_MAX_ITEM') > 0 && isset(Context::getContext()->cookie->id_compare)) {
$compared_products = Db::getInstance()->executeS('
SELECT DISTINCT `id_product`
FROM `'._DB_PREFIX_.'leofeature_compare` c
LEFT JOIN `'._DB_PREFIX_.'leofeature_compare_product` cp ON (cp.`id_compare` = c.`id_compare`)
WHERE cp.`id_compare` = '.(int)(Context::getContext()->cookie->id_compare));
}
$result['wishlist_products'] = $wishlist_products;
$result['compared_products'] = count($compared_products);
}
if ($list_cat) {
$list_cat = explode(',', $list_cat);
$list_cat = array_filter($list_cat);
$list_cat = array_unique($list_cat);
$list_cat = array_map('intval', $list_cat); // fix sql injection
$list_cat = implode(',', $list_cat);
$sql = 'SELECT COUNT(cp.`id_product`) AS total, cp.`id_category` FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product`
WHERE cp.`id_category` IN ('.pSQL($list_cat).')
AND product_shop.`visibility` IN ("both", "catalog")
AND product_shop.`active` = 1
GROUP BY cp.`id_category`';
$cat = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
if ($cat) {
$result['cat'] = $cat;
}
}
if ($leo_pro_cdown) {
$leo_pro_cdown = explode(',', $leo_pro_cdown);
$leo_pro_cdown = array_unique($leo_pro_cdown);
$leo_pro_cdown = array_map('intval', $leo_pro_cdown); // fix sql injection
$leo_pro_cdown = implode(',', $leo_pro_cdown);
$result['pro_cdown'] = $module->hookProductCdown($leo_pro_cdown);
}
if ($product_list_image) {
$product_list_image = explode(',', $product_list_image);
$product_list_image = array_unique($product_list_image);
$product_list_image = array_map('intval', $product_list_image); // fix sql injection
$product_list_image = implode(',', $product_list_image);
# $leocustomajax = new Leocustomajax();
$result['product_list_image'] = $module->hookProductMoreImg($product_list_image);
}
if ($product_one_img) {
$product_one_img = explode(',', $product_one_img);
$product_one_img = array_unique($product_one_img);
$product_one_img = array_map('intval', $product_one_img); // fix sql injection
$product_one_img = implode(',', $product_one_img);
$result['product_one_img'] = $module->hookProductOneImg($product_one_img);
}
if ($product_attribute_one_img) {
$result['product_attribute_one_img'] = $module->hookProductAttributeOneImg($product_attribute_one_img);
}
if ($product_all_one_img) {
// Get second image of product except image_showed.
$product_all_one_img = explode(',', $product_all_one_img);
$product_all_one_img = array_unique($product_all_one_img);
$product_all_one_img = array_map('intval', $product_all_one_img); // fix sql injection
$product_all_one_img = implode(',', $product_all_one_img);
$result['product_all_one_img'] = $module->hookProductAllOneImg($product_all_one_img);
}
if (Tools::getIsset('product_size') || Tools::getIsset('product_attribute')) {
$product_size = $product_attribute = array();
if (Tools::getIsset('product_size') && Tools::getValue('product_size')) {
$product_size = explode(',', Tools::getValue('product_size'));
}
if (Tools::getIsset('product_attribute') && Tools::getValue('product_attribute')) {
$product_attribute = explode(',', Tools::getValue('product_attribute'));
}
$result['product_attribute'] = $module->hookGetProductAttribute($product_attribute, $product_size);
}
if (Tools::getIsset('product_manufacture')) {
$result['product_manufacture'] = $module->hookGetProductManufacture(Tools::getValue('product_manufacture'));
}
if ($result) {
die(json_encode($result));
}
}
die('LeoElementsAjaxModuleFrontController');
if (Tools::getValue('type') == 'product') {
$this->_renderProducts();
}elseif (Tools::getValue('type') == 'blog') {
$this->_renderBlogs();
}
}
public function _renderProducts()
{
header('Content-Type: application/json');
$options = Tools::getValue('options');
if($options['source'] != 's'){
$data = $this->module->_prepProducts($options);
}else{
$data = $this->module->_prepProductsSelected($options);
}
$content = array_merge($options, $data);
$this->context->smarty->assign(array('content' => $content));
$template = LEOELEMENTS_PATH . 'views/templates/widgets/products.tpl';
if (!$template){
$template = $this->module->l('No template found', 'ajax');
}
$this->ajaxDie(json_encode(array(
'lastPage' => $content['lastPage'],
'html' => $this->context->smarty->fetch($template)
)));
}
public function _renderBlogs()
{
header('Content-Type: application/json');
$options = Tools::getValue('options');
$data = $this->module->_prepBlogs($options);
$content = array_merge($options, $data);
$this->context->smarty->assign(array('content' => $content));
$template = LEOELEMENTS_PATH . 'views/templates/widgets/blogs.tpl';
if (!$template){
$template = $this->module->l('No template found', 'ajax');
}
$this->ajaxDie(json_encode(array(
'html' => $this->context->smarty->fetch($template)
)));
}
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* 2007-2022 Leotheme
*
* NOTICE OF LICENSE
*
* LeoElements is module help you can build content for your shop
*
* DISCLAIMER
*
* @author Leotheme <leotheme@gmail.com>
* @copyright 2007-2022 Leotheme
* @license http://leotheme.com - prestashop template provider
*/
class LeoElementsApPagebuilderHomeModuleFrontController extends FrontController
{
public function __construct()
{
parent::__construct();
$this->display_column_left = false;
$this->display_column_right = false;
}
public function initContent()
{
parent::initContent();
$this->addJS(_THEME_JS_DIR_.'index.js');
$this->context->smarty->assign(array(
'HOOK_HOME' => Hook::exec('displayHome'),
'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'),
'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent')
));
$this->display_column_left = false;
$this->display_column_right = false;
$this->context->smarty->assign(array(
'page_name' => 'index',
));
$this->setTemplate('index.tpl');
}
/**
* set html <body id="index"
*/
public function getPageName()
{
$page_name = 'index';
return $page_name;
}
public function getTemplateVarPage()
{
$page = parent::getTemplateVarPage();
unset($page['body_classes']['page-']);
$page['body_classes']['page-index'] = true;
return $page;
}
}

View File

@@ -0,0 +1,77 @@
<?php
/**
* 2007-2022 Leotheme
*
* NOTICE OF LICENSE
*
* LeoElements is module help you can build content for your shop
*
* DISCLAIMER
*
* @author Leotheme <leotheme@gmail.com>
* @copyright 2007-2022 Leotheme
* @license http://leotheme.com - prestashop template provider
*/
class LeoElementsCartModuleFrontController extends ModuleFrontController
{
public $ssl = true;
/**
* @see FrontController::initContent()
*/
public function initContent()
{
die('LeoElementsCartModuleFrontController');
parent::initContent();
$modal = null;
if(ob_get_contents()){
ob_end_clean();
}
header('Content-Type: application/json');
die(json_encode([
'preview' => $this->renderWidget(['cart' => $this->context->cart]),
]));
}
public function renderWidget(array $params)
{
if (Configuration::isCatalogMode()) {
return;
}
$template = LEOELEMENTS_PATH . 'views/templates/widgets/cart.tpl';
$this->context->smarty->assign($this->getWidgetVariables($params));
return $this->context->smarty->fetch($template);
}
public function getWidgetVariables(array $params)
{
$cart_url = $this->getCartSummaryURL();
return array(
'cart' => (new PrestaShop\PrestaShop\Adapter\Cart\CartPresenter())->present(isset($params['cart']) ? $params['cart'] : $this->context->cart),
'cart_url' => $cart_url,
'has_ajax' => (bool)Configuration::get('PS_BLOCK_CART_AJAX')
);
}
private function getCartSummaryURL()
{
return $this->context->link->getPageLink(
'cart',
null,
$this->context->language->id,
array(
'action' => 'show'
),
false,
null,
true
);
}
}

View File

@@ -0,0 +1,57 @@
<?php
/**
* 2007-2022 Leotheme
*
* NOTICE OF LICENSE
*
* LeoElements is module help you can build content for your shop
*
* DISCLAIMER
*
* @author Leotheme <leotheme@gmail.com>
* @copyright 2007-2022 Leotheme
* @license http://leotheme.com - prestashop template provider
*/
class LeoElementsContactModuleFrontController extends ModuleFrontController
{
public function init()
{
parent::init();
die('LeoElementsContactModuleFrontController');
}
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$notifications = false;
if (Tools::isSubmit('submitMessage') || $this->ajax) {
if(Module::isEnabled('contactform'))
{
$module = Module::getInstanceByName('contactform');
$module->sendMessage();
if (!empty($this->context->controller->errors)) {
$notifications['messages'] = $this->context->controller->errors;
$notifications['nw_error'] = true;
} elseif (!empty($this->context->controller->success)) {
$notifications['messages'] = $this->context->controller->success;
$notifications['nw_error'] = false;
}
if ($this->ajax) {
header('Content-Type: application/json');
$this->ajaxDie(json_encode($notifications));
}
}
}
die();
}
}

View File

@@ -0,0 +1,85 @@
<?php
/**
* 2007-2022 Leotheme
*
* NOTICE OF LICENSE
*
* LeoElements is module help you can build content for your shop
*
* DISCLAIMER
*
* @author Leotheme <leotheme@gmail.com>
* @copyright 2007-2022 Leotheme
* @license http://leotheme.com - prestashop template provider
*/
use LeoElements\Leo_Helper;
use LeoElements\Plugin;
if (!defined('_PS_VERSION_')) {
exit;
}
require_once(_PS_MODULE_DIR_.'leoelements/leoECHelper.php');
require_once(_PS_MODULE_DIR_.'leoelements/classes/LeoElementsContentsModel.php');
require_once(_PS_MODULE_DIR_.'leoelements/src/Leo_Helper.php');
require_once(_PS_MODULE_DIR_.'leoelements/src/Leo_Helper.php');
require_once(_PS_MODULE_DIR_.'leoelements/includes/plugin.php');
class LeoElementsCreatorModuleFrontController extends ModuleFrontController
{
public $name = 'AdminLeoElementsCreatorController';
public $tiam = 'LeoElementsCreator';
public $display_header = false;
public $content_only = true;
public function initContent()
{
$sql = new DbQuery();
$sql->select('e.*');
$sql->from('employee', 'e');
$sql->where('e.`active` = 1');
$sql->where('e.`id_profile` = 1');
$admin = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
if (!$admin) {
return false;
}
$this->context->employee = new Employee($admin['id_employee']);
if ( ( !Tools::getValue('id_post') && !Tools::getValue('key_related') ) || !Tools::getValue('post_type') ) {
$configure = $this->context->link->getAdminLink('AdminModules', false);
$configure .= '&configure='.$this->module->name.'&tab_module='.$this->module->tab.'&module_name='.$this->module->name.'&token='.Tools::getAdminTokenLite('AdminModules');
Tools::redirectAdmin( $configure );
}
$GLOBALS['gb_leoelements'] = (array) json_decode(Configuration::get('GBLEOELEMENTS'), true);
if(isset($GLOBALS['gb_leoelements']['_PS_ADMIN_DIR_'])){
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', $GLOBALS['gb_leoelements']['_PS_ADMIN_DIR_']);
}
if (!defined('PS_ADMIN_DIR')) {
define('PS_ADMIN_DIR', _PS_ADMIN_DIR_);
}
}
if( Leo_Helper::set_global_var() ){
// leoelements/core/editor/editor.php
Plugin::instance()->editor->init();
}
die();
}
public function initProcess() {}
public function initBreadcrumbs( $tab_id = null, $tabs = null ) {}
public function initModal() {}
public function initToolbarFlags() {}
public function initNotifications() {}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2018 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2018 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;

View File

@@ -0,0 +1,57 @@
<?php
/**
* 2007-2022 Leotheme
*
* NOTICE OF LICENSE
*
* LeoElements is module help you can build content for your shop
*
* DISCLAIMER
*
* @author Leotheme <leotheme@gmail.com>
* @copyright 2007-2022 Leotheme
* @license http://leotheme.com - prestashop template provider
*/
class LeoElementsSubscriptionModuleFrontController extends ModuleFrontController
{
private $variables = [];
public function init()
{
parent::init();
die('LeoElementsSubscriptionModuleFrontController');
}
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$this->variables['value'] = Tools::getValue('email', '');
$this->variables['msg'] = '';
$this->variables['conditions'] = Configuration::get('NW_CONDITIONS', $this->context->language->id);
if (Tools::isSubmit('submitNewsletter') || $this->ajax) {
if(Module::isEnabled('ps_emailsubscription'))
{
$module = Module::getInstanceByName('ps_emailsubscription');
$module->newsletterRegistration();
if ($module->error) {
$this->variables['msg'] = $module->error;
$this->variables['nw_error'] = true;
} elseif ($module->valid) {
$this->variables['msg'] = $module->valid;
$this->variables['nw_error'] = false;
}
if ($this->ajax) {
header('Content-Type: application/json');
$this->ajaxDie(json_encode($this->variables));
}
}
}
die();
}
}