first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

146
web/js/backend/admin.js Normal file
View File

@@ -0,0 +1,146 @@
jQuery(function($) {
$.fn.adminInputFormat = function() {
function sanitizeNumber(number, precision, preserveSign) {
let result;
let maxlength = 11;
number = number.replace(',', '.');
number = number.split('.', 2);
number[0] = number[0].slice(0, maxlength - 3);
const sign = preserveSign && (number[0][0] == '+' || number[0][0] == '-') ? number[0][0] : '';
number = number.join('.').replace(/[^0-9\.]/ig, '');
if (number.length) {
result = sign + stPrice.round(number, precision);
}
return result;
}
function format(input) {
console.log(input);
let value = input.val();
let format = input.data('format');
if (typeof format !== 'object') {
format = { type: format, decimals: 2, signed: false };
}
console.log('format', format);
let min = undefined !== input.data('format-min-value') ? input.data('format-min-value') : format.min;
let max = undefined !== input.data('format-max-value') ? input.data('format-min-value') : format.max;
let preserveSign = undefined !== input.data('format-preserve-sign') ? input.data('format-preserve-sign') : format.signed;
let decimals = undefined !== input.data('format-decimals') ? input.data('format-decimals') : format.decimals;
switch (format.type) {
case 'price':
value = sanitizeNumber(value, 2, preserveSign);
break;
case 'float':
case 'decimal':
value = sanitizeNumber(value, decimals, preserveSign);
break;
case 'integer':
value = sanitizeNumber(value, 0, preserveSign);
break;
}
if (min && min > value) {
value = min;
}
if (max && max < value) {
value = max;
}
input.val(value);
}
$(this).each(function() {
const input = $(this);
if (!input.data('data-format-init')) {
input.change(function() {
format(input);
});
input.data('data-format-init', true);
}
});
}
$(document).ready(function($) {
$('#viewport-width').click(function() {
const container = $(this);
const layout = $('#content-viewport');
if (!container.hasClass('viewport-expanded')) {
container.addClass('viewport-expanded');
layout.addClass('viewport-expanded');
} else {
container.removeClass('viewport-expanded');
layout.removeClass('viewport-expanded');
}
$.post(container.prop('href'), {
'expanded': Number(container.hasClass('viewport-expanded'))
});
return false;
});
$('body').on('submit', '.admin_form', function(e) {
const activeElement = $(document.activeElement);
if (undefined === activeElement.data('admin-action-show-preloader') || activeElement.data('admin-action-show-preloader')) {
$(document).trigger('preloader', 'show');
}
});
$('input[data-format]').adminInputFormat();
$('body').on('click', '[data-admin-confirm], [data-admin-action]', function(e) {
const action = $(this);
if (action.is('[data-admin-confirm]')) {
console.log('admin-confirm-action!');
if (action.data('admin-confirm').length) {
if (window.confirm(action.data('admin-confirm'))) {
$(document).trigger('preloader', 'show');
if (action.data('admin-action-url')) {
window.location = action.data('admin-action-url');
} else if (action.data('admin-action-post')) {
if (action.is(':submit')) {
return true;
}
action.closest('form').submit();
} else {
window.location = action.attr('href');
}
}
return false;
}
} else if (action.is('[data-admin-action]')) {
if (!action.data('admin-confirm')) {
console.log('admin-action!');
if (action.data('admin-action') == 'delete' || action.data('admin-action') == 'action-delete' || action.is('[data-admin-action-show-preloader]')) {
$(document).trigger('preloader', 'show');
}
if (action.data('admin-action-url')) {
var link = $('<a href=\"' + action.data('admin-action-url') + '\"></a>');
if (action.data('admin-action-blank')) {
link.attr('target', '_blank');
}
$('body').append(link);
link.get(0).click();
}
}
}
return true;
});
});
});

View File

@@ -0,0 +1,61 @@
function appOnlineCodesProductManagment() {
}
appOnlineCodesProductManagment.updateForm = function updateForm(value, data) {
stPrice.updateField('online_codes_product_code', data.c);
stPrice.updateField('online_codes_product_name', data.n);
stPrice.updateField('online_codes_product_id', data.id);
}
jQuery(function($) {
appOnlineCodesProductManagment.fnFormatResult = function(value, data, currentValue) {
var pattern = '(' + currentValue.replace($.fn.autocomplete.escapePattern, '\\$1') + ')';
var name = data.c + ': ' + data.n;
name = name.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
var template = $('#app_online_codes-autocomplete-template');
template.find('h2').html(name);
template.find('.price_netto').html(stPrice.round(data.pn));
template.find('.price_brutto').html(stPrice.round(data.pb));
template.find('img').attr('src', data.ip);
return template.html();
}
});
function appOnlineFilesProductManagment() {
}
appOnlineFilesProductManagment.updateForm = function updateForm(value, data) {
stPrice.updateField('online_files_product_code', data.c);
stPrice.updateField('online_files_product_name', data.n);
stPrice.updateField('online_files_product_id', data.id);
}
jQuery(function($) {
appOnlineFilesProductManagment.fnFormatResult = function(value, data, currentValue) {
var pattern = '(' + currentValue.replace($.fn.autocomplete.escapePattern, '\\$1') + ')';
var name = data.c + ': ' + data.n;
name = name.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
var template = $('#app_online_codes-autocomplete-template');
template.find('h2').html(name);
template.find('.price_netto').html(stPrice.round(data.pn));
template.find('.price_brutto').html(stPrice.round(data.pb));
template.find('img').attr('src', data.ip);
return template.html();
}
});

132
web/js/backend/backend.js Normal file
View File

@@ -0,0 +1,132 @@
jQuery(function ($) {
$(document).ready(function () {
let preloader = $('#preloader-dialog').overlay({
speed: 0,
load: false,
mask: {
color: '#444',
loadSpeed: 0,
closeSpeed: 0,
opacity: 0.5,
zIndex: 200000,
},
closeOnClick: false,
closeOnEsc: false,
onLoad: function () {
let content = this.getOverlay().find('.content');
this.getOverlay().find('.close').hide();
content.html('<p>'+this.getOverlay().data('busy-message')+'<\/p><div class="preloader_48x48">&nbsp;<\/div>');
},
onBeforeLoad: function () {
preloader.data('preloader_is_open', true);
},
onClose: function () {
preloader.data('preloader_is_open', false);
}
});
$.preloader = {
show: function () {
let api = preloader.data('overlay');
if (!preloader.data('preloader_is_open')) {
api.load();
}
},
hide: function () {
let api = preloader.data('overlay');
if (preloader.data('preloader_is_open')) {
api.close();
}
},
toggle: function () {
let api = preloader.data('overlay');
if (preloader.data('preloader_is_open')) {
api.close();
} else {
api.load();
}
},
update: function (content) {
let api = preloader.data('overlay');
if (content === undefined) {
throw 'The "content" parameter is required';
}
api.getOverlay().find('.close').show();
api.getOverlay().find('.content').html(content);
}
}
$.fn.selectBox = function (action) {
switch (action) {
case "update":
this.chosen('destroy').chosen();
break;
case "destroy":
this.chosen('destroy');
break;
default:
let selects = this.not('.flatpickr-monthDropdown-months');
selects.chosen({
disable_search_threshold: 5,
placeholder_text: " "
}).on('chosen:showing_dropdown', function (event, params) {
let chosen_container = $(event.target).next('.chosen-container');
let dropdown = chosen_container.find('.chosen-drop');
let dropdown_top = dropdown.offset().top - $(window).scrollTop();
let dropdown_height = dropdown.height();
let viewport_height = $(window).height();
if (dropdown_top + dropdown_height > viewport_height) {
chosen_container.addClass('chosen-drop-up');
}
}).on('chosen:hiding_dropdown', function (event, params) {
$(event.target).next('.chosen-container').removeClass('chosen-drop-up');
}).on('chosen:update', function () {
$(this).selectBox('update');
}).on('chosen:destroy', function () {
$(this).selectBox('destroy');
});
break;
}
}
$(document).on('chosen:init', function (event, selector) {
$(selector).selectBox();
});
$.fn.truncateText = function () {
function updateStatus(entries) {
for (let entry of entries) {
console.log(entry.target.scrollHeight+' > '+entry.target.clientHeight);
if (entry.target.scrollHeight > entry.target.clientHeight) {
entry.target.parentElement.classList.add('expandable');
} else {
entry.target.parentElement.classList.remove('expandable');
}
}
}
const observer = new ResizeObserver(updateStatus);
this.on('click', '.button', function () {
const button = $(this);
button.closest('.truncate-text').toggleClass('expanded');
return false;
});
this.each(function () {
observer.observe($(this).find('.truncate-text-container').get(0));
});
}
$('select').selectBox();
$('.truncate-text.expandable').truncateText();
});
});

15
web/js/backend/chart.bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

7
web/js/backend/chart.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
web/js/backend/d3.v4.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,64 @@
function initializeDropdownMenu(target, callback) {
target = jQuery(target);
target.find('.action').click(callback);
/*
target.hover(function() {
jQuery(this).children('ul').show();
}, function() {
jQuery(this).children('ul').hide();
});*/
return target;
}
function stopGadgetRefresh(gadget) {
var timer = gadget.data('refresh_timer');
if (timer) {
clearInterval(timer);
gadget.data('refresh_timer', null);
}
}
function initGadgetRefresh(gadget, refresh_by) {
stopGadgetRefresh(gadget);
var updateGadget = function() {
refreshGadgets(gadget);
var timer = self.setTimeout(updateGadget, refresh_by);
gadget.data('refresh_timer', timer);
}
var timer = self.setTimeout(updateGadget, refresh_by);
gadget.data('refresh_timer', timer);
}
function refreshGadgets(gadget, refresh) {
var content = gadget.children('.content');
if (content.length) {
if (refresh == undefined) {
refresh = true;
}
var iframe = content.children('iframe');
if (iframe.attr('src').charAt(0) == '/') {
iframe.css({
visibility: 'hidden'
});
content.addClass('preloader_160x24');
var src = iframe.attr('src');
if (refresh) {
date = new Date();
src = src.replace(/refreshed_at=[0-9]+/, 'refreshed_at='+Math.floor(date.getTime() / 1000));
}
iframe.attr('src', src);
}
}
}

