first commit

This commit is contained in:
pakerpale
2020-06-10 06:21:34 +09:00
commit 20c9739ba9
1913 changed files with 266257 additions and 0 deletions

16
public/theme/admin/js/_base.js Executable file
View File

@@ -0,0 +1,16 @@
$(function () {
$('.subnavbar').find ('li').each (function (i) {
var mod = i % 3;
if (mod === 2) {
$(this).addClass ('subnavbar-open-right');
}
});
});

161
public/theme/admin/js/base.js Executable file
View File

@@ -0,0 +1,161 @@
var sessionExist=1;
$( document ).ready(function() {
setInterval(function() {
if(sessionExist==1){
$.ajax({
url: "/admin/check/session",
}).done(function(data) {
sessionExist = data;
if(sessionExist==0){
$('.modal').modal('hide');
$('#loginModal').modal({
backdrop: 'static',
keyboard: false
}).modal('show');
}
});
}
}, 60000);
});
$(document).on("click", "#ajaxLoginbtn", function(event){
$.post("/admin/ajax/login", {
username: $('#username').val(),
password: $('#password').val()
}).done(function(data) {
if(data==1){
$('#loginModal').modal('hide');
sessionExist=1;
} else {
$('#loginError').show();
}
});
});
$(function () {
$('.subnavbar').find ('li').each (function (i) {
var mod = i % 3;
if (mod === 2) {
$(this).addClass ('subnavbar-open-right');
}
});
});
$('#remote-modals').on("hidden.bs.modal", ".modal:not(.local-modal)", function (e) {
$(e.target).removeData("bs.modal").find(".modal-content").empty();
});
$(document).ready(function() {
$(".URLField").blur(function() {
var identbefore=$(".URLField").val();
var ident=identbefore.toLowerCase();
ident=ident.replace(/ /g,'-');
ident=ident.replace(/_/g,'-');
ident=ident.replace(/[^\w-]+/g,'');
$(".URLField").val(ident);
if( identbefore.length >ident.length ) {
alert("URL amended\nPlease use only a-z,0-9 or dash");
}
});
});
var field;
function fancybox(elem) {
field = $(elem).parent().prev();
$.fancybox.open({
width : '900',
height : '600',
href: elem,
type: 'iframe'
});
}
function responsive_filemanager_callback(field_id){
var url=jQuery('#'+field_id).val();
$(field).val(url);
}
$(function(){
$('#searchString').on("keyup", function(e) {
if (e.keyCode == 13) {
$("#searchBtn").trigger("click");
}
});
});
function doPostSearch(){
$('#postContainer').html("");
$('#loadingSpinner').show();
$.post("/admin/ajax/post-search", {
term: $('#searchString').val(),
}).done(function(data) {
$('#loadingSpinner').hide();
$('#postContainer').html(data);
if($('#searchString').val()==""){
$('#paginationContainer').show();
} else {
$('#paginationContainer').hide();
}
});
}
function doCategorySearch(){
$('#categoryContainer').html("");
$('#loadingSpinner').show();
$.post("/admin/ajax/category-search", {
term: $('#searchString').val(),
}).done(function(data) {
$('#loadingSpinner').hide();
$('#categoryContainer').html(data);
if($('#searchString').val()==""){
$('#paginationContainer').show();
} else {
$('#paginationContainer').hide();
}
});
}
function doPageSearch(){
$('#pageContainer').html("");
$('#loadingSpinner').show();
$.post("/admin/ajax/page-search", {
term: $('#searchString').val(),
}).done(function(data) {
$('#loadingSpinner').hide();
$('#pageContainer').html(data);
if($('#searchString').val()==""){
$('#paginationContainer').show();
} else {
$('#paginationContainer').hide();
} });
}
function doRoleSearch(){
$('#roleContainer').html("");
$('#loadingSpinner').show();
$.post("/admin/ajax/role-search", {
term: $('#searchString').val(),
}).done(function(data) {
$('#loadingSpinner').hide();
$('#roleContainer').html(data);
if($('#searchString').val()==""){
$('#paginationContainer').show();
} else {
$('#paginationContainer').hide();
} });
}
function doUserSearch(){
$('#userContainer').html("");
$('#loadingSpinner').show();
$.post("/admin/ajax/user-search", {
term: $('#searchString').val(),
}).done(function(data) {
$('#loadingSpinner').hide();
$('#userContainer').html(data);
if($('#searchString').val()==""){
$('#paginationContainer').show();
} else {
$('#paginationContainer').hide();
} });
}

