Merge branch 'main' of http://91.189.216.43:3000/jacek.pyziak/drmaterac.pl
This commit is contained in:
@@ -38,7 +38,7 @@ class APPageBuilder extends Module
|
||||
protected $product_active;
|
||||
protected $backup_dir;
|
||||
protected $header_content;
|
||||
|
||||
|
||||
protected $_confirmations = array();
|
||||
protected $_errors = array();
|
||||
protected $_warnings = array();
|
||||
@@ -56,7 +56,7 @@ class APPageBuilder extends Module
|
||||
$this->secure_key = Tools::encrypt($this->name);
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
|
||||
$this->displayName = $this->l('Apollo Page Builder');
|
||||
$this->description = $this->l('Apollo Page Builder build content for your site.');
|
||||
$this->theme_name = _THEME_NAME_;
|
||||
@@ -66,7 +66,7 @@ class APPageBuilder extends Module
|
||||
$this->templateFile = 'module:appagebuilder/views/templates/hook/appagebuilder.tpl';
|
||||
$this->redirectFriendUrl();
|
||||
}
|
||||
|
||||
|
||||
public function redirectFriendUrl()
|
||||
{
|
||||
// if (Context::getContext()->controller === null || (isset(Context::getContext()->controller->controller_type) && in_array(Context::getContext()->controller->controller_type, array('front', 'modulefront')))) {
|
||||
@@ -80,19 +80,19 @@ class APPageBuilder extends Module
|
||||
if (isset($profile_data['friendly_url']) && !empty($profile_data['friendly_url'])) {
|
||||
require_once(_PS_MODULE_DIR_.'appagebuilder/libs/LeoFriendlyUrl.php');
|
||||
$leo_friendly_url = LeoFriendlyUrl::getInstance();
|
||||
|
||||
|
||||
$link = Context::getContext()->link;
|
||||
$idLang = Context::getContext()->language->id;
|
||||
$idShop = null;
|
||||
$relativeProtocol = false;
|
||||
|
||||
|
||||
$url = $link->getBaseLink($idShop, null, $relativeProtocol).$leo_friendly_url->getLangLink($idLang, null, $idShop).$profile_data['friendly_url'].'.html';
|
||||
$leo_friendly_url->canonicalRedirection($url);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
static $_instance;
|
||||
@@ -105,20 +105,20 @@ class APPageBuilder extends Module
|
||||
public function install()
|
||||
{
|
||||
require_once(_PS_MODULE_DIR_.$this->name.'/libs/setup.php');
|
||||
|
||||
|
||||
//DONGND:: build shortcode, create folder for override
|
||||
apPageHelper::createShortCode();
|
||||
|
||||
|
||||
if (!parent::install() || !ApPageSetup::installConfiguration() || !ApPageSetup::createTables() || !ApPageSetup::installModuleTab() || !$this->registerLeoHook()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
# NOT LOAD DATASAMPLE AGAIN
|
||||
Configuration::updateValue('AP_INSTALLED_APPAGEBUILDER', '1');
|
||||
|
||||
|
||||
# REMOVE FILE INDEX.PHP FOR TRANSLATE
|
||||
ApPageSetup::processTranslateTheme();
|
||||
|
||||
|
||||
Configuration::updateValue('APPAGEBUILDER_OVERRIDED', 1);
|
||||
|
||||
return true;
|
||||
@@ -127,21 +127,21 @@ class APPageBuilder extends Module
|
||||
public function uninstall()
|
||||
{
|
||||
require_once(_PS_MODULE_DIR_.$this->name.'/libs/setup.php');
|
||||
|
||||
|
||||
//DONGND:: rollback default file config for tinymce
|
||||
Tools::copy(_PS_MODULE_DIR_.$this->name.'/views/js/shortcode/backup/tinymce.inc.js', _PS_ROOT_DIR_.'/js/admin/tinymce.inc.js');
|
||||
|
||||
if (!parent::uninstall()|| !ApPageSetup::uninstallModuleTab() || !ApPageSetup::deleteTables() || !ApPageSetup::uninstallConfiguration()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//DONGND:: remove overrider folder
|
||||
// $this->uninstallOverrides();
|
||||
Configuration::updateValue('APPAGEBUILDER_OVERRIDED', 0);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public function hookActionModuleRegisterHookAfter($params)
|
||||
{
|
||||
if (isset($params['hook_name']) && ($params['hook_name'] == 'header' || $params['hook_name']=='displayheader')) {
|
||||
@@ -150,7 +150,7 @@ class APPageBuilder extends Module
|
||||
$id_hook = Hook::getIdByName($hook_name);
|
||||
$id_module = $this->id;
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
|
||||
|
||||
// Get module position in hook
|
||||
$sql = 'SELECT MAX(`position`) AS position
|
||||
FROM `'._DB_PREFIX_.'hook_module`
|
||||
@@ -167,13 +167,13 @@ class APPageBuilder extends Module
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (count($this->errors) > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Tools::isSubmit('installdemo')) {
|
||||
require_once(_PS_MODULE_DIR_.$this->name.'/libs/setup.php');
|
||||
ApPageSetup::installSample();
|
||||
@@ -242,12 +242,12 @@ class APPageBuilder extends Module
|
||||
$this->errors[] = $this->trans('You do not have permission to configure this.', array(), 'Admin.Notifications.Error');
|
||||
$this->context->smarty->assign('errors', $this->errors);
|
||||
}
|
||||
|
||||
|
||||
$this->postProcess();
|
||||
|
||||
|
||||
$output = '';
|
||||
$this->backup_dir = str_replace('\\', '/', _PS_CACHE_DIR_.'backup/modules/appagebuilder/');
|
||||
|
||||
|
||||
$create_profile_link = $this->context->link->getAdminLink('AdminApPageBuilderProfiles').'&addappagebuilder_profiles';
|
||||
$profile_link = $this->context->link->getAdminLink('AdminApPageBuilderProfiles');
|
||||
$position_link = $this->context->link->getAdminLink('AdminApPageBuilderPositions');
|
||||
@@ -283,7 +283,7 @@ class APPageBuilder extends Module
|
||||
foreach ($field_text as $k => $v) {
|
||||
// validate module
|
||||
unset($k);
|
||||
|
||||
|
||||
$v = str_replace(' ', '_', trim($v));
|
||||
$v = preg_replace('/[^A-Za-z0-9\_]/', '', $v);
|
||||
if ($v && !in_array($v, $field_default)) {
|
||||
@@ -299,14 +299,14 @@ class APPageBuilder extends Module
|
||||
foreach ($field_editor as $k => $v) {
|
||||
// validate module
|
||||
unset($k);
|
||||
|
||||
|
||||
$v = str_replace(' ', '_', trim($v));
|
||||
$v = preg_replace('/[^A-Za-z0-9\_]/', '', $v);
|
||||
if ($v && !in_array($v, $field_text) && !in_array($v, $field_default)) {
|
||||
$field_editor_valid[] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Configuration::updateValue($fe, implode(',', $field_editor_valid));
|
||||
$this->processExtrafield($field_editor_valid, $type, 'text');
|
||||
}
|
||||
@@ -440,7 +440,7 @@ class APPageBuilder extends Module
|
||||
public function processBackup()
|
||||
{
|
||||
$install_folder = $this->backup_dir;
|
||||
|
||||
|
||||
if (!is_dir($install_folder)) {
|
||||
mkdir($install_folder, 0755, true);
|
||||
}
|
||||
@@ -576,7 +576,7 @@ class APPageBuilder extends Module
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* sub function of back-up database
|
||||
*/
|
||||
@@ -934,7 +934,7 @@ class APPageBuilder extends Module
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$form_extrafield = array(
|
||||
|
||||
'legend' => array(
|
||||
@@ -1168,7 +1168,7 @@ class APPageBuilder extends Module
|
||||
{
|
||||
$this->context->controller->addCss(apPageHelper::getCssDir().'style.css');
|
||||
$result = array();
|
||||
|
||||
|
||||
foreach ($form_general['input'] as $form) {
|
||||
//$form['name'] = isset($form['name']) ? $form['name'] : '';
|
||||
if (Configuration::hasKey($form['name'])) {
|
||||
@@ -1177,7 +1177,7 @@ class APPageBuilder extends Module
|
||||
$result[$form['name']] = Tools::getValue($form['name'], isset($form['default']) ? $form['default'] : '');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($form_extrafield['input'] as $form) {
|
||||
//$form['name'] = isset($form['name']) ? $form['name'] : '';
|
||||
if (Configuration::hasKey($form['name'])) {
|
||||
@@ -1239,7 +1239,7 @@ class APPageBuilder extends Module
|
||||
$assign['apLiveEdit'] .= '" target="_blank"><i class="icon-pencil"></i> <span>Edit</span></a>';
|
||||
$assign['apLiveEditEnd'] = '</div>';
|
||||
}
|
||||
|
||||
|
||||
if ($assign) {
|
||||
foreach ($assign as $key => $ass) {
|
||||
$this->smarty->assign(array($key => $ass));
|
||||
@@ -1315,12 +1315,12 @@ class APPageBuilder extends Module
|
||||
if ($value_by_categories) {
|
||||
$id_categories = isset($params['categorybox']) ? $params['categorybox'] : '';
|
||||
$id_categories = apPageHelper::addonValidInt( $id_categories ); # We validate id_categories in apPageHelper::addonValidInt function . This function is used at any where
|
||||
|
||||
|
||||
if (isset($params['category_type']) && $params['category_type'] == 'default') {
|
||||
$where .= ' AND product_shop.`id_category_default` IN ('.pSQL($id_categories).')';
|
||||
} else {
|
||||
$sql_join .= ' INNER JOIN '._DB_PREFIX_.'category_product cp ON (cp.id_product= p.`id_product` )';
|
||||
|
||||
|
||||
$where .= ' AND cp.`id_category` IN ('.pSQL($id_categories).')';
|
||||
$sql_group = ' GROUP BY p.id_product';
|
||||
}
|
||||
@@ -1384,7 +1384,7 @@ class APPageBuilder extends Module
|
||||
}
|
||||
$where .= ' AND p.`id_product` IN ('.((is_array($tab_id_product) && count($tab_id_product)) ? implode(', ', $tab_id_product) : 0).')';
|
||||
}
|
||||
|
||||
|
||||
$sql = 'SELECT p.*, product_shop.*, p.`reference`, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity,
|
||||
product_attribute_shop.id_product_attribute,
|
||||
product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity,
|
||||
@@ -1402,7 +1402,7 @@ class APPageBuilder extends Module
|
||||
} else {
|
||||
$sql .= ' FROM `'._DB_PREFIX_.'product` p';
|
||||
}
|
||||
|
||||
|
||||
$sql .= ' INNER JOIN '._DB_PREFIX_.'product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = '.(int)$context->shop->id.')
|
||||
LEFT JOIN '._DB_PREFIX_.'product_attribute_shop product_attribute_shop ON p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop='.(int)$context->shop->id.'
|
||||
'.ProductCore::sqlStock('p', 'product_attribute_shop', false, $context->shop).'
|
||||
@@ -1452,14 +1452,14 @@ class APPageBuilder extends Module
|
||||
)
|
||||
);
|
||||
Configuration::updateValue('shortcode_url_add', $this->context->link->getAdminLink('AdminApPageBuilderShortcode'));
|
||||
|
||||
|
||||
$this->autoRestoreSampleData();
|
||||
}
|
||||
|
||||
public function hookdisplayHeader()
|
||||
{
|
||||
apPageHelper::autoUpdateModule();
|
||||
|
||||
|
||||
if ( Tools::getIsset('leo_support_team') && (int)Tools::getValue('leo_support_team') == 1) {
|
||||
Configuration::updateValue('LEO_SUPPORT_TEAM', '1');
|
||||
die('update');
|
||||
@@ -1467,7 +1467,7 @@ class APPageBuilder extends Module
|
||||
Configuration::updateValue('LEO_SUPPORT_TEAM', '0');
|
||||
die('update');
|
||||
}
|
||||
|
||||
|
||||
if (isset(Context::getContext()->controller->controller_type) && in_array(Context::getContext()->controller->controller_type, array('front', 'modulefront'))) {
|
||||
# WORK AT FRONTEND
|
||||
apPageHelper::loadShortCode(_PS_THEME_DIR_);
|
||||
@@ -1479,12 +1479,12 @@ class APPageBuilder extends Module
|
||||
# FIX 1.7
|
||||
apPageHelper::setGlobalVariable($this->context);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (Configuration::get('APPAGEBUILDER_LOAD_WAYPOINTS')) {
|
||||
$uri = apPageHelper::getCssDir().'animate.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'waypoints.min.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
}
|
||||
@@ -1501,7 +1501,7 @@ class APPageBuilder extends Module
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
$uri = apPageHelper::getCssDir().'owl.theme.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'owl.carousel.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
}
|
||||
@@ -1509,7 +1509,7 @@ class APPageBuilder extends Module
|
||||
if (Configuration::get('APPAGEBUILDER_LOAD_SWIPER')) {
|
||||
$uri = apPageHelper::getCssDir().'swiper.min.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'swiper.min.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
}
|
||||
@@ -1557,12 +1557,12 @@ class APPageBuilder extends Module
|
||||
if ($product_list_image) {
|
||||
$this->context->controller->addJqueryPlugin(array('scrollTo', 'serialScroll'));
|
||||
}
|
||||
|
||||
|
||||
// add js for html5 youtube video
|
||||
if (Configuration::get('APPAGEBUILDER_LOAD_HTML5VIDEO')) {
|
||||
$uri = apPageHelper::getCssDir().'mediaelementplayer.min.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'mediaelement-and-player.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
}
|
||||
@@ -1570,7 +1570,7 @@ class APPageBuilder extends Module
|
||||
if (Configuration::get('APPAGEBUILDER_LOAD_FULLPAGEJS')) {
|
||||
$uri = apPageHelper::getCssDir().'jquery.fullPage.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'jquery.fullPage.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
}
|
||||
@@ -1578,7 +1578,7 @@ class APPageBuilder extends Module
|
||||
if (Configuration::get('APPAGEBUILDER_LOAD_IMAGE360')) {
|
||||
$uri = apPageHelper::getCssDir().'ApImage360.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'ApImage360.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
$this->context->controller->addJqueryUI('ui.slider');
|
||||
@@ -1587,7 +1587,7 @@ class APPageBuilder extends Module
|
||||
if (Configuration::get('APPAGEBUILDER_LOAD_IMAGEHOTPOT')) {
|
||||
$uri = apPageHelper::getCssDir().'ApImageHotspot.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'ApImageHotspot.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
}
|
||||
@@ -1598,20 +1598,20 @@ class APPageBuilder extends Module
|
||||
|
||||
$uri = apPageHelper::getCssDir().'styles.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
//DONGND:: add unique css file, css of module for all theme, no need override
|
||||
|
||||
//DONGND:: add unique css file, css of module for all theme, no need override
|
||||
$uri = apPageHelper::getCssDir().'unique.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'script.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
if (!$this->product_active) {
|
||||
$this->product_active = ApPageBuilderProductsModel::getActive();
|
||||
}
|
||||
$this->smarty->smarty->assign(array('productClassWidget' => $this->product_active['class']));
|
||||
|
||||
|
||||
$tpl_file = apPageHelper::getConfigDir('theme_profiles') . $this->product_active['plist_key'].'.tpl';
|
||||
|
||||
|
||||
if (is_file($tpl_file)) {
|
||||
$this->smarty->smarty->assign(array('productProfileDefault' => $this->product_active['plist_key']));
|
||||
}
|
||||
@@ -1626,7 +1626,7 @@ class APPageBuilder extends Module
|
||||
'mediumSize' => Image::getSize(ImageType::getFormattedName('medium'))
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
# LEOTEMCP
|
||||
$isRTL = $this->context->language->is_rtl;
|
||||
$leoRTL = $this->context->language->is_rtl;
|
||||
@@ -1640,7 +1640,7 @@ class APPageBuilder extends Module
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($rtl_file) {
|
||||
$leoRTL = false; // to remove class RTL
|
||||
// $this->context->controller->unregisterStylesheet('theme-rtl');
|
||||
@@ -1650,11 +1650,11 @@ class APPageBuilder extends Module
|
||||
}
|
||||
// $id_shop = $this->context->shop->id;
|
||||
// $helper = LeoFrameworkHelper::getInstance();
|
||||
|
||||
|
||||
$this->themeCookieName = $this->getConfigName('PANEL_CONFIG');
|
||||
$panelTool = $this->getConfig('PANELTOOL');
|
||||
$backGroundValue = '';
|
||||
|
||||
|
||||
//DONGND:: get product detail layout
|
||||
$list_productdetail_layout = array();
|
||||
|
||||
@@ -1664,17 +1664,17 @@ class APPageBuilder extends Module
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
$uri = apPageHelper::getCssDir().'paneltool.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'colorpicker/js/colorpicker.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
$uri = apPageHelper::getJsDir().'paneltool.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
$this->context->controller->addJqueryPlugin('cooki-plugin');
|
||||
|
||||
|
||||
$skin = $this->getPanelConfig('default_skin');
|
||||
$layout_mode = $this->getPanelConfig('layout_mode');
|
||||
$enable_fheader = (int)$this->getPanelConfig('enable_fheader');
|
||||
|
||||
|
||||
$backGroundValue = array(
|
||||
'attachment' => array('scroll', 'fixed', 'local', 'initial', 'inherit'),
|
||||
'repeat' => array('repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'initial', 'inherit'),
|
||||
@@ -1720,7 +1720,7 @@ class APPageBuilder extends Module
|
||||
$this->context->controller->addJqueryPlugin('cooki-plugin');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if ($this->getConfig('ENABLE_CUSTOMFONT')) {
|
||||
// # CUSTOM FONT
|
||||
// $uri = apPageHelper::getCssDir().'fonts-cuttom.css';
|
||||
@@ -1731,7 +1731,7 @@ class APPageBuilder extends Module
|
||||
$uri = apPageHelper::getCssDir().'fonts-cuttom2.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
}
|
||||
|
||||
|
||||
$layout_width_val = '';
|
||||
$layout_width = $this->getConfig('layout_width');
|
||||
if (trim($layout_width) != 'auto' && trim($layout_width) != '') {
|
||||
@@ -1742,7 +1742,7 @@ class APPageBuilder extends Module
|
||||
$layout_width_val .= '<script type="text/javascript">layout_width = '.$layout_width.';</script>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$load_css_type = $this->getConfig('load_css_type');
|
||||
$css_skin = array();
|
||||
$css_custom = array();
|
||||
@@ -1752,19 +1752,19 @@ class APPageBuilder extends Module
|
||||
$uri = apPageHelper::getCssDir().'non-responsive.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
}
|
||||
|
||||
|
||||
# LOAD SKIN CSS IN MODULE
|
||||
$uri = apPageHelper::getCssDir().'skins/'.$skin.'/skin.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
$uri = apPageHelper::getCssDir().'skins/'.$skin.'/custom-rtl.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
# LOAD CUSTOM CSS
|
||||
if ($this->context->getMobileDevice() != false && !$this->getConfig('enable_responsive')) {
|
||||
$uri = apPageHelper::getCssDir().'mobile.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
}
|
||||
|
||||
|
||||
# LOAD POSITIONS AND PROFILES
|
||||
$this->loadResouceForProfile();
|
||||
|
||||
@@ -1782,7 +1782,7 @@ class APPageBuilder extends Module
|
||||
$css_skin[] = '<link rel="stylesheet" href="'.apPageHelper::getUriFromPath($skinFileUrl).'" type="text/css" media="all" />';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# LOAD SKIN CSS IN TPL
|
||||
$uri = apPageHelper::getCssDir().'skins/'.$skin.'/skin.css';
|
||||
$skinFileUrl = apPageHelper::getFullPathCss($uri);
|
||||
@@ -1794,7 +1794,7 @@ class APPageBuilder extends Module
|
||||
if ($leoRTL && $skinFileUrl !== false) {
|
||||
$css_skin[] = '<link rel="stylesheet" id="leo-dynamic-skin-css-rtl" href="'.apPageHelper::getUriFromPath($skinFileUrl).'" type="text/css" media="all" />';
|
||||
}
|
||||
|
||||
|
||||
# LOAD CUSTOM CSS
|
||||
if ($this->context->getMobileDevice() != false && !$this->getConfig('enable_responsive')) {
|
||||
$uri = apPageHelper::getCssDir().'mobile.css';
|
||||
@@ -1803,10 +1803,10 @@ class APPageBuilder extends Module
|
||||
$css_skin[] = '<link rel="stylesheet" href="'.apPageHelper::getUriFromPath($skinFileUrl).'" type="text/css" media="all" />';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# LOAD POSITIONS AND PROFILES
|
||||
$this->loadResouceForProfile();
|
||||
|
||||
|
||||
# LOAD PATTERN
|
||||
if ($profile = $this->getConfig('c_profile')) {
|
||||
$uri = apPageHelper::getCssDir().'patterns/'.$profile.'.css';
|
||||
@@ -1816,7 +1816,7 @@ class APPageBuilder extends Module
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($this->context->language->is_rtl) {
|
||||
# OVERRIDE CORE, LOAD RTL.CSS FILE AT BOTTOM
|
||||
$this->context->controller->registerStylesheet('theme-rtl', '/assets/css/rtl.css', ['media' => 'all', 'priority' => 9000]);
|
||||
@@ -1926,24 +1926,25 @@ class APPageBuilder extends Module
|
||||
|
||||
$cache_id = $this->getCacheId('apshortcode', $shortcode_key);
|
||||
if ($disable_cache || !$this->isCached($this->templateFile, $cache_id)) {
|
||||
|
||||
$shortcode_html = '';
|
||||
$shortcode_obj = ApPageBuilderShortcodeModel::getShortCode($shortcode_key);
|
||||
if (isset($shortcode_obj['id_appagebuilder']) && $shortcode_obj['id_appagebuilder'] != '' && $shortcode_obj['id_appagebuilder'] != 0) {
|
||||
$shortcode_code = ApPageBuilderShortcodeModel::getAllItems($shortcode_obj['id_appagebuilder'], 1);
|
||||
|
||||
|
||||
if (!empty($shortcode_code)) {
|
||||
if (empty(ApShortCodesBuilder::$shortcode_tags)) {
|
||||
apPageHelper::loadShortCode(_PS_THEME_DIR_);
|
||||
}
|
||||
|
||||
|
||||
apPageHelper::setGlobalVariable($this->context);
|
||||
|
||||
|
||||
// ApShortCodesBuilder::$is_front_office = 1;
|
||||
// ApShortCodesBuilder::$is_gen_html = 1;
|
||||
// ApShortCodesBuilder::$profile_param = array();
|
||||
$ap_helper = new ApShortCodesBuilder();
|
||||
// ApShortCodesBuilder::$hook_name = 'apshortcode';
|
||||
|
||||
|
||||
$shortcode_html = $ap_helper->parse($shortcode_code['apshortcode']);
|
||||
}
|
||||
}
|
||||
@@ -2005,7 +2006,7 @@ class APPageBuilder extends Module
|
||||
}
|
||||
return $cover_hook_live.$this->fetch( $this->templateFile, $cache_id);
|
||||
}
|
||||
|
||||
|
||||
public function hookDisplayBanner($params)
|
||||
{
|
||||
return $this->processHook('displayBanner', $params);
|
||||
@@ -2080,23 +2081,23 @@ class APPageBuilder extends Module
|
||||
{
|
||||
return $this->processHook('displayLeftColumnProduct', $params);
|
||||
}
|
||||
|
||||
|
||||
public function hookdisplayProductButtons($params)
|
||||
{
|
||||
return $this->processHook('displayProductButtons', $params);
|
||||
}
|
||||
|
||||
|
||||
public function hookDisplayReassurance($params)
|
||||
{
|
||||
return $this->processHook('displayReassurance', $params);
|
||||
}
|
||||
|
||||
|
||||
public function hookDisplayLeoProfileProduct($params)
|
||||
{
|
||||
apPageHelper::setGlobalVariable($this->context);
|
||||
$html = '';
|
||||
$tpl_file = '';
|
||||
|
||||
|
||||
if (isset($params['ony_global_variable'])) {
|
||||
# {hook h='displayLeoProfileProduct' ony_global_variable=true}
|
||||
return $html;
|
||||
@@ -2148,7 +2149,7 @@ class APPageBuilder extends Module
|
||||
// $this->unregisterExceptions((int)$row['id_hook']);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* FIX BUG 1.7.3.3 : install theme lose hook displayHome, displayLeoProfileProduct
|
||||
* because ajax not run hookActionAdminBefore();
|
||||
@@ -2163,7 +2164,7 @@ class APPageBuilder extends Module
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run only one when install/change Theme_of_Leo
|
||||
*/
|
||||
@@ -2176,8 +2177,8 @@ class APPageBuilder extends Module
|
||||
// Other module call this hook -> duplicate data
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# FIX : update Prestashop by 1-Click module -> NOT NEED RESTORE DATABASE
|
||||
$ap_version = Configuration::get('AP_CURRENT_VERSION');
|
||||
if ($ap_version != false) {
|
||||
@@ -2189,8 +2190,8 @@ class APPageBuilder extends Module
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# WHENE INSTALL THEME, INSERT HOOK FROM DATASAMPLE IN THEME
|
||||
$hook_from_theme = false;
|
||||
if (file_exists(_PS_MODULE_DIR_.'appagebuilder/libs/LeoDataSample.php')) {
|
||||
@@ -2200,36 +2201,36 @@ class APPageBuilder extends Module
|
||||
$hook_from_theme = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
# INSERT HOOK FROM MODULE_DATASAMPLE
|
||||
if ($hook_from_theme == false) {
|
||||
$this->registerLeoHook();
|
||||
}
|
||||
|
||||
|
||||
# WHEN INSTALL MODULE, NOT NEED RESTORE DATABASE IN THEME
|
||||
$install_module = (int)Configuration::get('AP_INSTALLED_APPAGEBUILDER', 0);
|
||||
if ($install_module) {
|
||||
Configuration::updateValue('AP_INSTALLED_APPAGEBUILDER', '0'); // next : allow restore sample
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
# INSERT DATABASE FROM THEME_DATASAMPLE
|
||||
if (file_exists(_PS_MODULE_DIR_.'appagebuilder/libs/LeoDataSample.php')) {
|
||||
require_once(_PS_MODULE_DIR_.'appagebuilder/libs/LeoDataSample.php');
|
||||
$sample = new Datasample();
|
||||
$sample->processImport($this->name);
|
||||
}
|
||||
|
||||
|
||||
# REMOVE FILE INDEX.PHP FOR TRANSLATE
|
||||
if (file_exists(_PS_MODULE_DIR_.'appagebuilder/libs/setup.php')) {
|
||||
require_once(_PS_MODULE_DIR_.'appagebuilder/libs/setup.php');
|
||||
ApPageSetup::processTranslateTheme();
|
||||
}
|
||||
|
||||
|
||||
# REMOVE SUPPORT TEAM FIX LINK CSS, JS
|
||||
Configuration::updateValue('LEO_SUPPORT_TEAM', '0');
|
||||
}
|
||||
|
||||
|
||||
protected function getCacheId($hook_name = null, $shortcode_key = null)
|
||||
{
|
||||
$cache_array = array();
|
||||
@@ -2287,12 +2288,12 @@ class APPageBuilder extends Module
|
||||
if (Tools::getValue('footer') && Tools::getIsset('leopanelchange') && (in_array($hook_name, ApPageSetting::getHook('footer')) || $hook_name == 'pagebuilderConfig|footer')) {
|
||||
$cache_array[] = 'footer_'.Tools::getValue('footer');
|
||||
}
|
||||
|
||||
|
||||
//DONGND:: update cache for shortcode
|
||||
if ($shortcode_key) {
|
||||
$cache_array[] = 'shortcodekey_'.$shortcode_key;
|
||||
}
|
||||
|
||||
|
||||
return implode('|', $cache_array);
|
||||
}
|
||||
|
||||
@@ -2372,12 +2373,12 @@ class APPageBuilder extends Module
|
||||
// $this->_clearCache('appagebuilder.tpl', $this->name);
|
||||
$this->_clearCache($this->templateFile); # CLEAR CACHE ALL HOOKS
|
||||
}
|
||||
|
||||
|
||||
//DONGND:: add clear cache for shortcode
|
||||
public function clearShortCodeCache($shortcode_key)
|
||||
{
|
||||
$cache_id = $this->getCacheId('apshortcode', $shortcode_key);
|
||||
|
||||
|
||||
$this->_clearCache('appagebuilder.tpl', $cache_id);
|
||||
}
|
||||
|
||||
@@ -2457,19 +2458,19 @@ class APPageBuilder extends Module
|
||||
if ($list_positions) {
|
||||
foreach ($list_positions as $item) {
|
||||
$name = $item['position'].$item['position_key'];
|
||||
|
||||
|
||||
$uri = apPageHelper::getCssDir().'positions/'.$name.'.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'positions/'.$name.'.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$uri = apPageHelper::getCssDir().'profiles/'.$profile['profile_key'].'.css';
|
||||
$this->context->controller->registerStylesheet(sha1($uri), $uri, array('media' => 'all', 'priority' => 8000));
|
||||
|
||||
|
||||
$uri = apPageHelper::getJsDir().'profiles/'.$profile['profile_key'].'.js';
|
||||
$this->context->controller->registerJavascript(sha1($uri), $uri, array('position' => 'bottom', 'priority' => 8000));
|
||||
}
|
||||
@@ -2662,7 +2663,7 @@ class APPageBuilder extends Module
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
|
||||
|
||||
public function hookModuleRoutes($params)
|
||||
{
|
||||
$routes = array();
|
||||
@@ -2834,7 +2835,7 @@ class APPageBuilder extends Module
|
||||
$return .= '</div>';
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* alias from apPageHelper::getConfig()
|
||||
*/
|
||||
@@ -2842,7 +2843,7 @@ class APPageBuilder extends Module
|
||||
{
|
||||
return apPageHelper::getConfigName($name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* alias from apPageHelper::getConfig()
|
||||
*/
|
||||
@@ -2850,7 +2851,7 @@ class APPageBuilder extends Module
|
||||
{
|
||||
return apPageHelper::getConfig($name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get Value of configuration based on actived theme
|
||||
*/
|
||||
@@ -2862,7 +2863,7 @@ class APPageBuilder extends Module
|
||||
}
|
||||
|
||||
$cookie = LeoFrameworkHelper::getCookie();
|
||||
|
||||
|
||||
if (isset($cookie[$this->themeCookieName.'_'.$key])) {
|
||||
return $cookie[$this->themeCookieName.'_'.$key];
|
||||
}
|
||||
@@ -2904,16 +2905,16 @@ class APPageBuilder extends Module
|
||||
}
|
||||
# register hook to show when paging
|
||||
$this->registerHook('pagebuilderConfig');
|
||||
|
||||
|
||||
# register hook to show category and tags of product
|
||||
$this->registerHook('displayProductInformation');
|
||||
|
||||
|
||||
# register hook again to after install/change theme
|
||||
$this->registerHook('actionObjectShopUpdateAfter');
|
||||
|
||||
|
||||
# Multishop create new shop
|
||||
$this->registerHook('actionAdminShopControllerSaveAfter');
|
||||
|
||||
|
||||
$this->registerHook('displayProductButtons');
|
||||
$this->registerHook('displayReassurance');
|
||||
$this->registerHook('displayLeoProfileProduct');
|
||||
@@ -2931,7 +2932,7 @@ class APPageBuilder extends Module
|
||||
$this->registerHook('actionAdminControllerSetMedia');
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Action Create new shop, choose theme then auto restore datasample.
|
||||
*/
|
||||
@@ -2941,7 +2942,7 @@ class APPageBuilder extends Module
|
||||
&& Tools::getIsset('submitAddshop') !== false && Tools::getValue('submitAddshop')
|
||||
&& Tools::getIsset('theme_name') !== false && Tools::getValue('theme_name')) {
|
||||
$shop = $param['return'];
|
||||
|
||||
|
||||
if (file_exists(_PS_MODULE_DIR_.'appagebuilder/libs/LeoDataSample.php')) {
|
||||
require_once(_PS_MODULE_DIR_.'appagebuilder/libs/LeoDataSample.php');
|
||||
$sample = new Datasample();
|
||||
@@ -2954,16 +2955,16 @@ class APPageBuilder extends Module
|
||||
|
||||
public function hookDisplayBackOfficeCategory($params)
|
||||
{
|
||||
|
||||
|
||||
if (Validate::isLoadedObject($category = new Category((int)Tools::getValue('id_category')))) {
|
||||
// validate module
|
||||
unset($category);
|
||||
|
||||
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
|
||||
|
||||
$category_layouts = array();
|
||||
$id_category = Tools::getValue('id_category');
|
||||
|
||||
|
||||
if (is_dir(apPageHelper::getConfigDir('theme_profiles'))) {
|
||||
//DONGND:: fix get list product list via database
|
||||
$sql = 'SELECT * FROM '._DB_PREFIX_.'appagebuilder_products p
|
||||
@@ -3012,7 +3013,7 @@ class APPageBuilder extends Module
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
$sql = 'SELECT page from `'._DB_PREFIX_.'appagebuilder_page` where id_category = \''.(int)$id_category.'\' AND id_shop = \''.(int)$id_shop.'\'';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
|
||||
|
||||
if ($result) {
|
||||
if ($aplayout == 'default') {
|
||||
Db::getInstance()->execute('DELETE from `'._DB_PREFIX_.'appagebuilder_page` where id_category = \''.(int)$id_category.'\' and id_shop=\''.(int)$id_shop.'\'');
|
||||
@@ -3095,7 +3096,7 @@ class APPageBuilder extends Module
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
$sql = 'SELECT * from `'._DB_PREFIX_.'appagebuilder_page` WHERE id_product = '.(int)$id_product.' AND id_shop = '.(int)$id_shop;
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
|
||||
|
||||
if ($result) {
|
||||
if ($aplayout == 'default') {
|
||||
Db::getInstance()->execute('DELETE from `'._DB_PREFIX_.'appagebuilder_page` WHERE id_product = '.(int)$id_product.' and id_shop='.(int)$id_shop);
|
||||
@@ -3107,7 +3108,7 @@ class APPageBuilder extends Module
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'appagebuilder_page` (`id_product`,`id_category`,`page`,`id_shop`) VALUES ('.(int)$id_product.',0,\''.pSQL($aplayout).'\','.(int)$id_shop.')');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Configuration::get('APPAGEBUILDER_PRODUCT_TEXTEXTRA') || Configuration::get('APPAGEBUILDER_PRODUCT_EDITOREXTRA')) {
|
||||
//save for extrafield
|
||||
$sql = 'SHOW FIELDS FROM `'._DB_PREFIX_.'appagebuilder_extrapro' .'`';
|
||||
@@ -3151,7 +3152,7 @@ class APPageBuilder extends Module
|
||||
if (Validate::isLoadedObject($product = new Product((int)$params['id_product']))) {
|
||||
// validate module
|
||||
unset($product);
|
||||
|
||||
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
$extrafied = array();
|
||||
$data_fields = array();
|
||||
@@ -3159,7 +3160,7 @@ class APPageBuilder extends Module
|
||||
if (Configuration::get('APPAGEBUILDER_PRODUCT_TEXTEXTRA') || Configuration::get('APPAGEBUILDER_PRODUCT_EDITOREXTRA')) {
|
||||
$sql = 'SHOW FIELDS FROM `'._DB_PREFIX_.'appagebuilder_extrapro' .'`';
|
||||
$result = Db::getInstance()->executeS($sql);
|
||||
|
||||
|
||||
$rows = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'appagebuilder_extrapro' .'` WHERE id_product="'.(int)$params['id_product'].'" AND id_shop="'.(int)$id_shop.'"');
|
||||
|
||||
foreach ($result as $value) {
|
||||
@@ -3185,7 +3186,7 @@ class APPageBuilder extends Module
|
||||
'default_language' => $this->default_language,
|
||||
'current_layout' => Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT page from `'._DB_PREFIX_.'appagebuilder_page` where id_product = \''.(int)$params['id_product'].'\' AND id_shop = \''.(int)$id_shop.'\'')
|
||||
));
|
||||
|
||||
|
||||
return $this->display(__FILE__, 'productExtra.tpl');
|
||||
}
|
||||
}
|
||||
@@ -3227,7 +3228,7 @@ class APPageBuilder extends Module
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PERMISSION ACCOUNT demo@demo.com
|
||||
*/
|
||||
@@ -3240,10 +3241,10 @@ class APPageBuilder extends Module
|
||||
$view = Module::getPermissionStatic($this->id, 'view', $employee);
|
||||
return ($configure || $view);
|
||||
}
|
||||
|
||||
|
||||
return Module::getPermissionStatic($this->id, $variable, $employee);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PERMISSION ACCOUNT demo@demo.com
|
||||
*/
|
||||
|
||||
@@ -37,46 +37,46 @@ class ApPageBuilderShortcodeModel extends ObjectModel
|
||||
'fields' => array(
|
||||
'shortcode_key' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'size' => 255),
|
||||
// 'id_appagebuilder' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
|
||||
|
||||
'shortcode_name' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'size' => 255, 'lang' => true, 'required' => true),
|
||||
|
||||
|
||||
'active' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
public function __construct($id = null, $id_lang = null, $id_shop = null, Context $context = null)
|
||||
{
|
||||
// validate module
|
||||
unset($context);
|
||||
parent::__construct($id, $id_lang, $id_shop);
|
||||
}
|
||||
|
||||
|
||||
public function add($autodate = true, $null_values = false)
|
||||
{
|
||||
$id_shop = apPageHelper::getIDShop();
|
||||
$res = parent::add($autodate, $null_values);
|
||||
|
||||
|
||||
$res &= Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'appagebuilder_shortcode_shop` (`id_shop`, `id_appagebuilder_shortcode`, `active`)
|
||||
VALUES('.(int)$id_shop.', '.(int)$this->id.', '.(int)$this->active.')');
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
public function update($nullValues = false)
|
||||
{
|
||||
$id_shop = apPageHelper::getIDShop();
|
||||
$res = parent::update($nullValues);
|
||||
|
||||
|
||||
$res &= Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'appagebuilder_shortcode_shop` ps set ps.active = '.(int)$this->active.' WHERE ps.id_shop='.(int)$id_shop.' AND ps.id_appagebuilder_shortcode = '.(int)$this->id);
|
||||
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$result = parent::delete();
|
||||
|
||||
|
||||
if ($result) {
|
||||
if (isset($this->def['multishop']) && $this->def['multishop'] == true) {
|
||||
# DELETE RECORD FORM TABLE _SHOP
|
||||
@@ -90,25 +90,25 @@ class ApPageBuilderShortcodeModel extends ObjectModel
|
||||
Db::getInstance()->delete($this->def['table'].'_shop', '`'.$this->def['primary'].'`='.
|
||||
(int)$this->id.' AND id_shop IN ('.pSQL(implode(', ', $id_shop_list)).')');
|
||||
}
|
||||
|
||||
|
||||
//DONGND:: delete appagebuilder related shortcode
|
||||
$id_appagebuilder = ApPageBuilderModel::getIdByIdShortCode((int)$this->id);
|
||||
|
||||
|
||||
if ($id_appagebuilder) {
|
||||
$obj = new ApPageBuilderModel($id_appagebuilder);
|
||||
$obj->delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function getShortCodeContent($id_appagebuilder = 0, $is_font = 0, $id_lang = 0)
|
||||
{
|
||||
$context = Context::getContext();
|
||||
$id_shop = (int)$context->shop->id;
|
||||
$where = ' WHERE ps.id_shop='.(int)$id_shop.' AND p.id_appagebuilder='.(int)$id_appagebuilder;
|
||||
|
||||
|
||||
if ($id_lang) {
|
||||
$where .= ' AND pl.id_lang = '.(int)$id_lang;
|
||||
} else {
|
||||
@@ -119,10 +119,10 @@ class ApPageBuilderShortcodeModel extends ObjectModel
|
||||
LEFT JOIN `'._DB_PREFIX_.'appagebuilder_shop` ps ON (ps.id_appagebuilder = p.id_appagebuilder)
|
||||
LEFT JOIN `'._DB_PREFIX_.'appagebuilder_lang` pl ON (pl.id_appagebuilder = p.id_appagebuilder)
|
||||
LEFT JOIN `'._DB_PREFIX_.'appagebuilder_shortcode` pp ON (p.id_appagebuilder_shortcode = pp.id_appagebuilder_shortcode)
|
||||
|
||||
|
||||
'.pSql($where).' ORDER BY p.id_appagebuilder';
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($result);die();
|
||||
$id_langs = Language::getLanguages(true, false, true);
|
||||
@@ -132,7 +132,7 @@ class ApPageBuilderShortcodeModel extends ObjectModel
|
||||
unset($result[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$data_lang = array();
|
||||
if ($is_font) {
|
||||
foreach ($result as $row) {
|
||||
@@ -177,10 +177,10 @@ class ApPageBuilderShortcodeModel extends ObjectModel
|
||||
}
|
||||
$data_hook[$row['hook_name']] = $row;
|
||||
}
|
||||
|
||||
|
||||
return array('content' => $data_hook, 'dataForm' => ApShortCodesBuilder::$data_form);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all items - datas of all hooks by shop Id, lang Id for front-end or back-end
|
||||
* @param type $id_profiles
|
||||
@@ -248,24 +248,24 @@ class ApPageBuilderShortcodeModel extends ObjectModel
|
||||
|
||||
return array('content' => $data_hook, 'dataForm' => ApShortCodesBuilder::$data_form);
|
||||
}
|
||||
|
||||
|
||||
public static function getShortCode($shortcode_key)
|
||||
{
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
|
||||
|
||||
$sql = 'SELECT p.*, pp.`id_appagebuilder` FROM `'._DB_PREFIX_.'appagebuilder_shortcode` p
|
||||
INNER JOIN `'._DB_PREFIX_.'appagebuilder_shortcode_shop` ps on(p.`id_appagebuilder_shortcode` = ps.`id_appagebuilder_shortcode`)
|
||||
INNER JOIN `'._DB_PREFIX_.'appagebuilder` pp on(p.`id_appagebuilder_shortcode` = pp.`id_appagebuilder_shortcode`) WHERE
|
||||
p.`shortcode_key` = "'.pSQL($shortcode_key).'" AND ps.`active`= 1 AND ps.`id_shop` = '.(int)$id_shop;
|
||||
|
||||
|
||||
return Db::getInstance()->getRow($sql);
|
||||
}
|
||||
|
||||
|
||||
public static function getListShortCode()
|
||||
{
|
||||
$id_shop = Context::getContext()->shop->id;
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
|
||||
|
||||
$sql = 'SELECT p.*, ps.*, pl.* FROM `'._DB_PREFIX_.'appagebuilder_shortcode` p
|
||||
INNER JOIN `'._DB_PREFIX_.'appagebuilder_shortcode_shop` ps on(p.`id_appagebuilder_shortcode` = ps.`id_appagebuilder_shortcode`)
|
||||
INNER JOIN `'._DB_PREFIX_.'appagebuilder_shortcode_lang` pl on(p.`id_appagebuilder_shortcode` = pl.`id_appagebuilder_shortcode`) WHERE
|
||||
|
||||
@@ -121,11 +121,11 @@ class AdminApPageBuilderProductsController extends ModuleAdminControllerCore
|
||||
public function postProcess()
|
||||
{
|
||||
parent::postProcess();
|
||||
|
||||
|
||||
if (count($this->errors) > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (Tools::getIsset('duplicateappagebuilder_products')) {
|
||||
$id = Tools::getValue('id_appagebuilder_products');
|
||||
$model = new ApPageBuilderProductsModel($id);
|
||||
@@ -147,8 +147,8 @@ class AdminApPageBuilderProductsController extends ModuleAdminControllerCore
|
||||
Tools::displayError('Can not duplicate Profiles');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (Tools::isSubmit('saveELement')) {
|
||||
$filecontent = Tools::getValue('filecontent');
|
||||
$fileName = Tools::getValue('fileName');
|
||||
@@ -442,7 +442,7 @@ class AdminApPageBuilderProductsController extends ModuleAdminControllerCore
|
||||
}
|
||||
return $object;
|
||||
}
|
||||
|
||||
|
||||
public function displayDuplicateLink($token = null, $id = null, $name = null)
|
||||
{
|
||||
$controller = 'AdminApPageBuilderProducts';
|
||||
@@ -450,13 +450,13 @@ class AdminApPageBuilderProductsController extends ModuleAdminControllerCore
|
||||
$html = '<a href="#" title="Duplicate" onclick="confirm_link(\'\', \'Duplicate Product List ID '.$id.'. If you wish to proceed, click "Yes". If not, click "No".\', \'Yes\', \'No\', \'index.php?controller='.$controller.'&id_appagebuilder_products='.$id.'&duplicateappagebuilder_products&token='.$token.'\', \'#\')">
|
||||
<i class="icon-copy"></i> Duplicate
|
||||
</a>';
|
||||
|
||||
|
||||
// validate module
|
||||
unset($name);
|
||||
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PERMISSION ACCOUNT demo@demo.com
|
||||
* OVERRIDE CORE
|
||||
@@ -469,7 +469,7 @@ class AdminApPageBuilderProductsController extends ModuleAdminControllerCore
|
||||
}
|
||||
return parent::access($action, $disable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PERMISSION ACCOUNT demo@demo.com
|
||||
* OVERRIDE CORE
|
||||
@@ -477,7 +477,7 @@ class AdminApPageBuilderProductsController extends ModuleAdminControllerCore
|
||||
public function initProcess()
|
||||
{
|
||||
parent::initProcess();
|
||||
|
||||
|
||||
if (count($this->errors) <= 0) {
|
||||
if( Tools::isSubmit('duplicate'.$this->table) ) {
|
||||
if ($this->id_object) {
|
||||
|
||||
@@ -112,6 +112,11 @@ class AdminApPageBuilderProfilesController extends ModuleAdminControllerCore
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
$this->context->controller->addJs(__PS_BASE_URI__.'js/jquery/jquery-3.5.1.min.js');
|
||||
// $this->context->controller->addJquery();
|
||||
$this->context->controller->addJqueryUI('ui.sortable'); // FILE FORM.js required this
|
||||
$this->context->controller->addJqueryUI('ui.draggable'); // FILE FORM.js required this
|
||||
|
||||
$this->context->controller->addJs(apPageHelper::getJsAdminDir().'admin/form.js');
|
||||
|
||||
$this->page_header_toolbar_btn['SaveAndStay'] = array(
|
||||
|
||||
@@ -35,17 +35,17 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
public $module_path;
|
||||
public $tpl_path;
|
||||
public $theme_dir;
|
||||
|
||||
|
||||
/**
|
||||
* @var Array $overrideHooks
|
||||
*/
|
||||
protected $themeName;
|
||||
|
||||
|
||||
/**
|
||||
* @var Array $overrideHooks
|
||||
*/
|
||||
protected $themePath = '';
|
||||
|
||||
|
||||
/**
|
||||
* save config
|
||||
*/
|
||||
@@ -70,7 +70,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
// $this->module_path_resource = $this->module_path.'views/';
|
||||
$this->themePath = _PS_ALL_THEMES_DIR_.$this->themeName.'/';
|
||||
}
|
||||
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
$this->context->controller->addJquery();
|
||||
@@ -78,17 +78,17 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$this->context->controller->addJqueryUI('ui.draggable'); // FILE FORM.js required this
|
||||
$this->context->controller->addJs(apPageHelper::getJsAdminDir().'admin/form.js');
|
||||
$this->context->controller->addJs(apPageHelper::getJsAdminDir().'admin/home.js');
|
||||
|
||||
|
||||
Context::getContext()->controller->addJqueryPlugin('colorpicker');
|
||||
|
||||
|
||||
Media::addJsDef(array(
|
||||
'ap_controller' => 'AdminApPageBuilderThemeConfigurationController',
|
||||
));
|
||||
|
||||
|
||||
$this->context->controller->addCss(__PS_BASE_URI__.str_replace('//', '/', 'modules/appagebuilder').'/css/admin/style_AdminApPageBuilderThemeConfiguration.css', 'all');
|
||||
parent::initPageHeaderToolbar();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* OVERRIDE ROOT\classes\controller\AdminController.php
|
||||
* Assign smarty variables for all default views, list and form, then call other init functions
|
||||
@@ -104,7 +104,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$this->initToolbar();
|
||||
$this->initTabModuleList();
|
||||
$this->initPageHeaderToolbar();
|
||||
|
||||
|
||||
$this->content .= $this->renderForm();
|
||||
// FIXME: Sorry. I'm not very proud of this, but no choice... Please wait sf refactoring to solve this.
|
||||
if (get_class($this) != 'AdminCarriersController') {
|
||||
@@ -147,10 +147,10 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
'label' => $this->l('Disabled'),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$tskins = LeoFrameworkHelper::getSkins($this->themeName);
|
||||
// $directions = LeoFrameworkHelper::getLayoutDirections($this->themeName);
|
||||
|
||||
|
||||
$this->lang = true;
|
||||
$skins = array();
|
||||
$skins[] = array('name' => $this->l('Default'), 'id' => 'default');
|
||||
@@ -158,10 +158,10 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
|
||||
$this->initToolbar();
|
||||
$this->context->controller->addJqueryUI('ui.sortable');
|
||||
|
||||
|
||||
$sample = new Datasample();
|
||||
$moduleList = $sample->getModuleList();
|
||||
|
||||
|
||||
$fields_form = array(
|
||||
// 'legend' => array(
|
||||
// 'title' => $this->l('Ap Theme Configuration'),
|
||||
@@ -398,7 +398,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
'desc' => $this->l('How many column display in grid mode of product list.'),
|
||||
'form_group_class' => 'aprow_pages',
|
||||
),
|
||||
|
||||
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Product Detail Tab Type'),
|
||||
@@ -1133,10 +1133,10 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
'title' => $this->l('Save'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
if (version_compare(Configuration::get('PS_VERSION_DB'), '1.7.3.0', '>=')) {
|
||||
$fields_form['input']['config']['values']['aprow_rtl'] = $this->l('Righ to Left');
|
||||
|
||||
|
||||
$fields_form['input'][] =
|
||||
array(
|
||||
'type' => 'html',
|
||||
@@ -1144,7 +1144,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
'html_content' => '<button class="button btn btn-danger" name="submit_rtl_prestashop" id="submit_rtl_prestashop" type="submit">1. Generate RTL stylesheet</button>',
|
||||
'form_group_class' => 'aprow_rtl',
|
||||
);
|
||||
|
||||
|
||||
$fields_form['input'][] =
|
||||
array(
|
||||
'type' => 'html',
|
||||
@@ -1152,7 +1152,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
'html_content' => '<button class="button btn btn-success" name="submit_rtl_leo" id="submit_rtl_leo" type="submit">2. Use class RTL of theme</button>',
|
||||
'form_group_class' => 'aprow_rtl',
|
||||
);
|
||||
|
||||
|
||||
$fields_form['input'][] =
|
||||
array(
|
||||
'type' => 'html',
|
||||
@@ -1162,7 +1162,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
'form_group_class' => 'aprow_rtl',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$theme_customizations = LeoFrameworkHelper::getLayoutSettingByTheme($this->themeName);
|
||||
if (isset($theme_customizations['layout'])) {
|
||||
foreach ($theme_customizations['layout'] as $key => $value) {
|
||||
@@ -1182,10 +1182,10 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
array_push($fields_form['input'], $o);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->fields_form = $fields_form;
|
||||
$this->tpl_form_vars['backup_dir'] = $sample->backup_dir;
|
||||
|
||||
|
||||
if ($this->submitSaveSetting && Tools::isSubmit('submitAddconfiguration')) {
|
||||
# SAVING CONFIGURATION
|
||||
$this->saveThemeConfigs();
|
||||
@@ -1193,7 +1193,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
}
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (count($this->errors) > 0) {
|
||||
@@ -1233,7 +1233,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$this->submitSaveSetting = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function generateRTL()
|
||||
{
|
||||
$theme_name = apPageHelper::getThemeName();
|
||||
@@ -1242,7 +1242,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
->setRegenerate(true)
|
||||
->process();
|
||||
}
|
||||
|
||||
|
||||
public function removeRTL()
|
||||
{
|
||||
$directory = _PS_ALL_THEMES_DIR_._THEME_NAME_;
|
||||
@@ -1258,11 +1258,11 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
unlink($directory . DIRECTORY_SEPARATOR . $file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function saveThemeConfigsBefore()
|
||||
{
|
||||
//$helper = LeoFrameworkHelper::getInstance();
|
||||
|
||||
|
||||
// SET COOKIE AGAIN
|
||||
$theme_cookie_name = $this->getConfigName('PANEL_CONFIG');
|
||||
$arrayConfig = array('default_skin', 'layout_mode', 'header_style', 'enable_fheader', 'sidebarmenu');
|
||||
@@ -1271,7 +1271,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
unset($_COOKIE[$theme_cookie_name.'_'.$value]);
|
||||
setcookie($theme_cookie_name.'_'.$value, '', 0, '/');
|
||||
}
|
||||
|
||||
|
||||
# WRITE LOAD GOOGLE FONT
|
||||
if (apPageHelper::getPostConfig('enable_loadfont') == 1) {
|
||||
$content_font = '';
|
||||
@@ -1315,7 +1315,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$content_font .= $this->renderCSSFont('span');
|
||||
LeoFrameworkHelper::writeToCache($this->themePath.apPageHelper::getCssDir(), 'fonts-cuttom2', $content_font, 'css');
|
||||
}
|
||||
|
||||
|
||||
# SAVING GOOGLE FONT
|
||||
$gfont_items = Tools::getValue('gfont_items');
|
||||
if ($gfont_items) {
|
||||
@@ -1324,7 +1324,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
} else {
|
||||
Configuration::updateValue($this->getConfigName('google_font'), '');
|
||||
}
|
||||
|
||||
|
||||
# SAVING SUBSET
|
||||
$gfonts_subsets = Tools::getValue('gfonts_subsets');
|
||||
if ($gfonts_subsets) {
|
||||
@@ -1334,7 +1334,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
Configuration::updateValue($this->getConfigName('google_subset'), '');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* alias from apPageHelper::getConfigName()
|
||||
*/
|
||||
@@ -1342,7 +1342,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
{
|
||||
return apPageHelper::getConfigName($name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update Theme Configurations
|
||||
*/
|
||||
@@ -1352,7 +1352,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$content_setting = '';
|
||||
//$content_font = '';
|
||||
//$helper = LeoFrameworkHelper::getInstance();
|
||||
|
||||
|
||||
foreach ($this->fields_form['input'] as $input) {
|
||||
if (isset($input['lang'])) {
|
||||
$data = array();
|
||||
@@ -1381,7 +1381,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$value = Tools::getValue($input['name'], Configuration::get($input['name']));
|
||||
$input['default'] = isset($input['default']) ? $input['default'] : '';
|
||||
$dataSave = $value ? $value : $input['default'];
|
||||
|
||||
|
||||
if (isset($input['save']) && $input['save']== false) {
|
||||
// NOT SAVE
|
||||
} else if ($input['type'] == 'font_h') {
|
||||
@@ -1438,14 +1438,14 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$folder = $this->themePath.'templates/layouts/';
|
||||
if (!is_dir($folder)) {
|
||||
mkdir($folder, 0755, true);
|
||||
}
|
||||
LeoFrameworkHelper::writeToCache($this->themePath.'templates/layouts/', 'setting', $content_setting, 'tpl');
|
||||
}
|
||||
|
||||
|
||||
public function renderGoogleLinkFont($gfont_name, $attribute)
|
||||
{
|
||||
$output = '';
|
||||
@@ -1455,15 +1455,15 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$str_att .= ','.$value;
|
||||
}
|
||||
$str_att = trim($str_att, ',');
|
||||
|
||||
|
||||
$output = $gfont_name . ':' . $str_att;
|
||||
} else {
|
||||
$output = $gfont_name;
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
public function renderCSSFont($tag)
|
||||
{
|
||||
$html = '';
|
||||
@@ -1482,21 +1482,21 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
if (apPageHelper::getPostConfig($tag . '_font_style')) {
|
||||
$html .= ' font-style:' . apPageHelper::getPostConfig($tag . '_font_style') . ';';
|
||||
}
|
||||
|
||||
|
||||
$output = '';
|
||||
if (!empty($html)) {
|
||||
$output = $tag . ' {'.$html.' }'."\n";
|
||||
}
|
||||
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
public function getFieldsValue($obj)
|
||||
{
|
||||
unset($obj);
|
||||
$languages = Language::getLanguages(false);
|
||||
$fields_values = array();
|
||||
|
||||
|
||||
foreach ($this->fields_form as $f) {
|
||||
foreach ($f['form']['input'] as $input) {
|
||||
if (isset($input['lang'])) {
|
||||
@@ -1525,7 +1525,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
}
|
||||
// Font setup : list fonts in google
|
||||
$fields_values['gfont_api'] = Tools::jsonEncode(GoogleFont::getAllGoogleFonts());
|
||||
|
||||
|
||||
// Font setup : list fonts in database
|
||||
$google_font_cfg = Configuration::get($this->getConfigName('google_font'));
|
||||
$fields_values['gfont_list_ori'] = '[]';
|
||||
@@ -1537,7 +1537,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$fields_values['gfont_list'] = $google_fonts;
|
||||
$fields_values['gfont_list_ori'] = Tools::jsonEncode($google_fonts);
|
||||
}
|
||||
|
||||
|
||||
// Font setup : list subset in database
|
||||
$google_subset_cfg = Configuration::get($this->getConfigName('google_subset'));
|
||||
$fields_values['gfont_subset'] = '[]';
|
||||
@@ -1545,15 +1545,15 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
$google_subset = explode(',', $google_subset_cfg);
|
||||
$fields_values['gfont_subset'] = Tools::jsonEncode($google_subset);
|
||||
}
|
||||
|
||||
|
||||
return $fields_values;
|
||||
}
|
||||
|
||||
|
||||
public function getGoogleFont()
|
||||
{
|
||||
return array_keys(GoogleFont::getAllGoogleFonts());
|
||||
}
|
||||
|
||||
|
||||
public function getFontWeight($default = false)
|
||||
{
|
||||
if ($default == 'default') {
|
||||
@@ -1573,7 +1573,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function getFontStyle($default = false)
|
||||
{
|
||||
if ($default == 'default') {
|
||||
|
||||
@@ -19,6 +19,8 @@ function updateListIdFullSlider() {
|
||||
$("#total_slider").val(listId);
|
||||
}
|
||||
$(document).ready(function() {
|
||||
console.log("ready!");
|
||||
|
||||
$("#modal_form").draggable({
|
||||
handle: ".modal-header"
|
||||
});
|
||||
|
||||
@@ -72,7 +72,7 @@ class CmsController extends CmsControllerCore
|
||||
$this->setTemplate('cms/category');
|
||||
}
|
||||
FrontController::initContent();
|
||||
|
||||
|
||||
// validate module
|
||||
unset($id_module);
|
||||
unset($array_return);
|
||||
|
||||
@@ -19,6 +19,8 @@ function updateListIdFullSlider() {
|
||||
$("#total_slider").val(listId);
|
||||
}
|
||||
$(document).ready(function() {
|
||||
console.log("ready");
|
||||
|
||||
$("#modal_form").draggable({
|
||||
handle: ".modal-header"
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
* @copyright 2007-2018 Apollotheme
|
||||
* @description:
|
||||
* @description:
|
||||
*/
|
||||
imgId = null; // using for store object image select a source in function select image
|
||||
function log(message) {
|
||||
@@ -70,25 +70,25 @@ function htmlentitiesDecode(str) {
|
||||
$('.' + key).data('form', dataObj[key]);
|
||||
//DONGND:: install data animation for column and group
|
||||
if (typeof dataObj[key].animation != 'undefined')
|
||||
{
|
||||
{
|
||||
if ($('.' + key).find('.animation-button').first().length)
|
||||
{
|
||||
{
|
||||
var animation_bt = $('.' + key).find('.animation-button').first();
|
||||
var animation_type = dataObj[key].animation ? dataObj[key].animation : 'none';
|
||||
var animation_delay = dataObj[key].animation_delay ? dataObj[key].animation_delay : 1;
|
||||
var animation_duration = dataObj[key].animation_duration ? dataObj[key].animation_duration : 1;
|
||||
var animation_iteration_count = dataObj[key].animation_iteration_count ? dataObj[key].animation_iteration_count : 1;
|
||||
var animation_infinite = dataObj[key].animation_infinite ? dataObj[key].animation_infinite : 0;
|
||||
|
||||
var animation_infinite = dataObj[key].animation_infinite ? dataObj[key].animation_infinite : 0;
|
||||
|
||||
$globalthis.assignConfigAnimation(animation_bt, animation_type, animation_delay, animation_duration, animation_iteration_count, animation_infinite);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
//DONGND:: fix can't click tab 1 when create new widget tab
|
||||
$('.ApTabs:not(#default_ApTabs)').each(function(){
|
||||
var activeTabId = $(this).data('form').active_tab;
|
||||
|
||||
//DONGND:: fix can't click tab 1 when create new widget tab
|
||||
$('.ApTabs:not(#default_ApTabs)').each(function(){
|
||||
var activeTabId = $(this).data('form').active_tab;
|
||||
if (activeTabId != '' && parseInt(activeTabId))
|
||||
{
|
||||
$(this).find('.nav-tabs a').eq(parseInt(activeTabId)-1).tab('show');
|
||||
@@ -149,7 +149,7 @@ function htmlentitiesDecode(str) {
|
||||
handle: ".waction-drag"
|
||||
});
|
||||
// $( ".widget-row" ).addClass( $globalthis.classWidget )
|
||||
// .find( ".waction-drag" ).addClass( $globalthis.classWidgetHeader );
|
||||
// .find( ".waction-drag" ).addClass( $globalthis.classWidgetHeader );
|
||||
|
||||
};
|
||||
this.downloadFile = function (filename, result) {
|
||||
@@ -185,7 +185,7 @@ function htmlentitiesDecode(str) {
|
||||
cls = cls.replace("col-sp-12", "col-sp-" + realValue);
|
||||
$(column).attr("class", cls);
|
||||
objColumn = {form_id: "form_" + $globalthis.getRandomNumber()};
|
||||
|
||||
|
||||
objColumn.sm = widthCol;
|
||||
objColumn.xs = widthCol;
|
||||
objColumn.sp = widthCol;
|
||||
@@ -317,7 +317,7 @@ function htmlentitiesDecode(str) {
|
||||
btnElement = $(this);
|
||||
$('.btn-fwidth').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
//reset
|
||||
//reset
|
||||
if ($(this).hasClass('width-default')) {
|
||||
$globalthis.windowWidth = $(window).width();
|
||||
$('#home_wrapper').attr('class', 'default');
|
||||
@@ -506,10 +506,9 @@ function htmlentitiesDecode(str) {
|
||||
|
||||
//edit group
|
||||
$(document).on("click", ".btn-edit", function () {
|
||||
if ($(this).data('type' == undefined) && $(this).data('type') == undefined) {
|
||||
var type = $(this).closest('.widget-row').data("type");
|
||||
} else
|
||||
var type = $(this).data("type");
|
||||
var type = $(this).data('type') !== undefined
|
||||
? $(this).data('type')
|
||||
: $(this).closest('.widget-row').data('type');
|
||||
|
||||
if (type.indexOf("apSub") == 0) {
|
||||
if (type == "apSubAccordions") {
|
||||
@@ -569,7 +568,7 @@ function htmlentitiesDecode(str) {
|
||||
$('#modal_form .modal-footer').show();
|
||||
$('#modal_form .modal-body').html(data);
|
||||
$('#modal_form').removeClass('modal-new').addClass('modal-edit');
|
||||
|
||||
|
||||
// FIX BUG : ApCategory khong save duoc icon cu, khi thay icon cho 1 category khac
|
||||
// resetSelectedImage();
|
||||
|
||||
@@ -582,7 +581,7 @@ function htmlentitiesDecode(str) {
|
||||
initFullSlider("edit");
|
||||
}
|
||||
hideFormLevel2();
|
||||
|
||||
|
||||
$globalthis.setFormAction();
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||
@@ -591,7 +590,7 @@ function htmlentitiesDecode(str) {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click", ".btn-new-widget", function () {
|
||||
var url = $globalthis.ajaxHomeUrl + '&ajax=1&action=renderList';
|
||||
if ($(this).hasClass('tabcontent-action'))
|
||||
@@ -917,7 +916,7 @@ function htmlentitiesDecode(str) {
|
||||
$(this).closest('.translatable-field').find('.img-thumbnail').hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click", ".image-manager .img-link", function (e) {
|
||||
e.stopPropagation();
|
||||
var img = $(this).find("img");
|
||||
@@ -927,7 +926,7 @@ function htmlentitiesDecode(str) {
|
||||
|
||||
var div = $(imgId).closest("div");
|
||||
imgDest = $(div).find("img");
|
||||
|
||||
|
||||
var widget = $(img).attr("data-widget");
|
||||
if(widget == "ApImage360")
|
||||
{
|
||||
@@ -990,17 +989,17 @@ function htmlentitiesDecode(str) {
|
||||
$(document).on("click", ".animation-button", function (e) {
|
||||
var animation_wrapper = $(this).siblings('.animation-wrapper');
|
||||
if (!$(this).hasClass('active'))
|
||||
{
|
||||
{
|
||||
$(".animation-button.active").siblings('.animation-wrapper').hide();
|
||||
$(".animation-button.active").removeClass('active');
|
||||
//DONGND:: load config by data
|
||||
//DONGND:: load config by data
|
||||
$(this).addClass('active');
|
||||
var animation_type = $(this).data('animation-type');
|
||||
var animation_delay = $(this).data('animation-delay');
|
||||
var animation_delay = $(this).data('animation-delay');
|
||||
var animation_duration = $(this).data('animation-duration');
|
||||
var animation_iteration_count = $(this).data('animation-iteration-count');
|
||||
var animation_infinite = $(this).data('animation-infinite');
|
||||
|
||||
|
||||
if (typeof animation_delay != 'undefined')
|
||||
{
|
||||
animation_wrapper.find('.animation_delay').val(animation_delay);
|
||||
@@ -1009,7 +1008,7 @@ function htmlentitiesDecode(str) {
|
||||
{
|
||||
animation_wrapper.find('.animation_delay').val(1);
|
||||
}
|
||||
|
||||
|
||||
if (typeof animation_duration != 'undefined')
|
||||
{
|
||||
animation_wrapper.find('.animation_duration').val(animation_duration);
|
||||
@@ -1018,7 +1017,7 @@ function htmlentitiesDecode(str) {
|
||||
{
|
||||
animation_wrapper.find('.animation_duration').val(1);
|
||||
}
|
||||
|
||||
|
||||
if (typeof animation_iteration_count != 'undefined')
|
||||
{
|
||||
animation_wrapper.find('.animation_iteration_count').val(animation_iteration_count);
|
||||
@@ -1027,7 +1026,7 @@ function htmlentitiesDecode(str) {
|
||||
{
|
||||
animation_wrapper.find('.animation_iteration_count').val(1);
|
||||
}
|
||||
|
||||
|
||||
if (animation_infinite == 1)
|
||||
{
|
||||
animation_wrapper.find('.animation_infinite').attr( 'checked', 'checked' );
|
||||
@@ -1036,24 +1035,24 @@ function htmlentitiesDecode(str) {
|
||||
{
|
||||
animation_wrapper.removeAttr('checked');
|
||||
}
|
||||
//DONGND:: change offset to right with column small
|
||||
//DONGND:: change offset to right with column small
|
||||
if ($(window).width()-$(this).offset().left < animation_wrapper.width())
|
||||
{
|
||||
animation_wrapper.addClass('offset-right');
|
||||
}
|
||||
animation_wrapper.show();
|
||||
|
||||
|
||||
if (typeof animation_type != 'undefined')
|
||||
{
|
||||
animation_wrapper.find('.animation_select').val(animation_type).trigger('change');
|
||||
animation_wrapper.find('.animation_select').val(animation_type).trigger('change');
|
||||
}
|
||||
else
|
||||
{
|
||||
animation_wrapper.find('.animation_select').val('none').trigger('change');
|
||||
animation_wrapper.find('.animation_select').val('none').trigger('change');
|
||||
}
|
||||
|
||||
|
||||
// animation_wrapper.find('.animate-it').trigger('click');
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1062,9 +1061,9 @@ function htmlentitiesDecode(str) {
|
||||
animation_wrapper.removeClass('offset-right');
|
||||
animation_wrapper.find('.animationSandbox').removeClass().removeAttr('style').addClass('animationSandbox');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
//DONGND:: save config of animation to data form of column/group
|
||||
$(document).on("click", ".btn-save-animation", function (e) {
|
||||
var obj_parent = $(this).parents('.animation-wrapper');
|
||||
@@ -1074,17 +1073,17 @@ function htmlentitiesDecode(str) {
|
||||
var animation_duration = obj_parent.find('.animation_duration').val();
|
||||
var animation_iteration_count = obj_parent.find('.animation_iteration_count').val();
|
||||
var animation_infinite = obj_parent.find('.animation_infinite').is(':checked')? 1 : 0;
|
||||
|
||||
|
||||
$globalthis.assignConfigAnimation(animation_bt, animation_type, animation_delay, animation_duration, animation_iteration_count, animation_infinite);
|
||||
|
||||
|
||||
//DONGND:: update data form for group/column
|
||||
if (obj_parent.hasClass('column-animation-wrapper'))
|
||||
{
|
||||
{
|
||||
var main_obj = obj_parent.parents('.column-row');
|
||||
|
||||
|
||||
}
|
||||
if (obj_parent.hasClass('group-animation-wrapper'))
|
||||
{
|
||||
{
|
||||
var main_obj = obj_parent.parents('.group-row');
|
||||
}
|
||||
if (typeof main_obj != 'undefined')
|
||||
@@ -1095,10 +1094,10 @@ function htmlentitiesDecode(str) {
|
||||
main_obj.data('form').animation_iteration_count = animation_iteration_count;
|
||||
main_obj.data('form').animation_infinite = animation_infinite;
|
||||
}
|
||||
|
||||
|
||||
animation_bt.trigger('click');
|
||||
});
|
||||
|
||||
|
||||
//DONGND:: hide section select animation for column and group when click out
|
||||
$(document).on("click", function (e) {
|
||||
if ($('.animation-button.active').length)
|
||||
@@ -1106,16 +1105,16 @@ function htmlentitiesDecode(str) {
|
||||
e.stopPropagation();
|
||||
var container = $('.animation-wrapper');
|
||||
var container2 = $('.animation-button');
|
||||
|
||||
if (container.length && container.has(e.target).length === 0 && container2.has(e.target).length === 0 && !$(e.target).hasClass('animation-button') && !$(e.target).hasClass('animation-wrapper')) {
|
||||
// container.hide();
|
||||
|
||||
if (container.length && container.has(e.target).length === 0 && container2.has(e.target).length === 0 && !$(e.target).hasClass('animation-button') && !$(e.target).hasClass('animation-wrapper')) {
|
||||
// container.hide();
|
||||
// $('.animation-button.active').siblings('.animation-wrapper').find('.animationSandbox').removeClass().removeAttr('style').addClass('animationSandbox');
|
||||
// $('.animation-button.active').removeClass('active');
|
||||
// $('.animation-button.active').removeClass('active');
|
||||
$('.animation-button.active').trigger('click');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//DONGND:: active button for section select animation for column and group
|
||||
$(document).on("change", '.animation_select', function (e) {
|
||||
var wrapper_obj = $(this).parents('.animation-wrapper');
|
||||
@@ -1132,24 +1131,24 @@ function htmlentitiesDecode(str) {
|
||||
else
|
||||
{
|
||||
var iteration_number = wrapper_obj.find('.animation_iteration_count').val();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wrapper_obj.find('.animationSandbox').removeClass().removeAttr('style').attr('style','animation-duration: '+duration_time+'s; animation-delay: '+delay_time+'s; animation-iteration-count: '+iteration_number).addClass($(this).val() + ' animated animationSandbox').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
|
||||
$(this).removeClass().removeAttr('style').addClass('animationSandbox');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//DONGND:: run demo with current config
|
||||
$(document).on("click", '.animate-it', function (e) {
|
||||
var wrapper_obj = $(this).parents('.animation-wrapper');
|
||||
wrapper_obj.find('.animation_select').trigger('change');
|
||||
});
|
||||
|
||||
|
||||
//DONGND:: copy to clipboard
|
||||
$(document).on("click", '.bt_copy_clipboard', function (e) {
|
||||
$(document).on("click", '.bt_copy_clipboard', function (e) {
|
||||
var text_copy = '';
|
||||
|
||||
|
||||
if ($(this).hasClass('shortcode_key'))
|
||||
{
|
||||
text_copy = $('#shortcode_key').val();
|
||||
@@ -1162,22 +1161,22 @@ function htmlentitiesDecode(str) {
|
||||
{
|
||||
text_copy = $('#shortcode_embedded_code').val();
|
||||
};
|
||||
|
||||
|
||||
if (text_copy != '')
|
||||
{
|
||||
var $temp = $("<input>");
|
||||
$("body").append($temp);
|
||||
$("body").append($temp);
|
||||
$temp.val(text_copy).select();
|
||||
document.execCommand("copy");
|
||||
showSuccessMessage('Copy successful');
|
||||
$temp.remove();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
//DONGND:: assign config to data form column/group
|
||||
this.assignConfigAnimation = function (obj_bt, data_type, data_delay, data_duration, data_iteration, data_infinite) {
|
||||
this.assignConfigAnimation = function (obj_bt, data_type, data_delay, data_duration, data_iteration, data_infinite) {
|
||||
obj_bt.data('animation-type', data_type);
|
||||
obj_bt.data('animation-delay', data_delay);
|
||||
obj_bt.data('animation-duration', data_duration);
|
||||
@@ -1185,8 +1184,8 @@ function htmlentitiesDecode(str) {
|
||||
obj_bt.data('animation-infinite', data_infinite);
|
||||
var txt_default = obj_bt.find('.animation-status').data('text-default');
|
||||
if (data_type != 'none')
|
||||
{
|
||||
obj_bt.addClass('btn-success');
|
||||
{
|
||||
obj_bt.addClass('btn-success');
|
||||
var txt_infinite = obj_bt.find('.animation-status').data('text-infinite');
|
||||
obj_bt.find('.animation-status').text(data_type + (data_infinite == 1 ? ' ('+txt_infinite+')' : ''));
|
||||
}
|
||||
@@ -1344,46 +1343,46 @@ function htmlentitiesDecode(str) {
|
||||
};
|
||||
// AJAX LOAD FORM, LOAD WIDGET
|
||||
this.setFormAction = function () {
|
||||
var $globalthis = this;
|
||||
|
||||
//DONGND:: slick custom enable/disable
|
||||
$('#slick_custom_status').change(function(){
|
||||
var $globalthis = this;
|
||||
|
||||
//DONGND:: slick custom enable/disable
|
||||
$('#slick_custom_status').change(function(){
|
||||
if($(this).val() == 1)
|
||||
{
|
||||
{
|
||||
$('#slick_custom').parents('.form-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$('#slick_custom').parents('.form-group').hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
//DONGND:: slick center mode enable/disable
|
||||
$('#slick_centermode').change(function(){
|
||||
$('#slick_centermode').change(function(){
|
||||
if($(this).val() == 1)
|
||||
{
|
||||
{
|
||||
$('#slick_centerpadding').parents('.form-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$('#slick_centerpadding').parents('.form-group').hide();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('.form-action').change(function () {
|
||||
var elementName = $(this).attr('name');
|
||||
$('.' + elementName + '_sub').hide();
|
||||
$('.' + elementName + '-' + $(this).val()).show();
|
||||
|
||||
|
||||
//DONGND:: special fields of slick carousel
|
||||
if ($(this).val() == 'slickcarousel')
|
||||
{
|
||||
{
|
||||
$('#slick_custom_status').trigger('change');
|
||||
$('#slick_centermode').trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Show tool tip, hint of label
|
||||
$("#modal_form .label-tooltip").tooltip();
|
||||
|
||||
@@ -1541,7 +1540,7 @@ function htmlentitiesDecode(str) {
|
||||
if ($(".select-class").length) {
|
||||
$(".select-class").click(function () {
|
||||
if ($(this).is(':checked')) {
|
||||
|
||||
|
||||
$('.select-class').each(function() {
|
||||
// REMOVE ALL CHECKBOX VALUE IN TEXT
|
||||
var classChk = $(this).data("value");
|
||||
@@ -1565,9 +1564,9 @@ function htmlentitiesDecode(str) {
|
||||
$(elementText).val(classChk);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".chk-row").click(function () {
|
||||
var classChk = $(this).data("value");
|
||||
var elementText = $(this).closest('.well').find('.element_class').first();
|
||||
@@ -1749,7 +1748,7 @@ function htmlentitiesDecode(str) {
|
||||
// Reinit
|
||||
var container = (currentTab === "widget" ? $containerWidget : $containerModule);
|
||||
|
||||
// Priority is action search, in the case text search is not empty
|
||||
// Priority is action search, in the case text search is not empty
|
||||
// will search and reset sub category is Show all
|
||||
if (filterValue !== "*") {
|
||||
$(".for-" + currentTab + " .btn").removeClass("is-checked");
|
||||
@@ -1837,14 +1836,14 @@ function htmlentitiesDecode(str) {
|
||||
contentHtml = "";
|
||||
|
||||
widgetType = '';
|
||||
|
||||
|
||||
// FIX : widget AP_RAW_HTML always get content of AP_HTML which created before
|
||||
$($("#configuration_form").serializeArray()).each(function (i, field) {
|
||||
if (field.name.substring(0, 2).toLowerCase() == 'ap' && field.value == '1') {
|
||||
widgetType = field.name;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (typeof tinyMCE != "undefined" && widgetType != 'ApRawHtml') {
|
||||
tinyMCE.triggerSave();
|
||||
//var mce = tinyMCE.activeEditor.getContent();
|
||||
@@ -1863,13 +1862,13 @@ function htmlentitiesDecode(str) {
|
||||
});
|
||||
|
||||
$($("#configuration_form").serializeArray()).each(function (i, field) {
|
||||
|
||||
|
||||
// SET EMPTY VALUE AFTER UPDATE LANGUAGE FOR OTHER FIELD
|
||||
if( field.value == '_JS_EMPTY_VALUE_')
|
||||
{
|
||||
field.value = '';
|
||||
}
|
||||
|
||||
|
||||
if (field.name.substring(0, 2).toLowerCase() == 'ap' && field.value == '1') {
|
||||
widgetType = field.name;
|
||||
} else {
|
||||
@@ -1935,10 +1934,10 @@ function htmlentitiesDecode(str) {
|
||||
$(currentE).attr("href", "#" + ObjectForm.id);
|
||||
}
|
||||
if (type == "update") {
|
||||
// SAVE ACTIVE
|
||||
// SAVE ACTIVE
|
||||
//DONGND:: fix can't save tab after update
|
||||
if (widgetType != "ap_sub_tabs")
|
||||
{
|
||||
{
|
||||
if ($(currentE).find('.btn-status').first().hasClass("deactive")) {
|
||||
ObjectForm.active = 0;
|
||||
} else {
|
||||
@@ -1958,13 +1957,13 @@ function htmlentitiesDecode(str) {
|
||||
} else {
|
||||
$(currentE).data("form", ObjectForm);
|
||||
}
|
||||
|
||||
|
||||
//DONGND:: update name of tab after change
|
||||
if (widgetType == "ap_sub_tabs")
|
||||
{
|
||||
$(currentE).text(ObjectForm['title_' + $globalthis.lang_id]);
|
||||
}
|
||||
|
||||
|
||||
//console.log(ObjectForm);
|
||||
$(".label-tooltip").tooltip();
|
||||
return true;
|
||||
@@ -2095,7 +2094,7 @@ function htmlentitiesDecode(str) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//default xs = 6-> 2 cols.but we set 2 cols, we have to assign again
|
||||
//default xs = 6-> 2 cols.but we set 2 cols, we have to assign again
|
||||
if (startSet && ((12 / parseInt(colDefault[$globalthis.arrayCol[j]])) < colNumber)) {
|
||||
colDefault[$globalthis.arrayCol[j]] = finalVal;
|
||||
}
|
||||
@@ -2204,12 +2203,12 @@ function htmlentitiesDecode(str) {
|
||||
//set hook to object
|
||||
objects[iHook] = objHook;
|
||||
});
|
||||
|
||||
|
||||
//DONGND: enable save multithreading
|
||||
if(checkSaveMultithreading == 1)
|
||||
{
|
||||
var i = 0;
|
||||
doLoop(isValid);
|
||||
doLoop(isValid);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2243,22 +2242,22 @@ function htmlentitiesDecode(str) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
//DONGND: function run save multithreading
|
||||
function doLoop(isValid) {
|
||||
function doLoop(isValid) {
|
||||
var temp_obj = new Object();
|
||||
temp_obj[i] = objects[i];
|
||||
data = 'dataForm=' + JSON.stringify(temp_obj);
|
||||
data = 'dataForm=' + JSON.stringify(temp_obj);
|
||||
if(i+1 == Object.keys(objects).length)
|
||||
{
|
||||
data += '&dataLast=1';
|
||||
};
|
||||
|
||||
|
||||
if(i==0)
|
||||
{
|
||||
data += '&dataFirst=1';
|
||||
};
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
headers: {"cache-control": "no-cache"},
|
||||
@@ -2293,7 +2292,7 @@ function htmlentitiesDecode(str) {
|
||||
$("#ap_loading").hide();
|
||||
alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
return false;
|
||||
});
|
||||
@@ -2329,7 +2328,7 @@ function htmlentitiesDecode(str) {
|
||||
//console.log(objects);
|
||||
$('#data_profile').val(JSON.stringify(objects));
|
||||
$('#data_id_profile').val($('#current_profile').data('id'));
|
||||
|
||||
|
||||
if($globalthis.isValid == true)
|
||||
{
|
||||
$("#form_data_profile button").click();
|
||||
@@ -2338,10 +2337,10 @@ function htmlentitiesDecode(str) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
//DONGND:: submit shortcode
|
||||
$(document).on("click", ".shortcode_save_btn, .shortcode_save_stay_btn", function () {
|
||||
|
||||
$(document).on("click", ".shortcode_save_btn, .shortcode_save_stay_btn", function () {
|
||||
|
||||
if ($(this).hasClass('shortcode_save_stay_btn'))
|
||||
{
|
||||
$('#stay_page').val(1);
|
||||
@@ -2356,16 +2355,16 @@ function htmlentitiesDecode(str) {
|
||||
objHook.groups = {};
|
||||
// console.log($('.group-row'));
|
||||
$('.hook-wrapper .group-row').each(function (iGroup) {
|
||||
|
||||
|
||||
objHook.groups[iGroup] = $globalthis.getHookSubmit(this, true);
|
||||
});
|
||||
// console.log(objHook);
|
||||
$('#shortcode_content').val(JSON.stringify(objHook));
|
||||
|
||||
|
||||
$('#appagebuilder_shortcode_form').submit();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click", ".position-cover .list-position .position-name", function () {
|
||||
var select = $(this).closest("ul");
|
||||
var isRunning = (typeof $(select).attr("isRunning") != "undefined") ? $(select).attr("isRunning") : "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{*
|
||||
{*
|
||||
* @Module Name: AP Page Builder
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
@@ -26,7 +26,7 @@
|
||||
<input type="text" name="bg_img" id="bg_img" value="" class=""><a href="javascript:void(0)" class="select-img">{l s='Select image ' mod='appagebuilder'}</a>
|
||||
<p class="help-block">{l s='Please put image link or select image' mod='appagebuilder'}</p>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{if $input.type == 'apExceptions'}
|
||||
<div class="well">
|
||||
<div>
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
{if $input.type == 'ApRowclass'}
|
||||
{if $input.type == 'ApRowclass'}
|
||||
<label class="choise-class col-lg-12"><input type="checkbox" class="chk-row" data-value="row" value="1"> {l s='Use class row' mod='appagebuilder'}</label>
|
||||
{/if}
|
||||
<label class="control-label col-lg-1">{$input.leolabel}</label>
|
||||
@@ -56,7 +56,7 @@
|
||||
<li>
|
||||
<label class="choise-class"><input class="select-class" type="checkbox" data-value="hidden-md" value="1"> {l s='Hidden in Medium devices' mod='appagebuilder'}</label>
|
||||
</li>
|
||||
<li>
|
||||
<li>
|
||||
<label class="choise-class"><input class="select-class" type="checkbox" data-value="hidden-sm" value="1"> {l s='Hidden in Small devices' mod='appagebuilder'}</label>
|
||||
</li>
|
||||
<li>
|
||||
@@ -70,7 +70,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
{if $input.type == 'bg_select'}
|
||||
{$image_uploader}{* HTML form , no escape necessary *}
|
||||
{/if}
|
||||
@@ -100,7 +100,7 @@
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$widthList item=itemWidth}
|
||||
<li>
|
||||
<a class="width-select" href="javascript:void(0);" tabindex="-1">
|
||||
<a class="width-select" href="javascript:void(0);" tabindex="-1">
|
||||
<span data-width="{$itemWidth|escape:'html':'UTF-8'}" class="width-val ap-w-{if $itemWidth|strpos:"."|escape:'html':'UTF-8'}{$itemWidth|replace:'.':'-'|escape:'html':'UTF-8'}{else}{$itemWidth|escape:'html':'UTF-8'}{/if}">{$itemWidth|escape:'html':'UTF-8'}/12 - ( {math equation="x/y*100" x=$itemWidth y=12 format="%.2f"} % )</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{*
|
||||
{*
|
||||
* @Module Name: AP Page Builder
|
||||
* @Website: apollotheme.com - prestashop template provider
|
||||
* @author Apollotheme <apollotheme@gmail.com>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
* @description: ApPageBuilder is module help you can build content for your shop
|
||||
*}
|
||||
<!-- @file modules\appagebuilder\views\templates\hook\header -->
|
||||
|
||||
<script>
|
||||
/**
|
||||
* List functions will run when document.ready()
|
||||
|
||||
@@ -17,7 +17,7 @@ require_once(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
require_once(dirname(__FILE__).'/../../init.php');
|
||||
|
||||
include_once(dirname(__FILE__).'/leofeature.php');
|
||||
include_once(dirname(__FILE__).'/classes/LeofeatureProduct.php');
|
||||
include_once(dirname(__FILE__).'/../classes/LeofeatureProduct.php');
|
||||
|
||||
$module = new Leofeature();
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class PromotionalPriceRounding extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'promotionalpricerounding';
|
||||
$this->tab = 'pricing';
|
||||
$this->version = '1.0.0';
|
||||
$this->author = 'Twoja Nazwa';
|
||||
$this->need_instance = 0;
|
||||
$this->ps_versions_compliancy = ['min' => '1.7.0.0', 'max' => _PS_VERSION_];
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Zaokrąglanie cen promocyjnych w górę');
|
||||
$this->description = $this->l('Zaokrągla ceny promocyjne w górę, tak jak zwykłe ceny.');
|
||||
|
||||
$this->confirmUninstall = $this->l('Czy na pewno chcesz odinstalować ten moduł?');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install() && $this->registerHook('actionProductGetPrice');
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
return parent::uninstall() && $this->unregisterHook('actionProductGetPrice');
|
||||
}
|
||||
|
||||
public function hookActionProductGetPrice($params)
|
||||
{
|
||||
if (isset($params['product'])) {
|
||||
$product = $params['product'];
|
||||
$price = $params['price'];
|
||||
$currency = Context::getContext()->currency;
|
||||
$decimals = is_array($currency) ? (int) $currency['decimals'] : (int) $currency->decimals;
|
||||
$factor = pow(10, $decimals);
|
||||
|
||||
// Sprawdź, czy produkt ma aktywną promocję
|
||||
if (isset($product->specificPrice) && $product->specificPrice && $product->specificPrice['reduction'] > 0) {
|
||||
$params['price'] = ceil($price * $factor) / $factor;
|
||||
} elseif (isset($product->reduction) && $product->reduction > 0) {
|
||||
// Obsługa reguł cenowych
|
||||
$params['price'] = ceil($price * $factor) / $factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
$(document).ready(function () {
|
||||
$('.block_newsletter form').on('submit', function () {
|
||||
$('.my_row.newsletter form').on('submit', function () {
|
||||
var psemailsubscriptionForm = $(this);
|
||||
if (typeof psemailsubscription_subscription === 'undefined') {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user