10
web/js/backend/jquery-ui.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,121 @@
/*!
* jQuery YouTube Popup Player Plugin v2.1
* http://lab.abhinayrathore.com/jquery_youtube/
* Last Updated: May 23 2012
*/
(function ($) {
var YouTubeDialog = null;
var methods = {
//initialize plugin
init: function (options) {
options = $.extend({}, $.fn.YouTubePopup.defaults, options);
// initialize YouTube Player Dialog
if (YouTubeDialog == null) {
YouTubeDialog = $('<div></div>').css({ display: 'none', padding: 0 });
$(options.container).append(YouTubeDialog);
YouTubeDialog.dialog({ autoOpen: false, resizable: false, draggable: options.draggable, modal: options.modal, appendTo: options.container,
close: function () {
YouTubeDialog.html('');
$(".ui-dialog-titlebar").show();
}
});
}
return this.each(function () {
var obj = $(this);
var data = obj.data('YouTube');
if (!data) { //check if event is already assigned
obj.data('YouTube', { target: obj, 'active': true });
$(obj).bind('click.YouTubePopup', function () {
var youtubeId = options.youtubeId;
if ($.trim(youtubeId) == '') youtubeId = obj.attr(options.idAttribute);
var videoTitle = $.trim(options.title);
if (videoTitle == '') {
if (options.useYouTubeTitle) setYouTubeTitle(youtubeId);
else videoTitle = obj.attr('title');
}
//Format YouTube URL
var YouTubeURL = "http://www.youtube.com/embed/" + youtubeId + "?rel=0&showsearch=0&autohide=" + options.autohide;
YouTubeURL += "&autoplay=" + options.autoplay + "&color1=" + options.color1 + "&color2=" + options.color2;
YouTubeURL += "&controls=" + options.controls + "&fs=" + options.fullscreen + "&loop=" + options.loop;
YouTubeURL += "&hd=" + options.hd + "&showinfo=" + options.showinfo + "&color=" + options.color + "&theme=" + options.theme;
//Setup YouTube Dialog
YouTubeDialog.html(getYouTubePlayer(YouTubeURL, options.width, options.height));
YouTubeDialog.dialog({ 'width': 'auto', 'height': 'auto' }); //reset width and height
YouTubeDialog.dialog({ 'minWidth': options.width, 'minHeight': options.height, title: videoTitle });
YouTubeDialog.dialog('open');
$(".ui-widget-overlay").fadeTo('fast', options.overlayOpacity); //set Overlay opacity
if(options.hideTitleBar && options.modal){ //hide Title Bar (only if Modal is enabled)
$(".ui-dialog-titlebar").hide(); //hide Title Bar
$(".ui-widget-overlay").click(function () { YouTubeDialog.dialog("close"); }); //automatically assign Click event to overlay
}
if(options.clickOutsideClose && options.modal){ //assign clickOutsideClose event only if Modal option is enabled
$(".ui-widget-overlay").click(function () { YouTubeDialog.dialog("close"); }); //assign Click event to overlay
}
return false;
});
}
});
},
destroy: function () {
return this.each(function () {
$(this).unbind(".YouTubePopup");
$(this).removeData('YouTube');
});
}
};
function getYouTubePlayer(URL, width, height) {
var YouTubePlayer = '<iframe title="YouTube video player" style="margin:0; padding:0;" width="' + width + '" ';
YouTubePlayer += 'height="' + height + '" src="' + URL + '" frameborder="0" allowfullscreen></iframe>';
return YouTubePlayer;
}
function setYouTubeTitle(id) {
var url = "https://gdata.youtube.com/feeds/api/videos/" + id + "?v=2&alt=json";
$.ajax({ url: url, dataType: 'jsonp', cache: true, success: function(data){ YouTubeDialog.dialog({ title: data.entry.title.$t }); } });
}
$.fn.YouTubePopup = function (method) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.YouTubePopup');
}
};
//default configuration
$.fn.YouTubePopup.defaults = {
'youtubeId': '',
'title': '',
'useYouTubeTitle': true,
'idAttribute': 'rel',
'draggable': false,
'modal': true,
'width': 640,
'height': 480,
'hideTitleBar': false,
'clickOutsideClose': false,
'overlayOpacity': 0.5,
'autohide': 2,
'autoplay': 1,
'color': 'red',
'color1': 'FFFFFF',
'color2': 'FFFFFF',
'controls': 1,
'fullscreen': 1,
'loop': 0,
'hd': 1,
'showinfo': 0,
'theme': 'light',
'container': 'body'
};
})(jQuery);

View File

@@ -0,0 +1,101 @@
document.observe('dom:loaded', function() {
if ($('config_hide_root').checked)
{
var config_expand_root = $('config_expand_root');
config_expand_root.options[0].disabled = true;
if (config_expand_root.selectedIndex == 0)
{
config_expand_root.selectedIndex = 1;
}
$('config_expand_always').disabled = $('config_tree_type').selectedIndex > 0;
}
else
{
$('config_expand_always').disabled = $('config_expand_root').selectedIndex == 0;
}
if ($('config_tree_type').selectedIndex > 0)
{
$$('#config_expand_root option').each(function(o) {
if (o.index > 1)
{
o.disabled = true;
}
});
}
else
{
$$('#config_expand_root option').each(function(o) {
if (o.index > 1)
{
o.disabled = false;
}
});
}
$('config_hide_root').observe('click', function()
{
var config_expand_root = $('config_expand_root');
if (this.checked)
{
config_expand_root.options[0].disabled = true;
if (config_expand_root.selectedIndex == 0)
{
config_expand_root.selectedIndex = 1;
}
$('config_expand_always').disabled = $('config_tree_type').selectedIndex > 0;
}
else
{
config_expand_root.options[0].disabled = false;
$('config_expand_always').disabled = false;
}
});
$('config_tree_type').observe('change', function() {
var config_expand_root = $('config_expand_root');
if (this.selectedIndex > 0)
{
$$('#config_expand_root option').each(function(o) {
if (o.index > 1)
{
o.disabled = true;
}
});
if (config_expand_root.selectedIndex > 1)
{
config_expand_root.selectedIndex = 1;
}
$('config_expand_always').disabled = $('config_hide_root').checked || config_expand_root.selectedIndex == 0;
}
else
{
$$('#config_expand_root option').each(function(o) {
if (o.index > 1)
{
o.disabled = false;
}
});
$('config_expand_always').disabled = config_expand_root.selectedIndex == 0;
}
});
$('config_expand_root').observe('change', function()
{
$('config_expand_always').disabled = $('config_expand_root').selectedIndex == 0;
});
});

259
web/js/backend/stOrder.js Normal file
View File

@@ -0,0 +1,259 @@
function stOrderPriceModifiers() { }
stOrderPriceModifiers.params = {};
function stOrderProductPriceManagment(fields, updateCallback)
{
function updateTotalAmount()
{
stOrderProductPriceManagment.updateTotalAmount(fields);
if (updateCallback) {
updateCallback(fields);
}
}
jQuery(fields.discount).on('change', function() {
var input = jQuery(this);
if (input.next('select').val() == '%') {
this.value = stPrice.fixNumberFormat(this.value, 1);
if (this.value > 99) {
this.value = 99;
}
} else {
this.value = stPrice.fixNumberFormat(this.value, 0);
}
updateTotalAmount();
});
jQuery(fields.quantity).on('change', function() {
this.value = stPrice.fixNumberFormat(this.value);
updateTotalAmount();
});
jQuery(fields.discount_type).on('change', function() {
var select = jQuery(this);
select.prev('input').change();
updateTotalAmount();
});
return new stPriceTaxManagment({
taxValues: stOrderProductPriceManagment.params.taxValues,
taxField: jQuery(fields.tax).attr('id'),
onChange: updateTotalAmount,
priceFields: [{
price: jQuery(fields.price_netto).attr('id'),
priceWithTax: jQuery(fields.price_brutto).attr('id')
}]
});
}
jQuery(function($) {
stOrderProductPriceManagment.updateProductForm = function updateProductForm(value, data)
{
$('#code').val(data.c);
$('#name').val(data.n);
$('#price_netto').val(stPrice.round(data.pn));
$('#tax option').each(function() {
if (this.value == data.t) {
this.selected = true
}
});
$('#price_brutto').val(stPrice.round(data.pb));
// $('hidden_data').value = Object.toJSON(data.hd);
stOrderProductPriceManagment.updateTotalAmount({
price_brutto: '#price_brutto',
discount: '#discount',
quantity: '#quantity',
total_amount: '#total_amount',
discount_type: '#discount_type',
tax: '#tax',
price_brutto_discount: '#price_brutto_discount'
});
}
stOrderProductPriceManagment.updateTotalAmount = function(fields)
{
var tax_index = $(fields.tax).get(0).selectedIndex;
var tax_value = stOrderProductPriceManagment.params.taxValues[tax_index];
var discount_type_field = $(fields.discount_type).get(0);
if (discount_type_field.options[discount_type_field.selectedIndex].value == '%') {
var price_value = stPrice.applyDiscount($(fields.price_brutto).val(), $(fields.discount).val());
} else {
var price_value = $(fields.price_brutto).val() - $(fields.discount).val();
if (price_value < 0) {
price_value = 0;
$(fields.discount).val(Math.round($(fields.price_brutto).val()));
}
}
$(fields.price_brutto_discount).val(price_value);
$(fields.total_amount).val(stPrice.round(price_value * $(fields.quantity).val()));
}
stOrderProductPriceManagment.fnFormatResult = function(value, data, currentValue)
{
var pattern = '(' + currentValue.replace($.fn.autocomplete.escapePattern, '\\$1') + ')';
var name = data.c+': '+data.n;
// if (data.hd.pm.length)
// {
// var option_label = '';
//
// $.each(data.hd.pm, function()
// {
// option_label += ', '+this.label;
// });
//
// name += ' ['+option_label.substr(2)+']';
// }
name = name.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
var template = $('#st_order-autocomplete-template');
template.find('h2').html(name);
template.find('.price_netto').html(stPrice.round(data.pn));
template.find('.price_brutto').html(stPrice.round(data.pb));
template.find('img').attr('src', data.ip);
return template.html();
}
stOrderProductPriceManagment.getPriceModifiersLabel = function(price_modifiers)
{
var option_label = '';
$.each(price_modifiers, function()
{
option_label += ', '+this.label;
});
return option_label.substr(2);
}
stOrderPriceModifiers.show = function(target)
{
var hidden_data = target.parents('tr').find('.hidden_data').val().evalJSON(true);
var url = stOrderPriceModifiers.params.url+'?id='+hidden_data.id+'&ids='+hidden_data.pm.map(function(data) { return data.custom.id }).join('-');
var container = target.data('container');
if (container == undefined)
{
$.getJSON(url, function(data) {
container = stOrderPriceModifiers.createContainer(data.data);
container.appendTo(target.parent('div'));
target.data('container', container);
});
}
else
{
container.show();
}
}
stOrderPriceModifiers.update = function()
{
var container = $(this).parent('div');
var values = container.find('select').serializeArray();
var hidden_data_field = $(this).parents('tr').find('.hidden_data');
var hidden_data = hidden_data_field.val().evalJSON(true);
var ids = $.map(values, function(data) {return data.value});
var url = stOrderPriceModifiers.params.url+'?id='+hidden_data.id+'&ids='+ids.join('-');
$.getJSON(url, function(data) {
var parent = container.parent('div');
container.remove();
container = stOrderPriceModifiers.createContainer(data.data);
container.appendTo(parent);
parent.find('a').data('container', container);
});
}
stOrderPriceModifiers.hide = function(target)
{
var container = target.data('container');
if (container)
{
container.hide();
}
}
stOrderPriceModifiers.createContainer = function(data)
{
container = $('<div></div>');
$.each(data, function(index) {
var current = this;
container.append($('<p>'+this.field+'</p>'));
var select = $('<select name="price_modifier['+index+']"></select>');
$.each(current.data, function(index){
var option = $('<option value="'+index+'">'+this+'</option>');
if (current.selected == index)
{
option.attr('selected', 'selected');
}
select.append(option)
});
select.change(stOrderPriceModifiers.update);
container.append(select);
});
return container;
}
});
stOrderProductPriceManagment.setParams = function(params)
{
stOrderProductPriceManagment.params = params;
}

View File

