This commit is contained in:
2025-04-01 00:38:54 +02:00
parent d4d4c0c09d
commit 87da06293a
22351 changed files with 5168854 additions and 7538 deletions

View File

@@ -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);',

View File

@@ -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') {

View File

@@ -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") : "";

View File

@@ -1,4 +1,4 @@
{*
{*
* @Module Name: AP Page Builder
* @Website: apollotheme.com - prestashop template provider
* @author Apollotheme <apollotheme@gmail.com>
@@ -25,7 +25,7 @@
<a href="javascript:;" id="btn-preview" class="label-tooltip" title="{l s='Preview this profile' mod='appagebuilder'}" data-placement="left"><i class="icon-zoom-in"></i></a>
<a href="javascript:;" id="btn-design-layout" class="label-tooltip" title="{l s='Mode design layout' mod='appagebuilder'}" data-placement="left"><i class="icon-desktop"></i></a>
</div>
<iframe id="live-edit-iframe" src="{$url_live_edit|escape:'html':'UTF-8'}{if $id_default}{$id_default|escape:'html':'UTF-8'}{/if}"
<iframe id="live-edit-iframe" src="{$url_live_edit|escape:'html':'UTF-8'}{if $id_default}{$id_default|escape:'html':'UTF-8'}{/if}"
idProfile="{if $id_default}{$id_default|escape:'html':'UTF-8'}{/if}">
</iframe>
</div>
@@ -44,11 +44,11 @@
{addJsDef idProfile=$id_default}
function resize() {
//$("#live-edit-iframe").width($(window).width() - 80);
$("#live-edit-iframe").height($("body").height() -
$("#header_infos").height() - $(".page-head").height() -
$("#form-appagebuilder_profiles").height() - $(".ap-live-tool").height() -
$("#live-edit-iframe").height($("body").height() -
$("#header_infos").height() - $(".page-head").height() -
$("#form-appagebuilder_profiles").height() - $(".ap-live-tool").height() -
$("#footer").height() - 80 - ($(".bootstrap .alert").length > 0 ? ($(".bootstrap .alert").height() + 20) : 0));
}
function changeProfilePreview(obj) {
$("#ap_loading").show();
@@ -59,7 +59,7 @@
var td = $(obj).closest("tr").find("td:nth-child(1)");
var tdName = $(obj).closest("tr").find("td:nth-child(2)");
}
var d = new Date();
idProfile = $.trim($(td).text());
$("#name-profile b").text($.trim($(tdName).text()));
@@ -76,15 +76,15 @@
var idProfile = $.trim($(this).find("td:nth-child(1)").text());
else
var idProfile = $.trim($(this).find("td:nth-child(2)").text());
var url = urlProfileDetail + "&submitBulkinsertLangappagebuilder_profiles&id=" + idProfile;
$(this).find(".pull-right ul").prepend("<li><a title='{l s='Copy data from default language to other' mod='appagebuilder'}' href='" + url + "'><i class='icon-copy'></i> {l s='Copy to Other Language' mod='appagebuilder'}</a></li>");
url = urlEditProfile + "&id_appagebuilder_profiles=" + idProfile;
$(this).find(".pull-right ul").prepend("<li><a title='{l s='Edit in mode design layout' mod='appagebuilder'}' target='_blank' href='" + url + "'><i class='icon-desktop'></i> {l s='Edit Design Layout' mod='appagebuilder'}</a></li>");
url = urlPreview + "?id_appagebuilder_profiles=" + idProfile;
$(this).find(".pull-right ul").prepend("<li><a title='{l s='Preview' mod='appagebuilder'}' target='_blank' href='" + url + "'><i class='icon-search-plus'></i> {l s='Preview' mod='appagebuilder'}</a></li>");
});
@@ -95,20 +95,20 @@
});
var d = new Date();
if($('.table-responsive-row .row-selector').length){
var listTd = ".appagebuilder_profiles tr td:nth-child(2)," +
var listTd = ".appagebuilder_profiles tr td:nth-child(2)," +
".appagebuilder_profiles tr td:nth-child(3), .appagebuilder_profiles tr td:nth-child(4)";
}else{
var listTd = ".appagebuilder_profiles tr td:nth-child(1)," +
var listTd = ".appagebuilder_profiles tr td:nth-child(1)," +
".appagebuilder_profiles tr td:nth-child(2), .appagebuilder_profiles tr td:nth-child(3)";
}
$("#live-edit-iframe").attr("src", urlLiveEdit + "&ap_edit_token=" + urlEditProfileToken + "&id_appagebuilder_profiles=" + idProfile + "&t=" + d.getTime());
$(listTd).each(function() {
$(this).attr("onclick", "return changeProfilePreview(this);");
});
$("#btn-reload-live").click(function() {
$("#ap_loading").show();
var d = new Date();
var d = new Date();
$("#live-edit-iframe").attr("src", urlLiveEdit + "&ap_edit_token=" + urlEditProfileToken + "&id_appagebuilder_profiles=" + idProfile + "&t=" + d.getTime());
});
$("#btn-preview").click(function() {

View File

@@ -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>