Initial commit

This commit is contained in:
2019-11-20 07:44:43 +01:00
commit 5bf49c4a81
41188 changed files with 5459177 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../../');
exit;

View File

@@ -0,0 +1,85 @@
/*
* HTML5 Sortable jQuery Plugin
* http://farhadi.ir/projects/html5sortable
*
* Copyright 2012, Ali Farhadi
* Released under the MIT license.
*/
(function($) {
var dragging, placeholders = $();
$.fn.sortable = function(options) {
var method = String(options);
options = $.extend({
connectWith: false
}, options);
return this.each(function() {
if (/^enable|disable|destroy$/.test(method)) {
var items = $(this).children($(this).data('items')).attr('draggable', method == 'enable');
if (method == 'destroy') {
items.add(this).removeData('connectWith items')
.off('dragstart.h5s dragend.h5s selectstart.h5s dragover.h5s dragenter.h5s drop.h5s');
}
return;
}
var isHandle, index, items = $(this).children(options.items);
var placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">');
items.find(options.handle).mousedown(function() {
isHandle = true;
}).mouseup(function() {
isHandle = false;
});
$(this).data('items', options.items)
placeholders = placeholders.add(placeholder);
if (options.connectWith) {
$(options.connectWith).add(this).data('connectWith', options.connectWith);
}
items.attr('draggable', 'true').on('dragstart.h5s', function(e) {
if (options.handle && !isHandle) {
return false;
}
isHandle = false;
var dt = e.originalEvent.dataTransfer;
dt.effectAllowed = 'move';
dt.setData('Text', 'dummy');
index = (dragging = $(this)).addClass('sortable-dragging').index();
}).on('dragend.h5s', function() {
if (!dragging) {
return;
}
dragging.removeClass('sortable-dragging').show();
placeholders.detach();
if (index != dragging.index()) {
dragging.parent().trigger('sortupdate', {item: dragging, start_index: index, end_index: dragging.index()});
}
dragging = null;
}).not('a[href], img').on('selectstart.h5s', function() {
this.dragDrop && this.dragDrop();
return false;
}).end().add([this, placeholder]).on('dragover.h5s dragenter.h5s drop.h5s', function(e) {
if (!items.is(dragging) && options.connectWith !== $(dragging).parent().data('connectWith')) {
return true;
}
if (e.type == 'drop') {
e.stopPropagation();
placeholders.filter(':visible').after(dragging);
dragging.trigger('dragend.h5s');
return false;
}
e.preventDefault();
e.originalEvent.dataTransfer.dropEffect = 'move';
if (items.is(this)) {
if (options.forcePlaceholderSize) {
placeholder.height(dragging.outerHeight());
}
dragging.hide();
$(this)[placeholder.index() < $(this).index() ? 'after' : 'before'](placeholder);
placeholders.not(placeholder).detach();
} else if (!placeholders.is(this) && !$(this).children(options.items).length) {
placeholders.detach();
$(this).append(placeholder);
}
return false;
});
});
};
})(jQuery);

View File

@@ -0,0 +1,219 @@
function checkForm()
{
var is_category_selected = false;
var is_filter_selected = false;
$('#categories-treeview input[type=checkbox]').each(
function()
{
if ($(this).prop('checked'))
{
is_category_selected = true;
return false;
}
}
);
$('.filter_list_item input[type=checkbox]').each(
function()
{
if ($(this).prop('checked'))
{
is_filter_selected = true;
return false;
}
}
);
if (!is_category_selected)
{
alert(translations['no_selected_categories']);
$('#categories-treeview input[type=checkbox]').first().focus();
return false;
}
if (!is_filter_selected)
{
alert(translations['no_selected_filters']);
$('#filter_list_item input[type=checkbox]').first().focus();
return false;
}
return true;
}
$(document).ready(
function()
{
$('.ajaxcall').click(
function()
{
if (this.legend == undefined)
this.legend = $(this).html();
if (this.running == undefined)
this.running = false;
if (this.running == true)
return false;
$('.ajax-message').hide();
this.running = true;
if (typeof(this.restartAllowed) == 'undefined' || this.restartAllowed)
{
$(this).html(this.legend+translations['in_progress']);
$('#indexing-warning').show();
}
this.restartAllowed = false;
var type = $(this).attr('rel');
$.ajax(
{
url: this.href+'&ajax=1',
context: this,
dataType: 'json',
cache: 'false',
success: function(res)
{
this.running = false;
this.restartAllowed = true;
$('#indexing-warning').hide();
$(this).html(this.legend);
if (type == 'price')
$('#ajax-message-ok span').html(translations['url_indexation_finished']);
else
$('#ajax-message-ok span').html(translations['attribute_indexation_finished']);
$('#ajax-message-ok').show();
return;
},
error: function(res)
{
this.restartAllowed = true;
$('#indexing-warning').hide();
if (type == 'price')
$('#ajax-message-ko span').html(translations['url_indexation_failed']);
else
$('#ajax-message-ko span').html(translations['attribute_indexation_failed']);
$('#ajax-message-ko').show();
$(this).html(this.legend);
this.running = false;
}
}
);
return false;
});
$('.ajaxcall-recurcive').each(
function(it, elm)
{
$(elm).click(
function()
{
if (this.cursor == undefined)
this.cursor = 0;
if (this.legend == undefined)
this.legend = $(this).html();
if (this.running == undefined)
this.running = false;
if (this.running == true)
return false;
$('.ajax-message').hide();
this.running = true;
if (typeof(this.restartAllowed) == 'undefined' || this.restartAllowed)
{
$(this).html(this.legend+translations['in_progress']);
$('#indexing-warning').show();
}
this.restartAllowed = false;
$.ajax(
{
url: this.href+'&ajax=1&cursor='+this.cursor,
context: this,
dataType: 'json',
cache: 'false',
success: function(res)
{
this.running = false;
if (res.result)
{
this.cursor = 0;
$('#indexing-warning').hide();
$(this).html(this.legend);
$('#ajax-message-ok span').html(translations['price_indexation_finished']);
$('#ajax-message-ok').show();
return;
}
this.cursor = parseInt(res.cursor);
$(this).html(this.legend+translations['price_indexation_in_progress'].replace('%s', res.count));
$(this).click();
},
error: function(res)
{
this.restartAllowed = true;
$('#indexing-warning').hide();
$('#ajax-message-ko span').html(translations['price_indexation_failed']);
$('#ajax-message-ko').show();
$(this).html(this.legend);
this.cursor = 0;
this.running = false;
}
});
return false;
}
);
}
);
if (typeof PS_LAYERED_INDEXED !== 'undefined' && PS_LAYERED_INDEXED)
{
$('#url-indexe').click();
$('#full-index').click();
}
$('.sortable').sortable(
{
forcePlaceholderSize: true
});
$('.filter_list_item input[type=checkbox]').click(
function()
{
var current_selected_filters_count = parseInt($('#selected_filters').html());
if ($(this).prop('checked'))
$('#selected_filters').html(current_selected_filters_count+1);
else
$('#selected_filters').html(current_selected_filters_count-1);
}
);
if (typeof filters !== 'undefined')
{
filters = JSON.parse(filters);
for (filter in filters)
{
$('#'+filter).attr("checked","checked");
$('#selected_filters').html(parseInt($('#selected_filters').html())+1);
$('select[name="'+filter+'_filter_type"]').val(filters[filter].filter_type);
$('select[name="'+filter+'_filter_show_limit"]').val(filters[filter].filter_show_limit);
}
}
}
);