@@ -0,0 +1,176 @@
jQuery(function ($) {
const shoppingCartDelivery = $('#shopping-cart-delivery');
const deliveryModal = $('#delivery-modal');
const deliveryMessageModal = $('#delivery-message-modal');
const deliveryCountry = $('#delivery-country');
let selectedDelivery = shoppingCartDelivery.find('.delivery-radio:checked');
let selectedCountryId = deliveryCountry.val();
let userAuthenticated = false;
function selectedPickupPointUpdate(pickupPointContainer, pickupPoint) {
const selectedPickupPoint = pickupPointContainer.find('.selected-pickup-point');
if (pickupPoint) {
selectedPickupPoint.find('.name').html(pickupPoint.name);
selectedPickupPoint.find('.address').html(pickupPoint.address);
selectedPickupPoint.find('.post-code').html(pickupPoint.postCode);
selectedPickupPoint.find('.city').html(pickupPoint.city);
selectedPickupPoint.show();
} else {
selectedPickupPoint.hide();
}
}
function onChangeDeliveryHandle() {
selectedDelivery = $(this);
const orderFormDelivery = $('#order_form_delivery');
const differentDelivery = $('#different_delivery');
shoppingCartDelivery.find('.selected-pickup-point').hide();
if (selectedDelivery.data('delivery-pickup-point')) {
const pickupPoint = $.deliveryPickupPoint.get();
const pickupPointContainer = selectedDelivery.closest('label').find('.delivery-pickup-point-container');
selectedPickupPointUpdate(pickupPointContainer, pickupPoint); console.log(pickupPoint );
$('#delivery_pickup_point').val(JSON.stringify(pickupPoint));
orderFormDelivery.hide();
if (differentDelivery.prop('checked')) {
differentDelivery.get(0).click();
}
differentDelivery.prop('disabled', true);
} else {
if (userAuthenticated) {
orderFormDelivery.show();
}
differentDelivery.prop('disabled', false);
}
$(window).trigger('resize');
}
$.initBasketDeliveryList = function(isUserAuthenticated) {
userAuthenticated = isUserAuthenticated;
onChangeDeliveryHandle.call(shoppingCartDelivery.find('.delivery-radio:checked'));
}
$.deliveryModal = {
showPreloader: () => {
deliveryModal.find('.preloader').show();
},
hidePreloader: () => {
deliveryModal.find('.preloader').hide();
},
show: () => {
deliveryModal.modal('show');
},
hide: () => {
deliveryModal.modal('hide');
},
updateContent: (content) => {
deliveryModal.find('.modal-body-content').html(content);
}
}
$.deliveryMessageModal = {
show: (message) => {
deliveryMessageModal.find('.modal-body').html(message);
deliveryMessageModal.modal('show');
},
showError: (message) => {
$.deliveryMessageModal.show('<div class="has-error"><div class="help-block">' + message + '</div></div>');
}
}
$.delivery = {
updatePickupPoint: (pickupPointId, pickupPointName, pickupPointAddress, pickupPointPostCode, pickupPointCity, pickupCountryCode, pickupPointCod, pickupWeekend, custom) => {
$.deliveryPickupPoint.set(pickupPointId, pickupPointName, pickupPointAddress, pickupPointPostCode, pickupPointCity, pickupCountryCode, pickupPointCod, pickupWeekend, custom);
if (!selectedDelivery.prop('checked')) {
selectedDelivery.prop('checked', true).change();
} else {
const pickupPointContainer = selectedDelivery.closest('label').find('.delivery-pickup-point-container');
const pickupPoint = $.deliveryPickupPoint.get();
selectedPickupPointUpdate(pickupPointContainer, pickupPoint);
$(window).trigger('resize');
}
}
}
$.deliveryPickupPoint = {
set: (id, name, address, postCode, city, countryCode, cod, weekend, custom) => {
const point = {
id: id,
name: name,
address: address,
postCode: postCode,
city: city,
countryCode: countryCode,
cod: cod,
weekend: weekend,
custom: custom,
};
point.name = 'Paczkomat - ' + point.name;
const jsonPoint = JSON.stringify(point);
$('#delivery_pickup_point').val(jsonPoint);
window.localStorage.setItem($.deliveryPickupPoint.getPointNamespace(), jsonPoint);
$('#delivery-modal').modal('hide');
},
get: () => {
const value = window.localStorage.getItem($.deliveryPickupPoint.getPointNamespace());
return value ? JSON.parse(value) : undefined;
},
getPointNamespace: () => {
return 'delivery_pickup_point.' + selectedDelivery.data('delivery-type') + '.' + selectedCountryId
}
}
shoppingCartDelivery.on('change', '#delivery-country', function() {
selectedCountryId = $(this).val();
});
deliveryModal
.on('show.bs.modal', function (event) {
const modal = $(this);
const trigger = $(event.relatedTarget);
selectedDelivery = trigger.closest('.radio').find('.delivery-radio');
const selectedPayment = $('#shopping-cart-payment .radio input[type=radio]:checked');
const pickupPoint = $.deliveryPickupPoint.get(selectedDelivery.data('delivery-type'));
const parameters = {
id: selectedDelivery.val(),
cod: selectedPayment.data('payment-cod'),
country_id: selectedCountryId,
pickup_point: pickupPoint,
};
$.post(modal.data('action'), parameters, function (response) {
$.deliveryModal.updateContent(response);
$.deliveryModal.hidePreloader();
});
modal.find('.modal-title').html(selectedDelivery.data('delivery-name'));
}).on('hide.bs.modal', function () {
$.deliveryModal.showPreloader();
}).on('hidden.bs.modal', function () {
$.deliveryModal.updateContent('');
});
deliveryMessageModal.on('show.bs.modal', function (event) {
deliveryMessageModal.find('.modal-title').html(selectedDelivery.data('delivery-name'));
});
shoppingCartDelivery.on('change', '.delivery-radio', onChangeDeliveryHandle);
if (deliveryMessageModal.data('show-error').length > 0) {
$.deliveryMessageModal.showError(deliveryMessageModal.data('show-error'));
}
shoppingCartDelivery.find('[data-toggle=tooltip]').tooltip({ html: true, trigger: 'click hover focus', delay: { show: 100, hide: 0 } });
});

7
web/js/bloodhund.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(function(b,a,c){var d=b();b.fn.dropdownHover=function(e){if("ontouchstart" in document){return this}d=d.add(this.parent());return this.each(function(){var m=b(this),l=m.parent(),k={instantlyCloseOthers:true},i={instantlyCloseOthers:b(this).data("close-others")},g="show.bs.dropdown",j="hide.bs.dropdown",h=b.extend(true,{},k,e,i);l.hover(function(n){if(!l.hasClass("open")&&!m.is(n.target)){return true}f(n)},function(){l.removeClass("open");m.trigger(j)});m.hover(function(n){if(!l.hasClass("open")&&!l.is(n.target)){return true}f(n)});l.find(".dropdown-submenu").each(function(){var n=b(this);n.hover(function(){n.children(".dropdown-menu").show();n.siblings().children(".dropdown-menu").hide()},function(){var o=n.children(".dropdown-menu");o.hide()})});function f(n){d.find(":focus").blur();if(h.instantlyCloseOthers===true){d.removeClass("open")}l.addClass("open");m.trigger(g)}})};b(document).ready(function(){b('[data-hover="dropdown"]').dropdownHover()})})(jQuery,this);

29
web/js/bootstrap-slider.min.js vendored Normal file

File diff suppressed because one or more lines are too long

164
web/js/bootstrap-typeahead.js vendored Normal file
View File

@@ -0,0 +1,164 @@
jQuery(function($) {
$.fn.typeahead = function(options) {
var ignoreKeys = [9, 27, 37, 39, 13, 38, 40];
var defaults = {
trigger: {
hide: 'body',
show: 'focus'
},
hidePopupIfEmpty: false,
minLength: 3,
template: function(suggestions) {
var content = '';
for (var i = 0; i < suggestions.length; i++) {
content += '<li>'+suggestions[i].name+'</li>';
}
return content;
},
messages: {
noresults: "No results"
}
};
options = $.extend(defaults, options);
var $this = this;
this.each(function() {
var input = $(this);
if (!input.hasClass('bootstrap-typeahead'))
{
input.addClass('bootstrap-typeahead');
var content = '';
var allowHide = true;
function search()
{
if (input.val().length >= options.minLength) {
content = '';
input.addClass('bootstrap-typeahead-preloader');
options.source(input.val(), function(suggestions) {
if (suggestions.length) {
content = options.template.call($this, suggestions);
} else {
content = '';
}
input.removeClass('bootstrap-typeahead-preloader');
if (!content.length && false !== options.messages.noresults || content.length) {
input.popover('show');
} else {
input.popover('hide');
}
});
}
}
var popoverOptions = {
'html': true,
'placement': 'bottom',
'trigger': 'manual',
'template': '<div class="popover typeahead-popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>',
'content': function() {
if (content.length == 0) {
return '<ul class="list-unstyled"><li>'+options.messages.noresults+'</li></ul>';
}
return '<ul class="list-unstyled">'+content+'</ul>';
}
};
if (options.viewport) {
if (options.viewport.selector) {
popoverOptions.container = options.viewport.selector;
}
popoverOptions.viewport = options.viewport;
}
input.popover(popoverOptions);
input.on('shown.bs.popover', function() {
var id = $(this).attr('aria-describedby');
$('#'+id).one('click', 'li[data-url]', function() {
window.location = $(this).data('url');
return false;
}).on('mouseleave', function() {
allowHide = true;
}).on('mouseenter', function() {
allowHide = false;
});
});
if (options.trigger.hide == 'body') {
$('body').on('mouseup', function(e) {
if (allowHide) {
input.popover("hide");
}
});
input.on('mouseleave', function() {
allowHide = true;
}).on('mouseenter', function() {
allowHide = false;
});
}
input.keyup(function(e) {
var key = e.which || e.keyCode;
if (ignoreKeys.indexOf(key) < 0) {
search();
}
});
if (options.trigger.show != 'manual') {
input.on(options.trigger.show, function() {
if (input.val().length >= options.minLength) {
search();
} else {
input.popover('hide');
}
});
}
if (options.trigger.hide != 'manual' && options.trigger.hide != 'body') {
input.on(options.trigger.hide, function() {
input.popover('hide');
});
}
}
});
var resized = false;
$(window).resize(function() {
resized = true;
});
var $this = this;
function update() {
if (resized) {
$this.each(function() {
var input = $(this);
if (input.attr('aria-describedby')) {
if (options.trigger.hide != 'manual') {
input.trigger(options.trigger.hide);
} else {
input.popover('hide');
}
}
});
resized = false;
}
}
setInterval(update, 200);
}
});

149
web/js/calendar.js Normal file
View File

