From da5caf62016e79b4cd10e90aacfda7e218b5743f Mon Sep 17 00:00:00 2001 From: Roman Pyrih Date: Mon, 31 Mar 2025 11:40:02 +0200 Subject: [PATCH 1/4] Some FIX --- .../controllers/admin/AdminApPageBuilderProfiles.php | 5 +++++ modules/appagebuilder/js/admin/form.js | 2 ++ modules/appagebuilder/views/js/admin/form.js | 2 ++ modules/appagebuilder/views/templates/hook/header.tpl | 1 - modules/leofeature/psajax.php | 2 +- themes/leo_gstore/templates/layouts/layout-both-columns.tpl | 2 +- 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/appagebuilder/controllers/admin/AdminApPageBuilderProfiles.php b/modules/appagebuilder/controllers/admin/AdminApPageBuilderProfiles.php index a9e606fc..63526bf7 100644 --- a/modules/appagebuilder/controllers/admin/AdminApPageBuilderProfiles.php +++ b/modules/appagebuilder/controllers/admin/AdminApPageBuilderProfiles.php @@ -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( diff --git a/modules/appagebuilder/js/admin/form.js b/modules/appagebuilder/js/admin/form.js index e86edad7..37b1b4ae 100644 --- a/modules/appagebuilder/js/admin/form.js +++ b/modules/appagebuilder/js/admin/form.js @@ -19,6 +19,8 @@ function updateListIdFullSlider() { $("#total_slider").val(listId); } $(document).ready(function() { + console.log("ready!"); + $("#modal_form").draggable({ handle: ".modal-header" }); diff --git a/modules/appagebuilder/views/js/admin/form.js b/modules/appagebuilder/views/js/admin/form.js index e86edad7..ea4c7cc0 100644 --- a/modules/appagebuilder/views/js/admin/form.js +++ b/modules/appagebuilder/views/js/admin/form.js @@ -19,6 +19,8 @@ function updateListIdFullSlider() { $("#total_slider").val(listId); } $(document).ready(function() { + console.log("ready"); + $("#modal_form").draggable({ handle: ".modal-header" }); diff --git a/modules/appagebuilder/views/templates/hook/header.tpl b/modules/appagebuilder/views/templates/hook/header.tpl index 5292996d..1477af1c 100644 --- a/modules/appagebuilder/views/templates/hook/header.tpl +++ b/modules/appagebuilder/views/templates/hook/header.tpl @@ -6,7 +6,6 @@ * @description: ApPageBuilder is module help you can build content for your shop *} - '; } } - + $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[] = ''; } } - + # 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[] = ''; } - + # 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[] = ''; } } - + # 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 .= ''; 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 */ diff --git a/modules/appagebuilder/classes/ApPageBuilderShortcodeModel.php b/modules/appagebuilder/classes/ApPageBuilderShortcodeModel.php index da513fee..2822abc1 100644 --- a/modules/appagebuilder/classes/ApPageBuilderShortcodeModel.php +++ b/modules/appagebuilder/classes/ApPageBuilderShortcodeModel.php @@ -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 '
';
         // 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
diff --git a/modules/appagebuilder/controllers/admin/AdminApPageBuilderProducts.php b/modules/appagebuilder/controllers/admin/AdminApPageBuilderProducts.php
index ccaa1db6..cb6023dd 100644
--- a/modules/appagebuilder/controllers/admin/AdminApPageBuilderProducts.php
+++ b/modules/appagebuilder/controllers/admin/AdminApPageBuilderProducts.php
@@ -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 = '
              Duplicate
         ';
-        
+
         // 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) {
diff --git a/modules/appagebuilder/controllers/admin/AdminApPageBuilderProfiles.php b/modules/appagebuilder/controllers/admin/AdminApPageBuilderProfiles.php
index a9e606fc..65b9ce5b 100644
--- a/modules/appagebuilder/controllers/admin/AdminApPageBuilderProfiles.php
+++ b/modules/appagebuilder/controllers/admin/AdminApPageBuilderProfiles.php
@@ -112,7 +112,6 @@ class AdminApPageBuilderProfilesController extends ModuleAdminControllerCore
 
     public function initPageHeaderToolbar()
     {
-        $this->context->controller->addJs(apPageHelper::getJsAdminDir().'admin/form.js');
 
         $this->page_header_toolbar_btn['SaveAndStay'] = array(
             'href' => 'javascript:void(0);',
diff --git a/modules/appagebuilder/controllers/admin/AdminApPageBuilderThemeConfiguration.php b/modules/appagebuilder/controllers/admin/AdminApPageBuilderThemeConfiguration.php
index e9a2bfe2..4d9bbfa7 100644
--- a/modules/appagebuilder/controllers/admin/AdminApPageBuilderThemeConfiguration.php
+++ b/modules/appagebuilder/controllers/admin/AdminApPageBuilderThemeConfiguration.php
@@ -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' => '',
                     'form_group_class' => 'aprow_rtl',
                 );
-            
+
             $fields_form['input'][] =
                 array(
                     'type' => 'html',
@@ -1152,7 +1152,7 @@ class AdminApPageBuilderThemeConfigurationController extends ModuleAdminControll
                     'html_content' => '',
                     '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') {
diff --git a/modules/appagebuilder/override/controllers/front/CmsController.php b/modules/appagebuilder/override/controllers/front/CmsController.php
index a1a51988..3a1c423b 100644
--- a/modules/appagebuilder/override/controllers/front/CmsController.php
+++ b/modules/appagebuilder/override/controllers/front/CmsController.php
@@ -72,7 +72,7 @@ class CmsController extends CmsControllerCore
             $this->setTemplate('cms/category');
         }
         FrontController::initContent();
-        
+
         // validate module
         unset($id_module);
         unset($array_return);
diff --git a/modules/appagebuilder/views/js/admin/home.js b/modules/appagebuilder/views/js/admin/home.js
index 8b0222d5..e3213d9b 100644
--- a/modules/appagebuilder/views/js/admin/home.js
+++ b/modules/appagebuilder/views/js/admin/home.js
@@ -2,7 +2,7 @@
  *  @Website: apollotheme.com - prestashop template provider
  *  @author Apollotheme 
  *  @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 = $("");
-					$("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") : "";
diff --git a/modules/appagebuilder/views/templates/admin/content.tpl b/modules/appagebuilder/views/templates/admin/content.tpl
index 022efd0f..ec733545 100644
--- a/modules/appagebuilder/views/templates/admin/content.tpl
+++ b/modules/appagebuilder/views/templates/admin/content.tpl
@@ -1,4 +1,4 @@
-{* 
+{*
 * @Module Name: AP Page Builder
 * @Website: apollotheme.com - prestashop template provider
 * @author Apollotheme 
@@ -26,7 +26,7 @@
             {l s='Select image ' mod='appagebuilder'}
             

{l s='Please put image link or select image' mod='appagebuilder'}

- {/if} + {/if} {if $input.type == 'apExceptions'}
@@ -41,7 +41,7 @@
- {if $input.type == 'ApRowclass'} + {if $input.type == 'ApRowclass'} {/if} @@ -56,7 +56,7 @@
  • -
  • +
  • @@ -70,7 +70,7 @@
  • {/if} - + {if $input.type == 'bg_select'} {$image_uploader}{* HTML form , no escape necessary *} {/if} @@ -100,7 +100,7 @@