first commit

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

View File

@@ -0,0 +1,5 @@
drwxr-xr-x 2 30094 users 5 Oct 6 10:16 .
drwxr-xr-x 5 30094 users 6 Oct 6 10:16 ..
-rw-r--r-- 1 30094 users 905 Aug 31 2021 index.php
-rw-r--r-- 1 30094 users 607 Aug 31 2021 jxblogpostproducts.js
-rw-r--r-- 1 30094 users 3873 Aug 31 2021 jxblogpostproducts_admin.js

View File

@@ -0,0 +1,32 @@
<?php
/**
* 2017-2018 Zemez
*
* JX Blog Post Products
*
* NOTICE OF LICENSE
*
* This source file is subject to the General Public License (GPL 2.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/GPL-2.0
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade the module to newer
* versions in the future.
*
* @author Zemez (Alexander Grosul)
* @copyright 2017-2018 Zemez
* @license http://opensource.org/licenses/GPL-2.0 General Public License (GPL 2.0)
*/
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,21 @@
/**
* 2017-2018 Zemez
*
* JX Blog Post Products
*
* NOTICE OF LICENSE
*
* This source file is subject to the General Public License (GPL 2.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/GPL-2.0
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade the module to newer
* versions in the future.
*
* @author Zemez (Alexander Grosul)
* @copyright 2017-2018 Zemez
* @license http://opensource.org/licenses/GPL-2.0 General Public License (GPL 2.0)
*/

View File

@@ -0,0 +1,112 @@
/**
* 2017-2018 Zemez
*
* JX Blog Post Products
*
* NOTICE OF LICENSE
*
* This source file is subject to the General Public License (GPL 2.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/GPL-2.0
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade the module to newer
* versions in the future.
*
* @author Zemez (Alexander Grosul)
* @copyright 2017-2018 Zemez
* @license http://opensource.org/licenses/GPL-2.0 General Public License (GPL 2.0)
*/
$(document).ready(function() {
jxblogpostproducts.autocompleteInit($('#products_autocomplete_input'), 'ajax_products_list.php?exclude_packs=0&excludeVirtuals=0&token='+token);
$('#divproducts').delegate('.delproducts', 'click', function() {
jxblogpostproducts.delProduct($(this).attr('name'));
});
});
jxblogpostproducts = {
autocompleteInit : function(block, url) {
block.autocomplete(url, {
minChars : 3,
autoFill : true,
max : 20,
matchContains : true,
mustMatch : false,
scroll : false,
cacheLength : 0,
formatItem : function(item) {
if (typeof(item[1]) == 'undefined') {
return 'no result found';
}
return item[1] + ' - ' + item[0];
}
}).result(this.addProduct);
block.setOptions({
extraParams : {
excludeIds : this.getProductIds()
}
});
},
getProductIds : function() {
if (typeof($('#inputproducts').val()) !== 'undefined') {
return $('#inputproducts').val().replace(/\-/g, ',');
} else {
return false;
}
},
addProduct : function(event, data, formatted) {
if (data == null) {
return false;
}
var productId = data[1];
var productName = data[0];
var $divProducts = $('#divproducts');
var $inputProducts = $('#inputproducts');
var $nameProducts = $('#nameproducts');
$divProducts.html($divProducts.html() + '<div class="form-control-static"><button type="button" class="delproducts btn btn-default" name="' + productId + '"><i class="icon-remove text-danger"></i></button>&nbsp;' + productName + '</div>');
$nameProducts.val($nameProducts.val() + productName + '¤');
$inputProducts.val($inputProducts.val() + productId + '-');
$('#products_autocomplete_input').val('');
$('#products_autocomplete_input').setOptions({
extraParams : {excludeIds : jxblogpostproducts.getProductIds()}
});
},
delProduct : function(id) {
var div = getE('divproducts');
var input = getE('inputproducts');
var name = getE('nameproducts');
// Cut hidden fields in array
var inputCut = input.value.split('-');
var nameCut = name.value.split('¤');
if (inputCut.length != nameCut.length) {
return jAlert('Bad size');
}
// Reset all hidden fields
input.value = '';
name.value = '';
div.innerHTML = '';
for (i in inputCut) {
// If empty, error, next
if (!inputCut[i] || !nameCut[i]) {
continue;
}
// Add to hidden fields no selected products OR add to select field selected product
console.log(id, inputCut[i]);
if (inputCut[i] != id) {
input.value += inputCut[i] + '-';
name.value += nameCut[i] + '¤';
div.innerHTML += '<div class="form-control-static"><button type="button" class="delproducts btn btn-default" name="' + inputCut[i] + '"><i class="icon-remove text-danger"></i></button>&nbsp;' + nameCut[i] + '</div>';
}
else {
input.value += '-';
name.value += '¤';
}
}
$('#products_autocomplete_input').setOptions({
extraParams : {excludeIds : jxblogpostproducts.getProductIds()}
});
}
};