2363
public/theme/admin/js/bootstrap.js vendored Executable file

File diff suppressed because it is too large Load Diff

7
public/theme/admin/js/bootstrap.min.js vendored Executable file

File diff suppressed because one or more lines are too long

104
public/theme/admin/js/date.js Executable file
View File

@@ -0,0 +1,104 @@
/**
* Version: 1.0 Alpha-1
* Build Date: 13-Nov-2007
* Copyright (c) 2006-2007, Coolite Inc. (http://www.coolite.com/). All rights reserved.
* License: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/.
* Website: http://www.datejs.com/ or http://www.coolite.com/datejs/
*/
Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};
Date.getMonthNumberFromName=function(name){var n=Date.CultureInfo.monthNames,m=Date.CultureInfo.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
return-1;};Date.getDayNumberFromName=function(name){var n=Date.CultureInfo.dayNames,m=Date.CultureInfo.abbreviatedDayNames,o=Date.CultureInfo.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
return-1;};Date.isLeapYear=function(year){return(((year%4===0)&&(year%100!==0))||(year%400===0));};Date.getDaysInMonth=function(year,month){return[31,(Date.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};Date.getTimezoneOffset=function(s,dst){return(dst||false)?Date.CultureInfo.abbreviatedTimeZoneDST[s.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[s.toUpperCase()];};Date.getTimezoneAbbreviation=function(offset,dst){var n=(dst||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,p;for(p in n){if(n[p]===offset){return p;}}
return null;};Date.prototype.clone=function(){return new Date(this.getTime());};Date.prototype.compareTo=function(date){if(isNaN(this)){throw new Error(this);}
if(date instanceof Date&&!isNaN(date)){return(this>date)?1:(this<date)?-1:0;}else{throw new TypeError(date);}};Date.prototype.equals=function(date){return(this.compareTo(date)===0);};Date.prototype.between=function(start,end){var t=this.getTime();return t>=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
if(x.month||x.months){this.addMonths(x.month||x.months);}
if(x.year||x.years){this.addYears(x.year||x.years);}
if(x.day||x.days){this.addDays(x.day||x.days);}
return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(value<min||value>max){throw new RangeError(value+" is not a valid value for "+name+".");}
return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;}
if(!x.second&&x.second!==0){x.second=-1;}
if(!x.minute&&x.minute!==0){x.minute=-1;}
if(!x.hour&&x.hour!==0){x.hour=-1;}
if(!x.day&&x.day!==0){x.day=-1;}
if(!x.month&&x.month!==0){x.month=-1;}
if(!x.year&&x.year!==0){x.year=-1;}
if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());}
if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());}
if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());}
if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());}
if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());}
if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());}
if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());}
if(x.timezone){this.setTimezone(x.timezone);}
if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset);}
return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun());};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||Date.CultureInfo.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;}
var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}}
return w;};Date.prototype.isDST=function(){console.log('isDST');return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());};Date.prototype.setTimezoneOffset=function(s){var here=this.getTimezoneOffset(),there=Number(s)*-6/10;this.addMinutes(there-here);return this;};Date.prototype.setTimezone=function(s){return this.setTimezoneOffset(Date.getTimezoneOffset(s));};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this;var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();};
Date.now=function(){return new Date();};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var c={};c[this._dateElement]=this;return Date.now().add(c);};Number.prototype.ago=function(){var c={};c[this._dateElement]=this*-1;return Date.now().add(c);};(function(){var $D=Date.prototype,$N=Number.prototype;var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),de;var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
return this.moveToDayOfWeek(n,this._orient);};};for(var i=0;i<dx.length;i++){$D[dx[i]]=$D[dx[i].substring(0,3)]=df(i);}
var mf=function(n){return function(){if(this._is){this._is=false;return this.getMonth()===n;}
return this.moveToMonth(n,this._orient);};};for(var j=0;j<mx.length;j++){$D[mx[j]]=$D[mx[j].substring(0,3)]=mf(j);}
var ef=function(j){return function(){if(j.substring(j.length-1)!="s"){j+="s";}
return this["add"+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;k<px.length;k++){de=px[k].toLowerCase();$D[de]=$D[de+"s"]=ef(px[k]);$N[de]=$N[de+"s"]=nf(de);}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ");};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern);};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern);};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern);};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern);};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};
(function(){Date.Parsing={Exception:function(s){this.message="Parse error at '"+s.substring(0,10)+" ...'";}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp("^\s*"+s+"\s*"))(s);};},stoken:function(s){return _.rtoken(new RegExp("^"+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
break;}
return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
rx.push(r[0]);s=r[1];}
return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i<px.length;i++){rx.push(_.each(px[i],qx));}
return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
try{r=(px[i].call(this,s));}catch(e){r=null;}
if(r){return r;}}
throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
rx.push(r[0]);s=r[1];}
return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
return function(s){var r=null,q=null;var rx=[];for(var i=0;i<px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
s=q[1];}
if(!r){throw new $P.Exception(s);}
if(q){throw new $P.Exception(q[1]);}
if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i<px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
rx=[[r[0]],r[1]];if(r[1].length>0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
if(!last&&q[1].length===0){last=true;}
if(!last){var qx=[];for(var j=0;j<px.length;j++){if(i!=j){qx.push(px[j]);}}
p=_.set(qx,d).call(this,q[1]);if(p[0].length>0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
if(rx[1].length<best[1].length){best=rx;}
if(best[1].length===0){break;}}
if(best[0].length===0){return best;}
if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
best[1]=q[1];}
return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length<min){throw new $P.Exception(s);}
return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length>1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
if(args){for(var i=0,px=args.shift();i<px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx="optional not ignore cache".split(/\s/);for(var i=0;i<gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx="each any all".split(/\s/);for(var j=0;j<vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());(function(){var flattenAndCompact=function(ax){var rx=[];for(var i=0;i<ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
return rx;};Date.Grammar={};Date.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,"");if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=((s.length==3)?Date.getMonthNumberFromName(s):(Number(s)-1));};},year:function(s){return function(){var n=Number(s);this.year=((s.length>2)?n:(n+(((n+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];var now=new Date();this.year=now.getFullYear();this.month=now.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var i=0;i<x.length;i++){if(x[i]){x[i].call(this);}}
this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
for(var i=0;i<x.length;i++){if(typeof x[i]=="function"){x[i].call(this);}}
if(this.now){return new Date();}
var today=Date.today();var method=null;var expression=!!(this.days!=null||this.orient||this.operator);if(expression){var gap,mod,orient;orient=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";gap=(Date.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
if(this.month){this.unit="month";gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
if(!this.unit){this.unit="day";}
if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;}
if(this.unit=="week"){this.unit="day";this.value=this.value*7;}
this[this.unit+"s"]=this.value*orient;}
return today.add(this);}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour;}
if(this.weekday&&!this.day){this.day=(today.addDays((Date.getDayNumberFromName(this.weekday)-today.getDay()))).getDate();}
if(this.month&&!this.day){this.day=1;}
return today.set(this);}}};var _=Date.Parsing.Operators,g=Date.Grammar,t=Date.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(":");g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=Date.CultureInfo.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i<kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
fn=_C[keys]=_.any.apply(null,px);}
return fn;};g.ctoken2=function(key){return _.rtoken(Date.CultureInfo.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.mm,g.ss],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2("shortMeridian"),t.meridian));g.tt=_.cache(_.process(g.ctoken2("longMeridian"),t.meridian));g.z=_.cache(_.process(_.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^(\+|\-)\s*\d\d\d\d/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2("timezone"),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken("T"))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2("timeContext")));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken("past future"),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken("add subtract"),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken("yesterday tomorrow today now"),t.rday);g.unit=_.process(g.ctoken("minute hour day week month year"),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,"");};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[Date.CultureInfo.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw Date.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i<fx.length;i++){rx.push(_get(fx[i]));}
return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
return g._start.call({},s);};}());Date._parse=Date.parse;Date.parse=function(s){var r=null;if(!s){return null;}
try{r=Date.Grammar.start.call({},s);}catch(e){return null;}
return((r[1].length===0)?r[0]:null);};Date.getParseFunction=function(fx){var fn=Date.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
return((r[1].length===0)?r[0]:null);};};Date.parseExact=function(s,fx){return Date.getParseFunction(fx)(s);};