@@ -0,0 +1,149 @@
/*!
* jQuery UI 1.8.14
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI
*/
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();
b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,
"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",
function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,
outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);
return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=
0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
* jQuery UI Widget 1.8.14
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Widget
*/
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
* jQuery UI Mouse 1.8.14
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Mouse
*
* Depends:
* jquery.ui.widget.js
*/
(function(b){var d=false;b(document).mousedown(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==
false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
* jQuery UI Position 1.8.14
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Position
*/
(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
;/*
* jQuery UI Datepicker 1.8.14
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker
*
* Depends:
* jquery.ui.core.js
*/
(function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",function(b){b=
d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b.addClass("ui-state-hover");
b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.14"}});var A=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){H(this._defaults,
a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,
selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=
h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=
this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,
"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",
function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);
a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",
this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",
this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=
b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",
cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},
_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,
"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,
b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);
c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);
c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||
a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=
d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);
d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=
d.datepicker._get(b,"beforeShow");H(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c=
{left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");
if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);
J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");
a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||
c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+
i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=
this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",
left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&
d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=
b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=
!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);
a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));
d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%
100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=B+1<a.length&&a.charAt(B+1)==p)&&B++;return p},m=function(p){var D=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=
p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=function(){if(b.charAt(q)!=a.charAt(B))throw"Unexpected literal at position "+q;q++},q=0,B=0;B<a.length;B++)if(k)if(a.charAt(B)=="'"&&!o("'"))k=false;
else s();else switch(a.charAt(B)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);
if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",
TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<
n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,
c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+=
"0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=
f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=
(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,
l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=
a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),
b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=
this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+
(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+
(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+A+'.datepicker._hideDatepicker();">'+this._get(a,
"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),B=
this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O="";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":
"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,B,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":
"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+
this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+
this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+A+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+
r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),
l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+A+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+A+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+
n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):
g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+A+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+A+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c==
"Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");
if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,
[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.14";window["DP_jQuery_"+A]=d})(jQuery);
;

36
web/js/carousel.js Normal file
View File

@@ -0,0 +1,36 @@
$(function () {
module("TouchCarousel")
// Touch detection tests
// https://code.google.com/p/phantomjs/issues/detail?id=375
// console.log( "ontouchstart" in window ? true: false); // return true in PhantomJS
test("Should run plugin because touchevents are enabled", function() {
var hasTouchEvents = ("ontouchstart" in window || navigator.msMaxTouchPoints) ? true : false;
equal(hasTouchEvents, true, "touch events should be enabled")
ok(typeof $(document.body).carousel().data('touch-carousel') === "object", "TouchCarousel Plugin is running")
})
test("should be defined on jquery object", function () {
ok($(document.body).carousel, 'carousel method is defined')
})
test("should return element", function () {
ok($(document.body).carousel()[0] == document.body, 'document.body returned')
})
test("should overwrite default carousel", function () {
ok(typeof $(document.body).carousel().data('touch-carousel') === "object", '"object" TouchCarousel returned')
})
test("hammer.js should be defined", function () {
ok(typeof window.Hammer === "function", '"function" Hammer returned')
})
//test("should not handle gestures if its currently sliding", 0, function () {
// // @todo: apply tests
//})
// @todo: test touch gestures & event handler
})

105
web/js/dropMenu/image.js Normal file
View File

@@ -0,0 +1,105 @@
function getValue(obj)
{
var testIE = new RegExp("Microsoft Internet Explorer");
var browserType = navigator.appName;
if(testIE.test(browserType)==true)
{
var checkIE = 1;
}
else
{
var checkIE = 0;
}
var checkEdit = new RegExp("frontend_edit");
//sprawdza czy aktualne środowisko pozwala na edycje
if(checkEdit.test(document.location.href)==true)
{
//pobiera Id elementu
var elementId = obj.id;
//zlicza ilość załączonych arkuszy styli css
var countStyleSheets = document.styleSheets.length-1
for (i=0; i<=countStyleSheets; i++)
{
//zlicza ilość definicji styli css
if(checkIE == 1)
{
var countElementsCss = document.styleSheets[i].rules.length-1;
}
else
{
var countElementsCss = document.styleSheets[i].cssRules.length-1;
}
for (ii=0; ii<=countElementsCss; ii++)
{
//pobiera konkretną definicję w stylach
if(checkIE == 1)
{
var elementCss = document.styleSheets[i].rules[ii].selectorText;
}
else
{
var elementCss = document.styleSheets[i].cssRules[ii].cssText;
}
//sprawdza czy występuje Id
if(checkIE == 1)
{
var searchElement = new RegExp("#"+elementId);
}
else
{
var searchElement = new RegExp("#" + elementId + " ");
}
if(searchElement.test(elementCss)==true)
{
//pobierz nazwę obrazka ze stylu
if(checkIE == 1)
{
var image = document.styleSheets[i].rules[ii].style.backgroundImage;
}
else
{
var image = document.styleSheets[i].cssRules[ii].style.backgroundImage;
}
var srcCss = document.styleSheets[i].href;
var pathImage = image.split("(");
var image = pathImage[1].split(")");
var srcImage = image[0];
var objectCssId = elementCss.split("{");
var objectCssId = objectCssId[0];
var imageName = srcImage.slice(srcImage.lastIndexOf("/")+1);
//przkazuje wartości do tablicy ktróre następnie lecą w linku
var elements = new Array(5);
elements[0] = escape(elementId);
elements[1] = escape(objectCssId);
elements[2] = escape(srcCss);
elements[3] = escape(srcImage);
elements[4] = escape(imageName);
editPopup = window.open ("/frontend_edit.php/stThemeFrontend/changeImage?element="+ elements,"Name", 'titlebar=no, menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no, width=560, height=300, left=230, top=230');
editPopup.focus();
}
}
}
}
}

108
web/js/dropMenu/portal.js Normal file
View File

@@ -0,0 +1,108 @@
var Portal = Class.create();
Portal.prototype = {
initialize: function (options) {
this.setOptions(options);
var sortables = $$(
'.'+this.options.column, '#' + this.options.portal
);
sortables.each(function (sortable) {
Sortable.create(sortable, {
containment: sortables,
constraint: false,
tag: 'div',
only: this.options.block,
dropOnEmpty: true,
handle: this.options.handle,
hoverclass: this.options.hoverclass,
onUpdate: function (container) {
if (!this.options.saveurl) {
return;
}
if (container.id == this.options.blocklist) {
return;
}
var url = this.options.saveurl;
var postBody = container.id + ':';
var blocks = container.select('.'+this.options.block);
postBody += blocks.pluck('id').join(',');
postBody = 'value=' + escape(postBody);
new Ajax.Request(url, {
method: 'post',
postBody: postBody
}
);
}.bind(this)
});
}.bind(this));
var blocks = $$(
'.' + this.options.block, '#' + this.options.portal
);
Event.observe(
this.options.blocklistlink, 'click',
this.displayBlockList.bindAsEventListener(this),
false
);
new Draggable(this.options.blocklist, {
handle: this.options.blocklisthandle
}
);
},
displayBlockList: function (e) {
Effect.toggle(this.options.blocklist);
Event.stop(e);
},
setOptions: function (options) {
this.options = {
portal: 'portal',
column: 'portal-column',
block: 'block',
content: 'content',
handle: 'handle',
hoverclass: 'block-hover',
toggle: 'block-toggle',
blocklist: 'portal-column-block-list',
blocklistlink: 'portal-block-list-link',
blocklisthandle: 'block-list-handle',
saveurl: ''
}
Object.extend(this.options, options || {});
},
applySettings: function (settings)
{
for (var container in settings)
{
settings[container].each(function (block)
{
if(document.getElementById(container)!=null && document.getElementById(block)!=null)
{
$(container).appendChild($(block));
}
});
}
var frame = $("js_frame");
frame.style.display = "block";
var fastcache = $("fastcache");
if(fastcache){fastcache.style.display = "block";}
jQuery(frame).trigger('dropmenu:showlayout');
frame.fire('dropmenu:showlayout');
}
}

2006
web/js/dropMenu/prototype.js vendored Normal file

File diff suppressed because it is too large Load Diff

7
web/js/dropMenu/start.js Normal file
View File

@@ -0,0 +1,7 @@
var portal;
function init() {
portal = new Portal(options);
portal.applySettings(settings);
}
Event.observe(window, 'load', init, false);

141
web/js/easing.js Normal file
View File

@@ -0,0 +1,141 @@
/*
* jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
*
* Uses the built In easIng capabilities added In jQuery 1.1
* to offer multiple easIng options
*
* Copyright (c) 2007 George Smith
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.extend( jQuery.easing,
{
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});

View File

@@ -0,0 +1,719 @@
<?php
$config = include 'config/config.php';
//TODO switch to array
extract($config, EXTR_OVERWRITE);
require_once 'include/utils.php';
if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager")
{
response(trans('forbiden').AddErrorLocation())->send();
exit;
}
$languages = include 'lang/languages.php';
if (isset($_SESSION['RF']['language']) && file_exists('lang/' . basename($_SESSION['RF']['language']) . '.php'))
{
if(array_key_exists($_SESSION['RF']['language'],$languages)){
include 'lang/' . basename($_SESSION['RF']['language']) . '.php';
}else{
response(trans('Lang_Not_Found').AddErrorLocation())->send();
exit;
}
} else {
response(trans('Lang_Not_Found').AddErrorLocation())->send();
exit;
}
$ftp = ftp_con($config);
if(isset($_GET['action']))
{
switch($_GET['action'])
{
case 'new_file_form':
echo trans('Filename') . ': <input type="text" id="create_text_file_name" style="height:30px"> <select id="create_text_file_extension" style="margin:0;width:100px;">';
foreach($config['editable_text_file_exts'] as $ext){
echo '<option value=".'.$ext.'">.'.$ext.'</option>';
}
echo '</select><br><hr><textarea id="textfile_create_area" style="width:100%;height:150px;"></textarea>';
break;
case 'view':
if(isset($_GET['type']))
{
$_SESSION['RF']["view_type"] = $_GET['type'];
}
else
{
response(trans('view type number missing').AddErrorLocation())->send();
exit;
}
break;
case 'filter':
if (isset($_GET['type']))
{
if (isset($remember_text_filter) && $remember_text_filter)
{
$_SESSION['RF']["filter"] = $_GET['type'];
}
}
else {
response(trans('view type number missing').AddErrorLocation())->send();
exit;
}
break;
case 'sort':
if (isset($_GET['sort_by']))
{
$_SESSION['RF']["sort_by"] = $_GET['sort_by'];
}
if (isset($_GET['descending']))
{
$_SESSION['RF']["descending"] = $_GET['descending'];
}
break;
case 'image_size': // not used
$pos = strpos($_POST['path'], $upload_dir);
if ($pos !== false)
{
$info = getimagesize(substr_replace($_POST['path'], $current_path, $pos, strlen($upload_dir)));
response($info)->send();
exit;
}
break;
case 'save_img':
$info = pathinfo($_POST['name']);
if (
strpos($_POST['path'], '/') === 0
|| strpos($_POST['path'], '../') !== false
|| strpos($_POST['path'], '..\\') !== false
|| strpos($_POST['path'], './') === 0
|| (strpos($_POST['url'], 'http://s3.amazonaws.com/feather') !== 0 && strpos($_POST['url'], 'https://s3.amazonaws.com/feather') !== 0)
|| $_POST['name'] != fix_filename($_POST['name'], $config)
|| ! in_array(strtolower($info['extension']), array( 'jpg', 'jpeg', 'png' ))
)
{
response(trans('wrong data').AddErrorLocation())->send();
exit;
}
$image_data = get_file_by_url($_POST['url']);
if ($image_data === false)
{
response(trans('Aviary_No_Save').AddErrorLocation())->send();
exit;
}
if (!checkresultingsize(strlen($image_data))) {
response(sprintf(trans('max_size_reached'),$MaxSizeTotal).AddErrorLocation())->send();
exit;
}
if($ftp){
$temp = tempnam('/tmp','RF');
unlink($temp);
$temp .=".".substr(strrchr($_POST['url'],'.'),1);
file_put_contents($temp,$image_data);
$ftp->put($ftp_base_folder.$upload_dir . $_POST['path'] . $_POST['name'], $temp, FTP_BINARY);
create_img($temp,$temp,122,91);
$ftp->put($ftp_base_folder.$ftp_thumbs_dir. $_POST['path'] . $_POST['name'], $temp, FTP_BINARY);
unlink($temp);
}else{
file_put_contents($current_path . $_POST['path'] . $_POST['name'],$image_data);
create_img($current_path . $_POST['path'] . $_POST['name'], $thumbs_base_path.$_POST['path'].$_POST['name'], 122, 91);
// TODO something with this function cause its blowing my mind
new_thumbnails_creation(
$current_path.$_POST['path'],
$current_path.$_POST['path'].$_POST['name'],
$_POST['name'],
$current_path,
$relative_image_creation,
$relative_path_from_current_pos,
$relative_image_creation_name_to_prepend,
$relative_image_creation_name_to_append,
$relative_image_creation_width,
$relative_image_creation_height,
$relative_image_creation_option,
$fixed_image_creation,
$fixed_path_from_filemanager,
$fixed_image_creation_name_to_prepend,
$fixed_image_creation_to_append,
$fixed_image_creation_width,
$fixed_image_creation_height,
$fixed_image_creation_option
);
}
break;
case 'extract':
if ( strpos($_POST['path'], '/') === 0
|| strpos($_POST['path'], '../') !== false
|| strpos($_POST['path'], '..\\') !== false
|| strpos($_POST['path'], './') === 0)
{
response(trans('wrong path'.AddErrorLocation()))->send();
exit;
}
if($ftp){
$path = $ftp_base_url.$upload_dir . $_POST['path'];
$base_folder = $ftp_base_url.$upload_dir . fix_dirname($_POST['path']) . "/";
}else{
$path = $current_path . $_POST['path'];
$base_folder = $current_path . fix_dirname($_POST['path']) . "/";
}
$info = pathinfo($path);
if($ftp){
$tempDir = tempdir();
$temp = tempnam($tempDir,'RF');
unlink($temp);
$temp .=".".$info['extension'];
$handle = fopen($temp, "w");
fwrite($handle, file_get_contents($path));
fclose($handle);
$path = $temp;
$base_folder = $tempDir."/";
}
$info = pathinfo($path);
switch ($info['extension'])
{
case "zip":
$zip = new ZipArchive;
if ($zip->open($path) === true)
{
//get total size
$sizeTotalFinal = 0;
for ($i = 0; $i < $zip->numFiles; $i++)
{
$aStat = $zip->statIndex($i);
$sizeTotalFinal += $aStat['size'];
}
if (!checkresultingsize($sizeTotalFinal)) {
response(sprintf(trans('max_size_reached'),$MaxSizeTotal).AddErrorLocation())->send();
exit;
}
//make all the folders
for ($i = 0; $i < $zip->numFiles; $i++)
{
$OnlyFileName = $zip->getNameIndex($i);
$FullFileName = $zip->statIndex($i);
if (substr($FullFileName['name'], -1, 1) == "/")
{
create_folder($base_folder . $FullFileName['name']);
}
}
//unzip into the folders
for ($i = 0; $i < $zip->numFiles; $i++)
{
$OnlyFileName = $zip->getNameIndex($i);
$FullFileName = $zip->statIndex($i);
if ( ! (substr($FullFileName['name'], -1, 1) == "/"))
{
$fileinfo = pathinfo($OnlyFileName);
if (in_array(strtolower($fileinfo['extension']), $ext))
{
copy('zip://' . $path . '#' . $OnlyFileName, $base_folder . $FullFileName['name']);
}
}
}
$zip->close();
} else {
response(trans('Zip_No_Extract').AddErrorLocation())->send();
exit;
}
break;
case "gz":
// No resulting size pre-control available
$p = new PharData($path);
$p->decompress(); // creates files.tar
break;
case "tar":
// No resulting size pre-control available
// unarchive from the tar
$phar = new PharData($path);
$phar->decompressFiles();
$files = array();
check_files_extensions_on_phar($phar, $files, '', $ext);
$phar->extractTo($base_folder, $files, true);
break;
default:
response(trans('Zip_Invalid').AddErrorLocation())->send();
exit;
}
if($ftp){
unlink($path);
$ftp->putAll($base_folder, "/".$ftp_base_folder . $upload_dir . fix_dirname($_POST['path']), FTP_BINARY);
deleteDir($base_folder);
}
break;
case 'media_preview':
if($ftp){
$preview_file = $ftp_base_url.$upload_dir . $_GET['file'];
}else{
$preview_file = $current_path . $_GET["file"];
}
$info = pathinfo($preview_file);
ob_start();
?>
<div id="jp_container_1" class="jp-video " style="margin:0 auto;">
<div class="jp-type-single">
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div class="jp-gui">
<div class="jp-video-play">
<a href="javascript:;" class="jp-video-play-icon" tabindex="1">play</a>
</div>
<div class="jp-interface">
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
<div class="jp-controls-holder">
<ul class="jp-controls">
<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
</ul>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<ul class="jp-toggles">
<li><a href="javascript:;" class="jp-full-screen" tabindex="1" title="full screen">full screen</a></li>
<li><a href="javascript:;" class="jp-restore-screen" tabindex="1" title="restore screen">restore screen</a></li>
<li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
<li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
</ul>
</div>
<div class="jp-title" style="display:none;">
<ul>
<li></li>
</ul>
</div>
</div>
</div>
<div class="jp-no-solution">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="https://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
</div>
</div>
</div>
<?php if(in_array(strtolower($info['extension']), $ext_music)): ?>
<script type="text/javascript">
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
title:"<?php $_GET['title']; ?>",
mp3: "<?php echo $preview_file; ?>",
m4a: "<?php echo $preview_file; ?>",
oga: "<?php echo $preview_file; ?>",
wav: "<?php echo $preview_file; ?>"
});
},
swfPath: "js",
solution:"html,flash",
supplied: "mp3, m4a, midi, mid, oga,webma, ogg, wav",
smoothPlayBar: true,
keyEnabled: false
});
});
</script>
<?php elseif(in_array(strtolower($info['extension']), $ext_video)): ?>
<script type="text/javascript">
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
title:"<?php $_GET['title']; ?>",
m4v: "<?php echo $preview_file; ?>",
ogv: "<?php echo $preview_file; ?>",
flv: "<?php echo $preview_file; ?>"
});
},
swfPath: "js",
solution:"html,flash",
supplied: "mp4, m4v, ogv, flv, webmv, webm",
smoothPlayBar: true,
keyEnabled: false
});
});
</script>
<?php endif;
$content = ob_get_clean();
response($content)->send();
exit;
break;
case 'copy_cut':
if ($_POST['sub_action'] != 'copy' && $_POST['sub_action'] != 'cut')
{
response(trans('wrong sub-action').AddErrorLocation())->send();
exit;
}
if (strpos($_POST['path'],'../') !== FALSE
|| strpos($_POST['path'],'./') !== FALSE
|| strpos($_POST['path'],'..\\') !== FALSE
|| strpos($_POST['path'],'.\\') !== FALSE )
{
response(trans('wrong path'.AddErrorLocation()))->send();
exit;
}
if (trim($_POST['path']) == '')
{
response(trans('no path').AddErrorLocation())->send();
exit;
}
$msg_sub_action = ($_POST['sub_action'] == 'copy' ? trans('Copy') : trans('Cut'));
$path = $current_path . $_POST['path'];
if (is_dir($path))
{
// can't copy/cut dirs
if ($copy_cut_dirs === false)
{
response(sprintf(trans('Copy_Cut_Not_Allowed'), $msg_sub_action, trans('Folders')).AddErrorLocation())->send();
exit;
}
list($sizeFolderToCopy,$fileNum,$foldersCount) = folder_info($path,false);
// size over limit
if ($copy_cut_max_size !== false && is_int($copy_cut_max_size)) {
if (($copy_cut_max_size * 1024 * 1024) < $sizeFolderToCopy) {
response(sprintf(trans('Copy_Cut_Size_Limit'), $msg_sub_action, $copy_cut_max_size).AddErrorLocation())->send();
exit;
}
}
// file count over limit
if ($copy_cut_max_count !== false && is_int($copy_cut_max_count))
{
if ($copy_cut_max_count < $fileNum)
{
response(sprintf(trans('Copy_Cut_Count_Limit'), $msg_sub_action, $copy_cut_max_count).AddErrorLocation())->send();
exit;
}
}
if (!checkresultingsize($sizeFolderToCopy)) {
response(sprintf(trans('max_size_reached'),$MaxSizeTotal).AddErrorLocation())->send();
exit;
}
} else {
// can't copy/cut files
if ($copy_cut_files === false)
{
response(sprintf(trans('Copy_Cut_Not_Allowed'), $msg_sub_action, trans('Files')).AddErrorLocation())->send();
exit;
}
}
$_SESSION['RF']['clipboard']['path'] = $_POST['path'];
$_SESSION['RF']['clipboard_action'] = $_POST['sub_action'];
break;
case 'clear_clipboard':
$_SESSION['RF']['clipboard'] = null;
$_SESSION['RF']['clipboard_action'] = null;
break;
case 'chmod':
if($ftp){
$path = $ftp_base_url . $upload_dir . $_POST['path'];
if (
($_POST['folder']==1 && $chmod_dirs === false)
|| ($_POST['folder']==0 && $chmod_files === false)
|| (is_function_callable("chmod") === false) )
{
response(sprintf(trans('File_Permission_Not_Allowed'), (is_dir($path) ? trans('Folders') : trans('Files')), 403).AddErrorLocation())->send();
exit;
}
$info = $_POST['permissions'];
}else{
$path = $current_path . $_POST['path'];
if (
(is_dir($path) && $chmod_dirs === false)
|| (is_file($path) && $chmod_files === false)
|| (is_function_callable("chmod") === false) )
{
response(sprintf(trans('File_Permission_Not_Allowed'), (is_dir($path) ? trans('Folders') : trans('Files')), 403).AddErrorLocation())->send();
exit;
}
$perms = fileperms($path) & 0777;
$info = '-';
// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));
// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));
// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));
}
$ret = '<div id="files_permission_start">
<form id="chmod_form">
<table class="table file-perms-table">
<thead>
<tr>
<td></td>
<td>r&nbsp;&nbsp;</td>
<td>w&nbsp;&nbsp;</td>
<td>x&nbsp;&nbsp;</td>
</tr>
</thead>
<tbody>
<tr>
<td>'.trans('User').'</td>
<td><input id="u_4" type="checkbox" data-value="4" data-group="user" '.(substr($info, 1,1)=='r' ? " checked" : "").'></td>
<td><input id="u_2" type="checkbox" data-value="2" data-group="user" '.(substr($info, 2,1)=='w' ? " checked" : "").'></td>
<td><input id="u_1" type="checkbox" data-value="1" data-group="user" '.(substr($info, 3,1)=='x' ? " checked" : "").'></td>
</tr>
<tr>
<td>'.trans('Group').'</td>
<td><input id="g_4" type="checkbox" data-value="4" data-group="group" '.(substr($info, 4,1)=='r' ? " checked" : "").'></td>
<td><input id="g_2" type="checkbox" data-value="2" data-group="group" '.(substr($info, 5,1)=='w' ? " checked" : "").'></td>
<td><input id="g_1" type="checkbox" data-value="1" data-group="group" '.(substr($info, 6,1)=='x' ? " checked" : "").'></td>
</tr>
<tr>
<td>'.trans('All').'</td>
<td><input id="a_4" type="checkbox" data-value="4" data-group="all" '.(substr($info, 7,1)=='r' ? " checked" : "").'></td>
<td><input id="a_2" type="checkbox" data-value="2" data-group="all" '.(substr($info, 8,1)=='w' ? " checked" : "").'></td>
<td><input id="a_1" type="checkbox" data-value="1" data-group="all" '.(substr($info, 9,1)=='x' ? " checked" : "").'></td>
</tr>
<tr>
<td></td>
<td colspan="3"><input type="text" class="input-block-level" name="chmod_value" id="chmod_value" value="" data-def-value=""></td>
</tr>
</tbody>
</table>';
if ((!$ftp && is_dir($path)) )
{
$ret .= '<div class="hero-unit" style="padding:10px;">'.trans('File_Permission_Recursive').'<br/><br/>
<ul class="unstyled">
<li><label class="radio"><input value="none" name="apply_recursive" type="radio" checked> '.trans('No').'</label></li>
<li><label class="radio"><input value="files" name="apply_recursive" type="radio"> '.trans('Files').'</label></li>
<li><label class="radio"><input value="folders" name="apply_recursive" type="radio"> '.trans('Folders').'</label></li>
<li><label class="radio"><input value="both" name="apply_recursive" type="radio"> '.trans('Files').' & '.trans('Folders').'</label></li>
</ul>
</div>';
}
$ret .= '</form></div>';
response($ret)->send();
exit;
break;
case 'get_lang':
if ( ! file_exists('lang/languages.php'))
{
response(trans('Lang_Not_Found').AddErrorLocation())->send();
exit;
}
$languages = include 'lang/languages.php';
if ( ! isset($languages) || ! is_array($languages))
{
response(trans('Lang_Not_Found').AddErrorLocation())->send();
exit;
}
$curr = $_SESSION['RF']['language'];
$ret = '<select id="new_lang_select">';
foreach ($languages as $code => $name)
{
$ret .= '<option value="' . $code . '"' . ($code == $curr ? ' selected' : '') . '>' . $name . '</option>';
}
$ret .= '</select>';
response($ret)->send();
exit;
break;
case 'change_lang':
$choosen_lang = (!empty($_POST['choosen_lang']))? $_POST['choosen_lang']:"en_EN";
if(array_key_exists($choosen_lang,$languages)){
if ( ! file_exists('lang/' . $choosen_lang . '.php'))
{
response(trans('Lang_Not_Found').AddErrorLocation())->send();
exit;
}else{
$_SESSION['RF']['language'] = $choosen_lang;
}
}
break;
case 'cad_preview':
if($ftp){
$selected_file = $ftp_base_url.$upload_dir . $_GET['file'];
}else{
$selected_file = $current_path . $_GET['file'];
if ( ! file_exists($selected_file))
{
response(trans('File_Not_Found').AddErrorLocation())->send();
exit;
}
}
if($ftp){
$url_file = $selected_file;
}else{
$url_file = $base_url . $upload_dir . str_replace($current_path, '', $_GET["file"]);
}
$cad_url = urlencode($url_file);
$cad_html = "<iframe src=\"//sharecad.org/cadframe/load?url=" . $url_file . "\" class=\"google-iframe\" scrolling=\"no\"></iframe>";
$ret = $cad_html;
response($ret)->send();
break;
case 'get_file': // preview or edit
$sub_action = $_GET['sub_action'];
$preview_mode = $_GET["preview_mode"];
if ($sub_action != 'preview' && $sub_action != 'edit')
{
response(trans('wrong action').AddErrorLocation())->send();
exit;
}
if($ftp){
$selected_file = ($sub_action == 'preview' ? $ftp_base_url.$upload_dir . $_GET['file'] : $ftp_base_url.$upload_dir . $_POST['path']);
}else{
$selected_file = ($sub_action == 'preview' ? $current_path . $_GET['file'] : $current_path . $_POST['path']);
if ( ! file_exists($selected_file))
{
response(trans('File_Not_Found').AddErrorLocation())->send();
exit;
}
}
$info = pathinfo($selected_file);
if ($preview_mode == 'text')
{
$is_allowed = ($sub_action == 'preview' ? $preview_text_files : $edit_text_files);
$allowed_file_exts = ($sub_action == 'preview' ? $previewable_text_file_exts : $editable_text_file_exts);
} elseif ($preview_mode == 'viewerjs') {
$is_allowed = $viewerjs_enabled;
$allowed_file_exts = $viewerjs_file_exts;
} elseif ($preview_mode == 'google') {
$is_allowed = $googledoc_enabled;
$allowed_file_exts = $googledoc_file_exts;
}
if ( ! isset($allowed_file_exts) || ! is_array($allowed_file_exts))
{
$allowed_file_exts = array();
}
if ( ! in_array($info['extension'], $allowed_file_exts)
|| ! isset($is_allowed)
|| $is_allowed === false
|| (!$ftp && ! is_readable($selected_file))
)
{
response(sprintf(trans('File_Open_Edit_Not_Allowed'), ($sub_action == 'preview' ? strtolower(trans('Open')) : strtolower(trans('Edit')))).AddErrorLocation())->send();
exit;
}
if ($sub_action == 'preview')
{
if ($preview_mode == 'text')
{
// get and sanities
$data = file_get_contents($selected_file);
$data = htmlspecialchars(htmlspecialchars_decode($data));
$ret = '';
if ( ! in_array($info['extension'],$previewable_text_file_exts_no_prettify))
{
$ret .= '<script src="https://rawgit.com/google/code-prettify/master/loader/run_prettify.js?autoload=true&skin=sunburst"></script>';
$ret .= '<?prettify lang='.$info['extension'].' linenums=true?><pre class="prettyprint"><code class="language-'.$info['extension'].'">'.$data.'</code></pre>';
} else {
$ret .= '<pre class="no-prettify">'.$data.'</pre>';
}
}
elseif ($preview_mode == 'google' || $preview_mode == 'viewerjs') {
if($ftp){
$url_file = $selected_file;
}else{
$url_file = $base_url . $upload_dir . str_replace($current_path, '', $_GET["file"]);
}
$googledoc_url = urlencode($url_file);
$googledoc_html = "<iframe src=\"https://docs.google.com/viewer?url=" . $url_file . "&embedded=true\" class=\"google-iframe\"></iframe>";
$ret = $googledoc_html;
}
} else {
$data = stripslashes(htmlspecialchars(file_get_contents($selected_file)));
$ret = '<textarea id="textfile_edit_area" style="width:100%;height:300px;">'.$data.'</textarea>';
}
response($ret)->send();
exit;
break;
default:
response(trans('no action passed').AddErrorLocation())->send();
exit;
}
} else {
response(trans('no action passed').AddErrorLocation())->send();
exit;
}
?>

View File

@@ -0,0 +1 @@
Deny from all

View File

@@ -0,0 +1,531 @@
<?php
mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');
date_default_timezone_set('Europe/Warsaw');
$web_root = realpath(dirname(__FILE__).'/../../..');
if (file_exists($web_root.'/.profile.php'))
{
include_once($web_root.'/.profile.php');
}
/**
* Scieżka do katalogu głównego instalacji.
*/
if (defined('ST_ROOT_DIR'))
{
$core_dir = $web_root.ST_ROOT_DIR;
}
else
{
$core_dir = realpath($web_root.'/..');
}
define('SF_ROOT_DIR', realpath($core_dir));
/**
* Definicja aplikacji Symfony.
*/
define('SF_APP', 'backend');
/**
* Tryb uruchomienia [dev|prod|test]
*/
define('SF_ENVIRONMENT', 'prod');
/**
* Tryb raportowania błędów.
*/
define('SF_DEBUG', false);
/**
* Sprawdzanie czy jest włączna blokada sklepu
*/
include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'stLockPlugin'.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'stLock.class.php');
stLock::sentry(SF_APP, isset($_REQUEST['lock']) ? 'prod' : SF_ENVIRONMENT);
/**
* Odczytuje konfigurację Symfony.
*/
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
$originalGetParameters = $_GET;
$context = sfContext::getInstance();
$_GET = $originalGetParameters;
$key = sha1_file($core_dir.'/data/config/__stRegister.yml');
if (isset($_SESSION['RF']['language_file']))
{
unset($_SESSION['RF']['language_file']);
}
$languages = array(
'en' => 'en_EN',
);
if (isset($_GET['lang']) && isset($languages[$_GET['lang']]))
{
$_GET['lang'] = $languages[$_GET['lang']];
}
/*
|--------------------------------------------------------------------------
| Optional security
|--------------------------------------------------------------------------
|
| if set to true only those will access RF whose url contains the access key(akey) like:
| <input type="button" href="../filemanager/dialog.php?field_id=imgField&lang=en_EN&akey=myPrivateKey" value="Files">
| in tinymce a new parameter added: filemanager_access_key:"myPrivateKey"
| example tinymce config:
|
| tiny init ...
| external_filemanager_path:"../filemanager/",
| filemanager_title:"Filemanager" ,
| filemanager_access_key:"myPrivateKey" ,
| ...
|
*/
define('USE_ACCESS_KEYS', true); // TRUE or FALSE
/*
|--------------------------------------------------------------------------
| DON'T COPY THIS VARIABLES IN FOLDERS config.php FILES
|--------------------------------------------------------------------------
*/
define('DEBUG_ERROR_MESSAGE', true); // TRUE or FALSE
/*
|--------------------------------------------------------------------------
| Path configuration
|--------------------------------------------------------------------------
| In this configuration the folder tree is
| root
| |- source <- upload folder
| |- thumbs <- thumbnail folder [must have write permission (755)]
| |- filemanager
| |- js
| | |- tinymce
| | | |- plugins
| | | | |- responsivefilemanager
| | | | | |- plugin.min.js
*/
$config = array(
/*
|--------------------------------------------------------------------------
| DON'T TOUCH (base url (only domain) of site).
|--------------------------------------------------------------------------
|
| without final / (DON'T TOUCH)
|
*/
'base_url' => "",
/*
|--------------------------------------------------------------------------
| path from base_url to base of upload folder
|--------------------------------------------------------------------------
|
| with start and final /
|
*/
'upload_dir' => '/uploads/',
/*
|--------------------------------------------------------------------------
| relative path from filemanager folder to upload folder
|--------------------------------------------------------------------------
|
| with final /
|
*/
'current_path' => '../../uploads/',
/*
|--------------------------------------------------------------------------
| relative path from filemanager folder to thumbs folder
|--------------------------------------------------------------------------
|
| with final /
| DO NOT put inside upload folder
|
*/
'thumbs_base_path' => '../../uploads/thumbs/',
/*
|--------------------------------------------------------------------------
| FTP configuration BETA VERSION
|--------------------------------------------------------------------------
|
| If you want enable ftp use write these parametres otherwise leave empty
| Remember to set base_url properly to point in the ftp server domain and
| upload dir will be ftp_base_folder + upload_dir so without final /
|
*/
'ftp_host' => false,
'ftp_user' => "user",
'ftp_pass' => "pass",
'ftp_base_folder' => "base_folder",
'ftp_base_url' => "http://site to ftp root",
/* --------------------------------------------------------------------------
| path from ftp_base_folder to base of thumbs folder with start and final |
|--------------------------------------------------------------------------*/
'ftp_thumbs_dir' => '/thumbs/',
'ftp_ssl' => false,
'ftp_port' => 21,
// 'ftp_host' => "s108707.gridserver.com",
// 'ftp_user' => "test@responsivefilemanager.com",
// 'ftp_pass' => "Test.1234",
// 'ftp_base_folder' => "/domains/responsivefilemanager.com/html",
/*
|--------------------------------------------------------------------------
| Access keys
|--------------------------------------------------------------------------
|
| add access keys eg: array('myPrivateKey', 'someoneElseKey');
| keys should only containt (a-z A-Z 0-9 \ . _ -) characters
| if you are integrating lets say to a cms for admins, i recommend making keys randomized something like this:
| $username = 'Admin';
| $salt = 'dsflFWR9u2xQa' (a hard coded string)
| $akey = md5($username.$salt);
| DO NOT use 'key' as access key!
| Keys are CASE SENSITIVE!
|
*/
'access_keys' => array($key),
//--------------------------------------------------------------------------------------------------------
// YOU CAN COPY AND CHANGE THESE VARIABLES INTO FOLDERS config.php FILES TO CUSTOMIZE EACH FOLDER OPTIONS
//--------------------------------------------------------------------------------------------------------
/*
|--------------------------------------------------------------------------
| Maximum size of all files in source folder
|--------------------------------------------------------------------------
|
| in Megabytes
|
*/
'MaxSizeTotal' => false,
/*
|--------------------------------------------------------------------------
| Maximum upload size
|--------------------------------------------------------------------------
|
| in Megabytes
|
*/
'MaxSizeUpload' => 100,
/*
|--------------------------------------------------------------------------
| File and Folder permission
|--------------------------------------------------------------------------
|
*/
'fileFolderPermission' => 0755,
/*
|--------------------------------------------------------------------------
| default language file name
|--------------------------------------------------------------------------
*/
'default_language' => "en_EN",
/*
|--------------------------------------------------------------------------
| Icon theme
|--------------------------------------------------------------------------
|
| Default available: ico and ico_dark
| Can be set to custom icon inside filemanager/img
|
*/
'icon_theme' => "ico",
//Show or not total size in filemanager (is possible to greatly increase the calculations)
'show_total_size' => false,
//Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations)
'show_folder_size' => false,
//Show or not show sorting feature in filemanager
'show_sorting_bar' => true,
//Show or not show filters button in filemanager
'show_filter_buttons' => true,
//Show or not language selection feature in filemanager
'show_language_selection' => false,
//active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters)
'transliteration' => false,
//convert all spaces on files name and folders name with $replace_with variable
'convert_spaces' => false,
//convert all spaces on files name and folders name this value
'replace_with' => "-",
//convert to lowercase the files and folders name
'lower_case' => false,
//Add ?484899493349 (time value) to returned images to prevent cache
'add_time_to_img' => true,
// -1: There is no lazy loading at all, 0: Always lazy-load images, 0+: The minimum number of the files in a directory
// when lazy loading should be turned on.
'lazy_loading_file_number_threshold' => 0,
//*******************************************
//Images limit and resizing configuration
//*******************************************
// set maximum pixel width and/or maximum pixel height for all images
// If you set a maximum width or height, oversized images are converted to those limits. Images smaller than the limit(s) are unaffected
// if you don't need a limit set both to 0
'image_max_width' => 0,
'image_max_height' => 0,
'image_max_mode' => 'auto',
/*
# $option: 0 / exact = defined size;
# 1 / portrait = keep aspect set height;
# 2 / landscape = keep aspect set width;
# 3 / auto = auto;
# 4 / crop= resize and crop;
*/
//Automatic resizing //
// If you set $image_resizing to TRUE the script converts all uploaded images exactly to image_resizing_width x image_resizing_height dimension
// If you set width or height to 0 the script automatically calculates the other dimension
// Is possible that if you upload very big images the script not work to overcome this increase the php configuration of memory and time limit
'image_resizing' => false,
'image_resizing_width' => 0,
'image_resizing_height' => 0,
'image_resizing_mode' => 'auto', // same as $image_max_mode
'image_resizing_override' => false,
// If set to TRUE then you can specify bigger images than $image_max_width & height otherwise if image_resizing is
// bigger than $image_max_width or height then it will be converted to those values
//******************
//
// WATERMARK IMAGE
//
//Watermark url or false
'image_watermark' => false,
# Could be a pre-determined position such as:
# tl = top left,
# t = top (middle),
# tr = top right,
# l = left,
# m = middle,
# r = right,
# bl = bottom left,
# b = bottom (middle),
# br = bottom right
# Or, it could be a co-ordinate position such as: 50x100
'image_watermark_position' => 'br',
# padding: If using a pre-determined position you can
# adjust the padding from the edges by passing an amount
# in pixels. If using co-ordinates, this value is ignored.
'image_watermark_padding' => 0,
//******************
// Default layout setting
//
// 0 => boxes
// 1 => detailed list (1 column)
// 2 => columns list (multiple columns depending on the width of the page)
// YOU CAN ALSO PASS THIS PARAMETERS USING SESSION VAR => $_SESSION['RF']["VIEW"]=
//
//******************
'default_view' => 0,
//set if the filename is truncated when overflow first row
'ellipsis_title_after_first_row' => true,
//*************************
//Permissions configuration
//******************
'delete_files' => true,
'create_folders' => true,
'delete_folders' => true,
'upload_files' => true,
'rename_files' => true,
'rename_folders' => true,
'duplicate_files' => true,
'copy_cut_files' => true, // for copy/cut files
'copy_cut_dirs' => true, // for copy/cut directories
'chmod_files' => false, // change file permissions
'chmod_dirs' => false, // change folder permissions
'preview_text_files' => true, // eg.: txt, log etc.
'edit_text_files' => true, // eg.: txt, log etc.
'create_text_files' => false, // only create files with exts. defined in $editable_text_file_exts
// you can preview these type of files if $preview_text_files is true
'previewable_text_file_exts' => array( "bsh", "c","css", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html", "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh", "xhtml", "xml","xsl" ),
'previewable_text_file_exts_no_prettify' => array( 'txt', 'log' ),
// you can edit these type of files if $edit_text_files is true (only text based files)
// you can create these type of files if $create_text_files is true (only text based files)
// if you want you can add html,css etc.
// but for security reasons it's NOT RECOMMENDED!
'editable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ),
// Preview with Google Documents
'googledoc_enabled' => true,
'googledoc_file_exts' => array( 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx' ),
// Preview with Viewer.js
'viewerjs_enabled' => true,
'viewerjs_file_exts' => array( 'pdf', 'odt', 'odp', 'ods' ),
// defines size limit for paste in MB / operation
// set 'FALSE' for no limit
'copy_cut_max_size' => 100,
// defines file count limit for paste / operation
// set 'FALSE' for no limit
'copy_cut_max_count' => 200,
//IF any of these limits reached, operation won't start and generate warning
//**********************
//Allowed extensions (lowercase insert)
//**********************
'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg' ), //Images
'ext_file' => array( 'doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai', 'kmz','dwg', 'dxf', 'hpgl', 'plt', 'spl', 'step', 'stp', 'iges', 'igs', 'sat', 'cgm'), //Files
'ext_video' => array( 'mov', 'mpeg', 'm4v', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm" ), //Video
'ext_music' => array( 'mp3', 'mpga', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav' ), //Audio
'ext_misc' => array( 'zip', 'rar', 'gz', 'tar', 'iso', 'dmg', 'tgz' ), //Archives
/******************
* AVIARY config
*******************/
'aviary_active' => false,
'aviary_apiKey' => "2444282ef4344e3dacdedc7a78f8877d",
'aviary_language' => "en",
'aviary_theme' => "light",
'aviary_tools' => "all",
'aviary_maxSize' => "1400",
// Add or modify the Aviary options below as needed - they will be json encoded when added to the configuration so arrays can be utilized as needed
//The filter and sorter are managed through both javascript and php scripts because if you have a lot of
//file in a folder the javascript script can't sort all or filter all, so the filemanager switch to php script.
//The plugin automatic swich javascript to php when the current folder exceeds the below limit of files number
'file_number_limit_js' => 100,
//**********************
// Hidden files and folders
//**********************
// set the names of any folders you want hidden (eg "hidden_folder1", "hidden_folder2" ) Remember all folders with these names will be hidden (you can set any exceptions in config.php files on folders)
'hidden_folders' => array('plupload', 'producer', 'assets', 'product_group', 'stLanguagePlugin', 'picture', 'thumbs', 'default-options', 'options'),
// set the names of any files you want hidden. Remember these names will be hidden in all folders (eg "this_document.pdf", "that_image.jpg" )
'hidden_files' => array( 'config.php', 'ceneo.xml' ),
/*******************
* URL upload
*******************/
'url_upload' => true,
/*******************
* JAVA upload
*******************/
'java_upload' => true,
'JAVAMaxSizeUpload' => 200, //Gb
//************************************
//Thumbnail for external use creation
//************************************
// New image resized creation with fixed path from filemanager folder after uploading (thumbnails in fixed mode)
// If you want create images resized out of upload folder for use with external script you can choose this method,
// You can create also more than one image at a time just simply add a value in the array
// Remember than the image creation respect the folder hierarchy so if you are inside source/test/test1/ the new image will create at
// path_from_filemanager/test/test1/
// PS if there isn't write permission in your destination folder you must set it
//
'fixed_image_creation' => false, //activate or not the creation of one or more image resized with fixed path from filemanager folder
'fixed_path_from_filemanager' => array( '../test/', '../test1/' ), //fixed path of the image folder from the current position on upload folder
'fixed_image_creation_name_to_prepend' => array( '', 'test_' ), //name to prepend on filename
'fixed_image_creation_to_append' => array( '_test', '' ), //name to appendon filename
'fixed_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if you set height)
'fixed_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if you set width)
/*
# $option: 0 / exact = defined size;
# 1 / portrait = keep aspect set height;
# 2 / landscape = keep aspect set width;
# 3 / auto = auto;
# 4 / crop= resize and crop;
*/
'fixed_image_creation_option' => array( 'crop', 'auto' ), //set the type of the crop
// New image resized creation with relative path inside to upload folder after uploading (thumbnails in relative mode)
// With Responsive filemanager you can create automatically resized image inside the upload folder, also more than one at a time
// just simply add a value in the array
// The image creation path is always relative so if i'm inside source/test/test1 and I upload an image, the path start from here
//
'relative_image_creation' => false, //activate or not the creation of one or more image resized with relative path from upload folder
'relative_path_from_current_pos' => array( './', './' ), //relative path of the image folder from the current position on upload folder
'relative_image_creation_name_to_prepend' => array( '', '' ), //name to prepend on filename
'relative_image_creation_name_to_append' => array( '_thumb', '_thumb1' ), //name to append on filename
'relative_image_creation_width' => array( 300, 400 ), //width of image (you can leave empty if you set height)
'relative_image_creation_height' => array( 200, '' ), //height of image (you can leave empty if you set width)
/*
# $option: 0 / exact = defined size;
# 1 / portrait = keep aspect set height;
# 2 / landscape = keep aspect set width;
# 3 / auto = auto;
# 4 / crop= resize and crop;
*/
'relative_image_creation_option' => array( 'crop', 'crop' ), //set the type of the crop
// Remember text filter after close filemanager for future session
'remember_text_filter' => false,
);
if (sfThumbnail::hasImageTypeSupport('webp'))
{
$config['ext_img'][] = 'webp';
}
// die(var_export($config['ext_img'], true));
return array_merge(
$config,
array(
'MaxSizeUpload' => min((int)ini_get('post_max_size'), (int)ini_get('upload_max_filesize')),
'ext'=> array_merge(
$config['ext_img'],
$config['ext_file'],
$config['ext_misc'],
$config['ext_video'],
$config['ext_music']
),
// For a list of options see: https://developers.aviary.com/docs/web/setup-guide#constructor-config
'aviary_defaults_config' => array(
'apiKey' => $config['aviary_apiKey'],
'language' => $config['aviary_language'],
'theme' => $config['aviary_theme'],
'tools' => $config['aviary_tools'],
'maxSize' => $config['aviary_maxSize']
),
)
);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,524 @@
<?php
$config = include 'config/config.php';
//TODO switch to array
extract($config, EXTR_OVERWRITE);
include 'include/utils.php';
if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager")
{
response(trans('forbiden').AddErrorLocation())->send();
exit;
}
if (strpos($_POST['path'],'/')===0
|| strpos($_POST['path'],'../')!==FALSE
|| strpos($_POST['path'],'./')===0
|| strpos($_POST['path'],'..\\')!==FALSE
|| strpos($_POST['path'],'.\\')===0)
{
response(trans('wrong path'.AddErrorLocation()))->send();
exit;
}
if (isset($_SESSION['RF']['language']) && file_exists('lang/' . basename($_SESSION['RF']['language']) . '.php'))
{
$languages = include 'lang/languages.php';
if(array_key_exists($_SESSION['RF']['language'],$languages)){
include 'lang/' . basename($_SESSION['RF']['language']) . '.php';
}else{
response(trans('Lang_Not_Found').AddErrorLocation())->send();
exit;
}
}
else
{
response(trans('Lang_Not_Found').AddErrorLocation())->send();
exit;
}
$ftp = ftp_con($config);
$base = $current_path;
$path = $base.$_POST['path'];
$cycle = TRUE;
$max_cycles = 50;
$i = 0;
while($cycle && $i<$max_cycles)
{
$i++;
if ($path == $base) $cycle=FALSE;
if (file_exists($path."config.php"))
{
require_once $path."config.php";
$cycle = FALSE;
}
$path = fix_dirname($path)."/";
}
$path = $current_path.$_POST['path'];
$path_thumb = $thumbs_base_path.$_POST['path'];
if($ftp){
$path = $ftp_base_folder.$upload_dir.$_POST['path'];
$path_thumb = $ftp_base_folder.$ftp_thumbs_dir.$_POST['path'];
}
if (isset($_POST['name']))
{
$name = fix_filename($_POST['name'],$config);
if (strpos($name,'../') !== FALSE || strpos($name,'..\\') !== FALSE)
{
response(trans('wrong name').AddErrorLocation())->send();
exit;
}
}
$info = pathinfo($path);
if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action']=='delete_folder') && !in_array(strtolower($info['extension']), $ext) && $_GET['action'] != 'create_file')
{
response(trans('wrong extension').AddErrorLocation())->send();
exit;
}
if (isset($_GET['action']))
{
switch($_GET['action'])
{
case 'delete_file':
if ($delete_files){
if($ftp){
try{
$ftp->delete("/".$path);
@$ftp->delete("/".$path_thumb);
}catch(FtpClient\FtpException $e){
return;
}
}else{
unlink($path);
if (file_exists($path_thumb)){
unlink($path_thumb);
}
}
$info=pathinfo($path);
if (!$ftp && $relative_image_creation){
foreach($relative_path_from_current_pos as $k=>$path)
{
if ($path!="" && $path[strlen($path)-1]!="/") $path.="/";
if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']))
{
unlink($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']);
}
}
}
if (!$ftp && $fixed_image_creation)
{
foreach($fixed_path_from_filemanager as $k=>$path)
{
if ($path!="" && $path[strlen($path)-1] != "/") $path.="/";
$base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
{
unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']);
}
}
}
}
break;
case 'delete_folder':
if ($delete_folders){
if($ftp){
deleteDir($path,$ftp,$config);
deleteDir($path_thumb,$ftp,$config);
}else{
if (is_dir($path_thumb))
{
deleteDir($path_thumb);
}
if (is_dir($path))
{
deleteDir($path);
if ($fixed_image_creation)
{
foreach($fixed_path_from_filemanager as $k=>$paths){
if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/";
$base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
if (is_dir($base_dir)) deleteDir($base_dir);
}
}
}
}
}
break;
case 'create_folder':
if ($create_folders)
{
$name = fix_filename($_POST['name'],$config);
$path .= $name;
$path_thumb .= $name;
create_folder(fix_path($path,$config),fix_path($path_thumb,$config),$ftp,$config);
}
break;
case 'rename_folder':
if ($rename_folders){
$name=fix_filename($name,$config);
$name=str_replace('.','',$name);
if (!empty($name)){
if (!rename_folder($path,$name,$ftp,$config))
{
response(trans('Rename_existing_folder').AddErrorLocation())->send();
exit;
}
rename_folder($path_thumb,$name,$ftp,$config);
if (!$ftp && $fixed_image_creation){
foreach($fixed_path_from_filemanager as $k=>$paths){
if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/";
$base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
rename_folder($base_dir,$name,$ftp,$config);
}
}
} else {
response(trans('Empty_name').AddErrorLocation())->send();
exit;
}
}
break;
case 'create_file':
if ($create_text_files === FALSE) {
response(sprintf(trans('File_Open_Edit_Not_Allowed'), strtolower(trans('Edit'))).AddErrorLocation())->send();
exit;
}
if (!isset($editable_text_file_exts) || !is_array($editable_text_file_exts)){
$editable_text_file_exts = array();
}
// check if user supplied extension
if (strpos($name, '.') === FALSE){
response(trans('No_Extension').' '.sprintf(trans('Valid_Extensions'), implode(', ', $editable_text_file_exts)).AddErrorLocation())->send();
exit;
}
// correct name
$old_name = $name;
$name=fix_filename($name,$config);
if (empty($name))
{
response(trans('Empty_name').AddErrorLocation())->send();
exit;
}
// check extension
$parts = explode('.', $name);
if (!in_array(end($parts), $editable_text_file_exts)) {
response(trans('Error_extension').' '.sprintf(trans('Valid_Extensions'), implode(', ', $editable_text_file_exts)), 400)->send();
exit;
}
$content = $_POST['new_content'];
if($ftp){
$tmp = time().$name;
file_put_contents($tmp, $content);
$ftp->put("/".$path.$name, $tmp, FTP_BINARY);
unlink($tmp);
response(trans('File_Save_OK'))->send();
}else{
if (!checkresultingsize(strlen($content))) {
response(sprintf(trans('max_size_reached'),$MaxSizeTotal).AddErrorLocation())->send();
exit;
}
// file already exists
if (file_exists($path.$name)) {
response(trans('Rename_existing_file').AddErrorLocation())->send();
exit;
}
if (@file_put_contents($path.$name, $content) === FALSE) {
response(trans('File_Save_Error').AddErrorLocation())->send();
exit;
} else {
if (is_function_callable('chmod') !== FALSE){
chmod($path.$name, 0644);
}
response(trans('File_Save_OK'))->send();
exit;
}
}
break;
case 'rename_file':
if ($rename_files){
$name=fix_filename($name,$config);
if (!empty($name))
{
if (!rename_file($path,$name,$ftp,$config))
{
response(trans('Rename_existing_file').AddErrorLocation())->send();
exit;
}
rename_file($path_thumb,$name,$ftp,$config);
if ($fixed_image_creation)
{
$info=pathinfo($path);
foreach($fixed_path_from_filemanager as $k=>$paths)
{
if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.="/";
$base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
{
rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$ftp,$config);
}
}
}
} else {
response(trans('Empty_name').AddErrorLocation())->send();
exit;
}
}
break;
case 'duplicate_file':
if ($duplicate_files)
{
$name=fix_filename($name,$config);
if (!empty($name))
{
if (!$ftp && !checkresultingsize(filesize($path))) {
response(sprintf(trans('max_size_reached'),$MaxSizeTotal).AddErrorLocation())->send();
exit;
}
if (!duplicate_file($path,$name,$ftp,$config))
{
response(trans('Rename_existing_file').AddErrorLocation())->send();
exit;
}
duplicate_file($path_thumb,$name,$ftp,$config);
if (!$ftp && $fixed_image_creation)
{
$info=pathinfo($path);
foreach($fixed_path_from_filemanager as $k=>$paths)
{
if ($paths!="" && $paths[strlen($paths)-1] != "/") $paths.= "/";
$base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
{
duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]);
}
}
}
} else {
response(trans('Empty_name').AddErrorLocation())->send();
exit;
}
}
break;
case 'paste_clipboard':
if ( ! isset($_SESSION['RF']['clipboard_action'], $_SESSION['RF']['clipboard']['path'])
|| $_SESSION['RF']['clipboard_action'] == ''
|| $_SESSION['RF']['clipboard']['path'] == '')
{
response()->send();
exit;
}
$action = $_SESSION['RF']['clipboard_action'];
$data = $_SESSION['RF']['clipboard'];
if($ftp){
if($_POST['path']!=""){
$path.=DIRECTORY_SEPARATOR;
$path_thumb.=DIRECTORY_SEPARATOR;
}
$path_thumb .= basename($data['path']);
$path .= basename($data['path']) ;
$data['path_thumb'] = DIRECTORY_SEPARATOR.$config['ftp_base_folder'].$config['ftp_thumbs_dir'].$data['path'];
$data['path'] = DIRECTORY_SEPARATOR.$config['ftp_base_folder'].$config['upload_dir'].$data['path'];
}else{
$data['path_thumb'] = $thumbs_base_path.$data['path'];
$data['path'] = $current_path.$data['path'];
}
$pinfo = pathinfo($data['path']);
// user wants to paste to the same dir. nothing to do here...
if ($pinfo['dirname'] == rtrim($path, DIRECTORY_SEPARATOR)) {
response()->send();
exit;
}
// user wants to paste folder to it's own sub folder.. baaaah.
if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE){
response()->send();
exit;
}
// something terribly gone wrong
if ($action != 'copy' && $action != 'cut'){
response(trans('wrong action').AddErrorLocation())->send();
exit;
}
if($ftp){
if ($action == 'copy')
{
$tmp = time().basename($data['path']);
$ftp->get($tmp, $data['path'], FTP_BINARY);
$ftp->put(DIRECTORY_SEPARATOR.$path, $tmp, FTP_BINARY);
unlink($tmp);
if(url_exists($data['path_thumb'])){
$tmp = time().basename($data['path_thumb']);
@$ftp->get($tmp, $data['path_thumb'], FTP_BINARY);
@$ftp->put(DIRECTORY_SEPARATOR.$path_thumb, $tmp, FTP_BINARY);
unlink($tmp);
}
} elseif ($action == 'cut') {
$ftp->rename($data['path'], DIRECTORY_SEPARATOR.$path);
if(url_exists($data['path_thumb'])){
@$ftp->rename($data['path_thumb'], DIRECTORY_SEPARATOR.$path_thumb);
}
}
}else{
// check for writability
if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE){
response(trans('Dir_No_Write').'<br/>'.str_replace('../','',$path).'<br/>'.str_replace('../','',$path_thumb).AddErrorLocation())->send();
exit;
}
// check if server disables copy or rename
if (is_function_callable(($action == 'copy' ? 'copy' : 'rename')) === FALSE){
response(sprintf(trans('Function_Disabled'), ($action == 'copy' ? (trans('Copy')) : (trans('Cut')))).AddErrorLocation())->send();
exit;
}
if ($action == 'copy')
{
list($sizeFolderToCopy,$fileNum,$foldersCount) = folder_info($path,false);
if (!checkresultingsize($sizeFolderToCopy)) {
response(sprintf(trans('max_size_reached'),$MaxSizeTotal).AddErrorLocation())->send();
exit;
}
rcopy($data['path'], $path);
rcopy($data['path_thumb'], $path_thumb);
} elseif ($action == 'cut') {
rrename($data['path'], $path);
rrename($data['path_thumb'], $path_thumb);
// cleanup
if (is_dir($data['path']) === TRUE){
rrename_after_cleaner($data['path']);
rrename_after_cleaner($data['path_thumb']);
}
}
}
// cleanup
$_SESSION['RF']['clipboard']['path'] = NULL;
$_SESSION['RF']['clipboard_action'] = NULL;
break;
case 'chmod':
$mode = $_POST['new_mode'];
$rec_option = $_POST['is_recursive'];
$valid_options = array('none', 'files', 'folders', 'both');
$chmod_perm = ($_POST['folder'] ? $chmod_dirs : $chmod_files);
// check perm
if ($chmod_perm === FALSE) {
response(sprintf(trans('File_Permission_Not_Allowed'), (is_dir($path) ? (trans('Folders')) : (trans('Files')) )).AddErrorLocation())->send();
exit;
}
// check mode
if (!preg_match("/^[0-7]{3}$/", $mode)){
response(trans('File_Permission_Wrong_Mode').AddErrorLocation())->send();
exit;
}
// check recursive option
if (!in_array($rec_option, $valid_options)){
response(trans("wrong option").AddErrorLocation())->send();
exit;
}
// check if server disabled chmod
if (!$ftp && is_function_callable('chmod') === FALSE){
response(sprintf(trans('Function_Disabled'), 'chmod').AddErrorLocation())->send();
exit;
}
$mode = "0".$mode;
$mode = octdec($mode);
if($ftp){
$ftp->chmod($mode, "/".$path);
}else{
rchmod($path, $mode, $rec_option);
}
break;
case 'save_text_file':
$content = $_POST['new_content'];
// $content = htmlspecialchars($content); not needed
// $content = stripslashes($content);
if($ftp){
$tmp = time();
file_put_contents($tmp, $content);
try{
$ftp->put("/".$path, $tmp, FTP_BINARY);
}catch(FtpClient\FtpException $e){
echo $e->getMessage();
}
unlink($tmp);
response(trans('File_Save_OK'))->send();
}else{
// no file
if (!file_exists($path)) {
response(trans('File_Not_Found').AddErrorLocation())->send();
exit;
}
// not writable or edit not allowed
if (!is_writable($path) || $edit_text_files === FALSE) {
response(sprintf(trans('File_Open_Edit_Not_Allowed'), strtolower(trans('Edit'))).AddErrorLocation())->send();
exit;
}
if (!checkresultingsize(strlen($content))) {
response(sprintf(trans('max_size_reached'),$MaxSizeTotal).AddErrorLocation())->send();
exit;
}
if (@file_put_contents($path, $content) === FALSE) {
response(trans('File_Save_Error').AddErrorLocation())->send();
exit;
} else {
response(trans('File_Save_OK'))->send();
exit;
}
}
break;
default:
response(trans('wrong action').AddErrorLocation())->send();
exit;
}
}
?>

