From 145c3f5147f450070e076024078a00583c7542e0 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 26 Jan 2016 15:31:53 +0100 Subject: [PATCH] Namespaces, Plugins via Namespaces, API entry file renamned, Settings::set() --- .gitignore | 7 +- dist/main.js | 4 +- dist/view.js | 2 +- php/access/Access.php | 11 +- php/access/Admin.php | 14 +- php/access/Guest.php | 12 +- php/access/Installation.php | 10 +- php/autoload.php | 22 +-- php/define.php | 5 - php/helpers/fastImageCopyResampled.php | 35 ++++ php/helpers/getExtension.php | 13 ++ php/helpers/getGraphHeader.php | 47 ++++++ php/helpers/getHashedString.php | 31 ++++ php/helpers/hasPermissions.php | 14 ++ php/helpers/search.php | 63 ++++++++ php/{api.php => index.php} | 25 ++- php/misc.php | 195 ----------------------- php/modules/Album.php | 7 +- php/modules/Config.php | 7 +- php/modules/Database.php | 9 +- php/modules/Import.php | 7 +- php/modules/Log.php | 7 +- php/modules/Module.php | 7 +- php/modules/Photo.php | 11 +- php/modules/Plugins.php | 9 +- php/modules/Session.php | 7 +- php/modules/Settings.php | 66 ++++---- plugins/{check => Diagnostics}/index.php | 18 ++- plugins/{displaylog => Log}/index.php | 34 ++-- src/scripts/api.js | 2 +- src/scripts/contextMenu.js | 4 +- 31 files changed, 332 insertions(+), 373 deletions(-) create mode 100644 php/helpers/fastImageCopyResampled.php create mode 100644 php/helpers/getExtension.php create mode 100644 php/helpers/getGraphHeader.php create mode 100644 php/helpers/getHashedString.php create mode 100644 php/helpers/hasPermissions.php create mode 100755 php/helpers/search.php rename php/{api.php => index.php} (76%) delete mode 100755 php/misc.php rename plugins/{check => Diagnostics}/index.php (97%) rename plugins/{displaylog => Log}/index.php (65%) diff --git a/.gitignore b/.gitignore index 254c796..7763479 100644 --- a/.gitignore +++ b/.gitignore @@ -7,12 +7,13 @@ uploads/big/* uploads/import/* uploads/medium/* uploads/thumb/* -plugins/* !uploads/big/index.html !uploads/import/index.html !uploads/medium/index.html !uploads/thumb/index.html -!plugins/check/ -!plugins/displaylog/ \ No newline at end of file +plugins/* + +!plugins/Diagnostics/ +!plugins/Log/ \ No newline at end of file diff --git a/dist/main.js b/dist/main.js index 7fc8c45..56ab192 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1,7 +1,7 @@ function _taggedTemplateLiteral(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gup(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),o=n.exec(window.location.href);return null===o?"":o[1]}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=ae.type(e);return"function"===n||ae.isWindow(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function o(e,t,n){if(ae.isFunction(t))return ae.grep(e,function(e,o){return!!t.call(e,o,e)!==n});if(t.nodeType)return ae.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(me.test(t))return ae.filter(t,e,n);t=ae.filter(t,e)}return ae.grep(e,function(e){return J.call(t,e)>-1!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t={};return ae.each(e.match(xe)||[],function(e,n){t[n]=!0}),t}function r(){V.removeEventListener("DOMContentLoaded",r),e.removeEventListener("load",r),ae.ready()}function s(){this.expando=ae.expando+s.uid++}function l(e,t,n){var o;if(void 0===n&&1===e.nodeType)if(o="data-"+t.replace($e,"-$&").toLowerCase(),n=e.getAttribute(o),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Ce.test(n)?ae.parseJSON(n):n}catch(i){}ke.set(e,t,n)}else n=void 0;return n}function u(e,t,n,o){var i,a=1,r=20,s=o?function(){return o.cur()}:function(){return ae.css(e,t,"")},l=s(),u=n&&n[3]||(ae.cssNumber[t]?"":"px"),c=(ae.cssNumber[t]||"px"!==u&&+l)&&Ae.exec(ae.css(e,t));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do a=a||".5",c/=a,ae.style(e,t,c+u);while(a!==(a=s()/l)&&1!==a&&--r)}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],o&&(o.unit=u,o.start=c,o.end=i)),i}function c(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&ae.nodeName(e,t)?ae.merge([e],n):n}function d(e,t){for(var n=0,o=e.length;o>n;n++)Me.set(e[n],"globalEval",!t||Me.get(t[n],"globalEval"))}function p(e,t,n,o,i){for(var a,r,s,l,u,p,h=t.createDocumentFragment(),f=[],m=0,b=e.length;b>m;m++)if(a=e[m],a||0===a)if("object"===ae.type(a))ae.merge(f,a.nodeType?[a]:a);else if(Ne.test(a)){for(r=r||h.appendChild(t.createElement("div")),s=(Pe.exec(a)||["",""])[1].toLowerCase(),l=Oe[s]||Oe._default,r.innerHTML=l[1]+ae.htmlPrefilter(a)+l[2],p=l[0];p--;)r=r.lastChild;ae.merge(f,r.childNodes),r=h.firstChild,r.textContent=""}else f.push(t.createTextNode(a));for(h.textContent="",m=0;a=f[m++];)if(o&&ae.inArray(a,o)>-1)i&&i.push(a);else if(u=ae.contains(a.ownerDocument,a),r=c(h.appendChild(a),"script"),u&&d(r),n)for(p=0;a=r[p++];)Ie.test(a.type||"")&&n.push(a);return h}function h(){return!0}function f(){return!1}function m(){try{return V.activeElement}catch(e){}}function b(e,t,n,o,i,a){var r,s;if("object"==typeof t){"string"!=typeof n&&(o=o||n,n=void 0);for(s in t)b(e,s,n,o,t[s],a);return e}if(null==o&&null==i?(i=n,o=n=void 0):null==i&&("string"==typeof n?(i=o,o=void 0):(i=o,o=n,n=void 0)),i===!1)i=f;else if(!i)return this;return 1===a&&(r=i,i=function(e){return ae().off(e),r.apply(this,arguments)},i.guid=r.guid||(r.guid=ae.guid++)),e.each(function(){ae.event.add(this,t,i,o,n)})}function g(e,t){return ae.nodeName(e,"table")&&ae.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function v(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function y(e){var t=We.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){var n,o,i,a,r,s,l,u;if(1===t.nodeType){if(Me.hasData(e)&&(a=Me.access(e),r=Me.set(t,a),u=a.events)){delete r.handle,r.events={};for(i in u)for(n=0,o=u[i].length;o>n;n++)ae.event.add(t,i,u[i][n])}ke.hasData(e)&&(s=ke.access(e),l=ae.extend({},s),ke.set(t,l))}}function x(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Le.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function _(e,t,n,o){t=Z.apply([],t);var i,a,r,s,l,u,d=0,h=e.length,f=h-1,m=t[0],b=ae.isFunction(m);if(b||h>1&&"string"==typeof m&&!oe.checkClone&&Be.test(m))return e.each(function(i){var a=e.eq(i);b&&(t[0]=m.call(this,i,a.html())),_(a,t,n,o)});if(h&&(i=p(t,e[0].ownerDocument,!1,e,o),a=i.firstChild,1===i.childNodes.length&&(i=a),a||o)){for(r=ae.map(c(i,"script"),v),s=r.length;h>d;d++)l=i,d!==f&&(l=ae.clone(l,!0,!0),s&&ae.merge(r,c(l,"script"))),n.call(e[d],l,d);if(s)for(u=r[r.length-1].ownerDocument,ae.map(r,y),d=0;s>d;d++)l=r[d],Ie.test(l.type||"")&&!Me.access(l,"globalEval")&&ae.contains(u,l)&&(l.src?ae._evalUrl&&ae._evalUrl(l.src):ae.globalEval(l.textContent.replace(Xe,"")))}return e}function j(e,t,n){for(var o,i=t?ae.filter(t,e):e,a=0;null!=(o=i[a]);a++)n||1!==o.nodeType||ae.cleanData(c(o)),o.parentNode&&(n&&ae.contains(o.ownerDocument,o)&&d(c(o,"script")),o.parentNode.removeChild(o));return e}function T(e,t){var n=ae(t.createElement(e)).appendTo(t.body),o=ae.css(n[0],"display");return n.detach(),o}function M(e){var t=V,n=Ye[e];return n||(n=T(e,t),"none"!==n&&n||(ze=(ze||ae("