View File

@@ -0,0 +1,418 @@
.xdsoft_datetimepicker{
box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506);
background: #FFFFFF;
border-bottom: 1px solid #BBBBBB;
border-left: 1px solid #CCCCCC;
border-right: 1px solid #CCCCCC;
border-top: 1px solid #CCCCCC;
color: #333333;
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
padding: 8px;
padding-left: 0;
padding-top: 2px;
position: absolute;
z-index: 9999;
-moz-box-sizing: border-box;
box-sizing: border-box;
display:none;
}
.xdsoft_datetimepicker iframe {
position: absolute;
left: 0;
top: 0;
width: 75px;
height: 210px;
background: transparent;
border:none;
}
/*For IE8 or lower*/
.xdsoft_datetimepicker button {
border:none !important;
}
.xdsoft_noselect{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.xdsoft_noselect::selection { background: transparent; }
.xdsoft_noselect::-moz-selection { background: transparent; }
.xdsoft_datetimepicker.xdsoft_inline{
display: inline-block;
position: static;
box-shadow: none;
}
.xdsoft_datetimepicker *{
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
margin: 0;
}
.xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker{
display:none;
}
.xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active{
display:block;
}
.xdsoft_datetimepicker .xdsoft_datepicker{
width: 224px;
float:left;
margin-left:8px;
}
.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker{
width: 256px;
}
.xdsoft_datetimepicker .xdsoft_timepicker{
width: 58px;
float:left;
text-align:center;
margin-left:8px;
margin-top: 0;
}
.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker{
margin-top:8px;
margin-bottom:3px
}
.xdsoft_datetimepicker .xdsoft_mounthpicker{
position: relative;
text-align: center;
}
.xdsoft_datetimepicker .xdsoft_label i,
.xdsoft_datetimepicker .xdsoft_prev,
.xdsoft_datetimepicker .xdsoft_next,
.xdsoft_datetimepicker .xdsoft_today_button{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC);
}
.xdsoft_datetimepicker .xdsoft_label i{
opacity:0.5;
background-position:-92px -19px;
display: inline-block;
width: 9px;
height: 20px;
vertical-align: middle;
}
.xdsoft_datetimepicker .xdsoft_prev{
float: left;
background-position:-20px 0;
}
.xdsoft_datetimepicker .xdsoft_today_button{
float: left;
background-position:-70px 0;
margin-left:5px;
}
.xdsoft_datetimepicker .xdsoft_next{
float: right;
background-position: 0 0;
}
.xdsoft_datetimepicker .xdsoft_next,
.xdsoft_datetimepicker .xdsoft_prev ,
.xdsoft_datetimepicker .xdsoft_today_button{
background-color: transparent;
background-repeat: no-repeat;
border: 0 none currentColor;
cursor: pointer;
display: block;
height: 30px;
opacity: 0.5;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
outline: medium none currentColor;
overflow: hidden;
padding: 0;
position: relative;
text-indent: 100%;
white-space: nowrap;
width: 20px;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next{
float:none;
background-position:-40px -15px;
height: 15px;
width: 30px;
display: block;
margin-left:14px;
margin-top:7px;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{
background-position:-40px 0;
margin-bottom:7px;
margin-top: 0;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box{
height:151px;
overflow:hidden;
border-bottom:1px solid #DDDDDD;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div{
background: #F5F5F5;
border-top:1px solid #DDDDDD;
color: #666666;
font-size: 12px;
text-align: center;
border-collapse:collapse;
cursor:pointer;
border-bottom-width: 0;
height:25px;
line-height:25px;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child{
border-top-width: 0;
}
.xdsoft_datetimepicker .xdsoft_today_button:hover,
.xdsoft_datetimepicker .xdsoft_next:hover,
.xdsoft_datetimepicker .xdsoft_prev:hover {
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}
.xdsoft_datetimepicker .xdsoft_label{
display: inline;
position: relative;
z-index: 9999;
margin: 0;
padding: 5px 3px;
font-size: 14px;
line-height: 20px;
font-weight: bold;
background-color: #fff;
float:left;
width:182px;
text-align:center;
cursor:pointer;
}
.xdsoft_datetimepicker .xdsoft_label:hover>span{
text-decoration:underline;
}
.xdsoft_datetimepicker .xdsoft_label:hover i{
opacity:1.0;
}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select{
border:1px solid #ccc;
position:absolute;
right: 0;
top:30px;
z-index:101;
display:none;
background:#fff;
max-height:160px;
overflow-y:hidden;
}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{right:-7px;}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{right:2px;}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover{
color: #fff;
background: #ff8000;
}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option{
padding:2px 10px 2px 5px;
text-decoration:none !important;
}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current{
background: #33AAFF;
box-shadow: #178FE5 0 1px 3px 0 inset;
color:#fff;
font-weight: 700;
}
.xdsoft_datetimepicker .xdsoft_month{
width:100px;
text-align:right;
}
.xdsoft_datetimepicker .xdsoft_calendar{
clear:both;
}
.xdsoft_datetimepicker .xdsoft_year{
width: 48px;
margin-left: 5px;
}
.xdsoft_datetimepicker .xdsoft_calendar table{
border-collapse:collapse;
width:100%;
}
.xdsoft_datetimepicker .xdsoft_calendar td > div{
padding-right:5px;
}
.xdsoft_datetimepicker .xdsoft_calendar th{
height: 25px;
}
.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th{
width:14.2857142%;
background: #F5F5F5;
border:1px solid #DDDDDD;
color: #666666;
font-size: 12px;
text-align: right;
vertical-align: middle;
padding: 0;
border-collapse:collapse;
cursor:pointer;
height: 25px;
}
.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th{
width:12.5%;
}
.xdsoft_datetimepicker .xdsoft_calendar th{
background: #F1F1F1;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today{
color:#33AAFF;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current{
background: #33AAFF;
box-shadow: #178FE5 0 1px 3px 0 inset;
color:#fff;
font-weight: 700;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,
.xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled{
opacity:0.5;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled{
opacity:0.2;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
}
.xdsoft_datetimepicker .xdsoft_calendar td:hover,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover{
color: #fff !important;
background: #ff8000 !important;
box-shadow: none !important;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover{
color: inherit !important;
background: inherit !important;
box-shadow: inherit !important;
}
.xdsoft_datetimepicker .xdsoft_calendar th{
font-weight: 700;
text-align: center;
color: #999;
cursor:default;
}
.xdsoft_datetimepicker .xdsoft_copyright{ color:#ccc !important; font-size:10px;clear:both;float:none;margin-left:8px;}
.xdsoft_datetimepicker .xdsoft_copyright a{ color:#eee !important;}
.xdsoft_datetimepicker .xdsoft_copyright a:hover{ color:#aaa !important;}
.xdsoft_time_box{
position:relative;
border:1px solid #ccc;
}
.xdsoft_scrollbar >.xdsoft_scroller{
background:#ccc !important;
height:20px;
border-radius:3px;
}
.xdsoft_scrollbar{
position:absolute;
width:7px;
right: 0;
top: 0;
bottom: 0;
cursor:pointer;
}
.xdsoft_scroller_box{
position:relative;
}
.xdsoft_datetimepicker.xdsoft_dark{
box-shadow: 0 5px 15px -5px rgba(255, 255, 255, 0.506);
background: #000000;
border-bottom: 1px solid #444444;
border-left: 1px solid #333333;
border-right: 1px solid #333333;
border-top: 1px solid #333333;
color: #cccccc;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box{
border-bottom:1px solid #222222;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div{
background: #0a0a0a;
border-top:1px solid #222222;
color: #999999;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label{
background-color: #000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select{
border:1px solid #333;
background:#000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover{
color: #000;
background: #007fff;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current{
background: #cc5500;
box-shadow: #b03e00 0 1px 3px 0 inset;
color:#000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==);
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{
background: #0a0a0a;
border:1px solid #222222;
color: #999999;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{
background: #0e0e0e;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today{
color:#cc5500;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current{
background: #cc5500;
box-shadow: #b03e00 0 1px 3px 0 inset;
color:#000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div:hover{
color: #000 !important;
background: #007fff !important;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{
color: #666;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright{ color:#333 !important;}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a{ color:#111 !important;}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover{ color:#555 !important;}
.xdsoft_dark .xdsoft_time_box{
border:1px solid #333;
}
.xdsoft_dark .xdsoft_scrollbar >.xdsoft_scroller{
background:#333 !important;
}

File diff suppressed because one or more lines are too long

1
public/theme/admin/js/excanvas.min.js vendored Executable file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,692 @@
<?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'], './') === 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'], './') === 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="http://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 (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 '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 = stripslashes(htmlspecialchars(file_get_contents($selected_file)));
$ret = '';
if ( ! in_array($info['extension'],$previewable_text_file_exts_no_prettify))
{
$ret .= '<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang='.$info['extension'].'&skin=sunburst"></script>';
$ret .= '<pre class="prettyprint">'.$data.'</pre>';
} else {
$ret .= '<pre class="no-prettify">'.$data.'</pre>';
}
}
// elseif ($preview_mode == 'viewerjs') {
// if($ftp){
// $ret = '<iframe id="viewer" src="'.$selected_file.'" allowfullscreen="" webkitallowfullscreen="" class="viewer-iframe"></iframe>';
// }else{
// $ret = '<iframe id="viewer" src="js/ViewerJS/#../../'.$selected_file.'" allowfullscreen="" webkitallowfullscreen="" class="viewer-iframe"></iframe>';
// }
// }
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=\"http://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

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,30 @@
[26-Nov-2016 21:09:04 Europe/Rome] PHP Notice: Undefined index: language in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 33
[26-Nov-2016 21:09:04 Europe/Rome] PHP Warning: scandir(../source/): failed to open dir: No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:09:04 Europe/Rome] PHP Warning: scandir(): (errno 2): No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:09:04 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 543
[26-Nov-2016 21:09:04 Europe/Rome] PHP Notice: Undefined variable: files_prevent_duplicate in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:09:04 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:10:56 Europe/Rome] PHP Warning: scandir(../source/): failed to open dir: No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:10:56 Europe/Rome] PHP Warning: scandir(): (errno 2): No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:10:56 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 543
[26-Nov-2016 21:10:56 Europe/Rome] PHP Notice: Undefined variable: files_prevent_duplicate in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:10:56 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:11:23 Europe/Rome] PHP Warning: scandir(../source/): failed to open dir: No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:11:23 Europe/Rome] PHP Warning: scandir(): (errno 2): No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:11:23 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 543
[26-Nov-2016 21:11:23 Europe/Rome] PHP Notice: Undefined variable: files_prevent_duplicate in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:11:23 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:13:04 Europe/Rome] PHP Warning: scandir(../../../images/): failed to open dir: No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:13:04 Europe/Rome] PHP Warning: scandir(): (errno 2): No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:13:04 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 543
[26-Nov-2016 21:13:04 Europe/Rome] PHP Notice: Undefined variable: files_prevent_duplicate in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:13:04 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:13:08 Europe/Rome] PHP Warning: scandir(../../../images/): failed to open dir: No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:13:08 Europe/Rome] PHP Warning: scandir(): (errno 2): No such file or directory in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 531
[26-Nov-2016 21:13:08 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 543
[26-Nov-2016 21:13:08 Europe/Rome] PHP Notice: Undefined variable: files_prevent_duplicate in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 21:13:08 Europe/Rome] PHP Warning: Invalid argument supplied for foreach() in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 1089
[26-Nov-2016 22:17:23 Europe/Rome] PHP Notice: Undefined index: language in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 33
[27-Nov-2016 13:04:09 Europe/Rome] PHP Notice: Undefined index: language in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 33
[27-Nov-2016 14:15:35 Europe/Rome] PHP Notice: Undefined index: language in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 33
[17-Dec-2016 21:46:33 Europe/Rome] PHP Notice: Undefined index: language in /home/theloxie/public_html/betahoosk/theme/admin/js/filemanager/dialog.php on line 33

View File

@@ -0,0 +1,522 @@
<?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)
{
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)
{
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,149 @@
<?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
)
{
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: 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: 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: 1.7 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.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: 1.5 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: 2.6 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.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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