View File

@@ -0,0 +1,151 @@
<?php
$config = include 'config/config.php';
//TODO switch to array
extract($config, EXTR_OVERWRITE);
include 'include/utils.php';
$ftp = ftp_con($config);
if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager")
{
response(trans('forbiden').AddErrorLocation(), 403)->send();
exit;
}
include 'include/mime_type_lib.php';
if (
strpos($_POST['path'], '/') === 0
|| strpos($_POST['path'], '../') !== false
|| strpos($_POST['path'], './') === 0
|| strpos($_POST['path'], '..\\') !== false
|| strpos($_POST['path'], '.\\') === 0
)
{
response(trans('wrong path'.AddErrorLocation()), 400)->send();
exit;
}
if (strpos($_POST['name'], '/') !== false)
{
response(trans('wrong path'.AddErrorLocation()), 400)->send();
exit;
}
if($ftp){
$path = $ftp_base_url . $upload_dir . $_POST['path'];
}else{
$path = $current_path . $_POST['path'];
}
$name = $_POST['name'];
$info = pathinfo($name);
if ( ! in_array(fix_strtolower($info['extension']), $ext))
{
response(trans('wrong extension'.AddErrorLocation()), 400)->send();
exit;
}
$file_name = $info['basename'];
$file_ext = $info['extension'];
$file_path = $path . $name;
// make sure the file exists
if($ftp){
$file_url = 'http://www.myremoteserver.com/file.exe';
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . $file_name . "\"");
readfile($file_path);
}elseif (is_file($file_path) && is_readable($file_path))
{
if ( ! file_exists($path . $name))
{
response(trans('File_Not_Found'.AddErrorLocation()), 404)->send();
exit;
}
$size = filesize($file_path);
$file_name = rawurldecode($file_name);
if (function_exists('mime_content_type')){
$mime_type = mime_content_type($file_path);
}elseif(function_exists('finfo_open')){
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($finfo, $file_path);
}else{
include 'include/mime_type_lib.php';
$mime_type = get_file_mime_type($file_path);
}
@ob_end_clean();
if(ini_get('zlib.output_compression')){
ini_set('zlib.output_compression', 'Off');
}
header('Content-Type: ' . $mime_type);
header('Content-Disposition: attachment; filename="'.$file_name.'"');
header("Content-Transfer-Encoding: binary");
header('Accept-Ranges: bytes');
if(isset($_SERVER['HTTP_RANGE']))
{
list($a, $range) = explode("=",$_SERVER['HTTP_RANGE'],2);
list($range) = explode(",",$range,2);
list($range, $range_end) = explode("-", $range);
$range=intval($range);
if(!$range_end) {
$range_end=$size-1;
} else {
$range_end=intval($range_end);
}
$new_length = $range_end-$range+1;
header("HTTP/1.1 206 Partial Content");
header("Content-Length: $new_length");
header("Content-Range: bytes $range-$range_end/$size");
} else {
$new_length=$size;
header("Content-Length: ".$size);
}
$chunksize = 1*(1024*1024);
$bytes_send = 0;
if ($file = fopen($file_path, 'r'))
{
if(isset($_SERVER['HTTP_RANGE']))
fseek($file, $range);
while(!feof($file) &&
(!connection_aborted()) &&
($bytes_send<$new_length)
)
{
$buffer = fread($file, $chunksize);
echo($buffer);
flush();
$bytes_send += strlen($buffer);
}
fclose($file);
} else {
die('Error - can not open file.');
}
die();
}
else
{
// file does not exist
header("HTTP/1.0 404 Not Found");
exit;
}
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Some files were not shown because too many files have changed in this diff Show More