' +
+ '
' +
+ ' ' +
+ ' ' +
+ '
' +
+ ' ' +
+ ' ' +
+ ' ' +
+ '',
+ statusHintTemplate = '
',
- update = function (item) {
+ update = function (item) {
- var $html = $(template),
- $indicator = $html.find('.indicator'),
- $a = $html.find('a'),
- $img = $html.find('.icon img'),
- $label = $html.find('.label');
+ var $html = $(template),
+ $indicator = $html.find('.indicator'),
+ $a = $html.find('a'),
+ $img = $html.find('.icon img'),
+ $label = $html.find('.label');
- $html
- .addClass(item.isFolder() ? 'folder' : 'file')
- .data('item', item);
+ $html
+ .addClass(item.isFolder() ? 'folder' : 'file')
+ .data('item', item);
- location.setLink($a, item);
- $img.attr('src', resource.image('folder'));
- $label.text(item.label);
+ location.setLink($a, item);
+ $img.attr('src', resource.image('folder'));
+ $label.text(item.label);
- if (item.isFolder()) {
+ if (item.isFolder()) {
- var subfolders = item.getSubfolders();
+ var subfolders = item.getSubfolders();
- // indicator
- if ((item.isManaged && !item.isContentFetched) || subfolders.length) {
+ // indicator
+ if ((item.isManaged && !item.isContentFetched) || subfolders.length) {
- $indicator.removeClass('none');
+ $indicator.removeClass('none');
- if ((item.isManaged && !item.isContentFetched)) {
- $indicator.addClass('unknown');
- } else if (item.isContentVisible) {
- $indicator.addClass('open');
- } else {
- $indicator.addClass('close');
- }
- }
+ if ((item.isManaged && !item.isContentFetched)) {
+ $indicator.addClass('unknown');
+ } else if (item.isContentVisible) {
+ $indicator.addClass('open');
+ } else {
+ $indicator.addClass('close');
+ }
+ }
- // is it the domain?
- if (item.isDomain()) {
- $html.addClass('domain');
- $img.attr('src', resource.image('home'));
- }
+ // is it the domain?
+ if (item.isDomain()) {
+ $html.addClass('domain');
+ $img.attr('src', resource.image('home'));
+ }
- // is it the root?
- if (item.isRoot()) {
- $html.addClass('root');
- $img.attr('src', resource.image('home'));
- }
+ // is it the root?
+ if (item.isRoot()) {
+ $html.addClass('root');
+ $img.attr('src', resource.image('home'));
+ }
- // is it the current folder?
- if (item.isCurrentFolder()) {
- $html.addClass('current');
- // $img.attr('src', resource.image('folder-open'));
- }
+ // is it the current folder?
+ if (item.isCurrentFolder()) {
+ $html.addClass('current');
+ // $img.attr('src', resource.image('folder-open'));
+ }
- // does it have subfolders?
- if (subfolders.length) {
- var $ul = $('
').appendTo($html),
- counter = 0;
- _.each(subfolders, function (e) {
- counter += 1;
- if (counter <= settings.maxSubfolders) {
- $('
').append(update(e)).appendTo($ul);
- }
- });
- if (subfolders.length > settings.maxSubfolders) {
- $('
… ' + (subfolders.length - settings.maxSubfolders) + ' more subfolders ').appendTo($ul);
- }
- if (!item.isContentVisible) {
- $ul.hide();
- }
- }
+ // does it have subfolders?
+ if (subfolders.length) {
+ var $ul = $('
').appendTo($html),
+ counter = 0;
+ _.each(subfolders, function (e) {
+ counter += 1;
+ if (counter <= settings.maxSubfolders) {
+ $('
').append(update(e)).appendTo($ul);
+ }
+ });
+ if (subfolders.length > settings.maxSubfolders) {
+ $('
… ' + (subfolders.length - settings.maxSubfolders) + ' more subfolders ').appendTo($ul);
+ }
+ if (!item.isContentVisible) {
+ $ul.hide();
+ }
+ }
- // reflect folder status
- if (!item.isManaged) {
- $img.attr('src', resource.image('folder-page'));
- }
- }
+ // reflect folder status
+ if (!item.isManaged) {
+ $img.attr('src', resource.image('folder-page'));
+ }
+ }
- if (item.$tree) {
- item.$tree.replaceWith($html);
- }
- item.$tree = $html;
+ if (item.$tree) {
+ item.$tree.replaceWith($html);
+ }
+ item.$tree = $html;
- return $html;
- },
+ return $html;
+ },
- createOnIndicatorClick = function () {
+ createOnIndicatorClick = function () {
- var $tree = $('#tree'),
- slide = function (item, $indicator, $content, down) {
+ var $tree = $('#tree'),
+ slide = function (item, $indicator, $content, down) {
- item.isContentVisible = down;
- $indicator.removeClass('open close').addClass(down ? 'open' : 'close');
- $tree.scrollpanel('update', true);
- $content[down ? 'slideDown' : 'slideUp'](function () {
+ item.isContentVisible = down;
+ $indicator.removeClass('open close').addClass(down ? 'open' : 'close');
+ $tree.scrollpanel('update', true);
+ $content[down ? 'slideDown' : 'slideUp'](function () {
- $tree.scrollpanel('update');
- });
- };
+ $tree.scrollpanel('update');
+ });
+ };
- return function () {
+ return function () {
- var $indicator = $(this),
- $item = $indicator.closest('.item'),
- item = $item.data('item'),
- $content = $item.find('> ul.content');
+ var $indicator = $(this),
+ $item = $indicator.closest('.item'),
+ item = $item.data('item'),
+ $content = $item.find('> ul.content');
- if ($indicator.hasClass('unknown')) {
+ if ($indicator.hasClass('unknown')) {
- item.fetchContent(function (item) {
+ item.fetchContent(function (item) {
- item.isContentVisible = false;
+ item.isContentVisible = false;
- var $item = update(item),
- $indicator = $item.find('> .indicator'),
- $content = $item.find('> ul.content');
+ var $item = update(item),
+ $indicator = $item.find('> .indicator'),
+ $content = $item.find('> ul.content');
- if (!$indicator.hasClass('none')) {
- slide(item, $indicator, $content, true);
- }
- });
+ if (!$indicator.hasClass('none')) {
+ slide(item, $indicator, $content, true);
+ }
+ });
- } else if ($indicator.hasClass('open')) {
+ } else if ($indicator.hasClass('open')) {
- slide(item, $indicator, $content, false);
+ slide(item, $indicator, $content, false);
- } else if ($indicator.hasClass('close')) {
+ } else if ($indicator.hasClass('close')) {
- slide(item, $indicator, $content, true);
- }
- };
- },
+ slide(item, $indicator, $content, true);
+ }
+ };
+ },
- shiftTree = function (forceVisible, dontAnimate) {
+ shiftTree = function (forceVisible, dontAnimate) {
- var $tree = $("#tree"),
- $view = $("#view"),
- left = ((settings.slide && $tree.outerWidth() < $view.offset().left) || forceVisible || !$view.is(':visible')) ? 0 : 18 - $tree.outerWidth();
+ var $tree = $("#tree"),
+ $view = $("#view"),
+ left = ((settings.slide && $tree.outerWidth() < $view.offset().left) || forceVisible || !$view.is(':visible')) ? 0 : 18 - $tree.outerWidth();
- if (dontAnimate) {
- $tree.stop().css({ left: left });
- } else {
- $tree.stop().animate({ left: left });
- }
- },
+ if (dontAnimate) {
+ $tree.stop().css({ left: left });
+ } else {
+ $tree.stop().animate({ left: left });
+ }
+ },
- fetchTree = function (item, callback) {
+ fetchTree = function (item, callback) {
- item.isContentVisible = true;
- item.fetchContent(function (item) {
+ item.isContentVisible = true;
+ item.fetchContent(function (item) {
- if (item.parent) {
- fetchTree(item.parent, callback);
- } else {
- callback(item);
- }
- });
- },
+ if (item.parent) {
+ fetchTree(item.parent, callback);
+ } else {
+ callback(item);
+ }
+ });
+ },
- adjustSpacing = function () {
+ adjustSpacing = function () {
- var $tree = $('#tree'),
- winHeight = $(window).height(),
- navHeight = $('#topbar').outerHeight(),
- footerHeight = $('#bottombar').outerHeight();
+ var $tree = $('#tree'),
+ winHeight = $(window).height(),
+ navHeight = $('#topbar').outerHeight(),
+ footerHeight = $('#bottombar').outerHeight();
- $tree.css({
- top: navHeight,
- height: winHeight - navHeight - footerHeight - 16
- });
+ $tree.css({
+ top: navHeight,
+ height: winHeight - navHeight - footerHeight - 16
+ });
- $tree.scrollpanel('update');
- },
+ $tree.scrollpanel('update');
+ },
- onLocationChanged = function (item) {
+ onLocationChanged = function (item) {
- fetchTree(item, function (root) {
+ fetchTree(item, function (root) {
- $('#tree')
- .find('.sp-container').append(update(root)).end()
- .show();
- adjustSpacing();
- shiftTree(false, true);
- });
- },
+ $('#tree')
+ .find('.sp-container').append(update(root)).end()
+ .show();
+ adjustSpacing();
+ shiftTree(false, true);
+ });
+ },
- init = function () {
+ init = function () {
- if (!settings.enabled) {
- return;
- }
+ if (!settings.enabled) {
+ return;
+ }
- var $tree = $('
')
- .appendTo('body')
- .scrollpanel()
- .on('click', '.indicator', createOnIndicatorClick())
- .on('mouseenter', function () {
+ var $tree = $('
')
+ .appendTo('body')
+ .scrollpanel()
+ .on('click', '.indicator', createOnIndicatorClick())
+ .on('mouseenter', function () {
- shiftTree(true);
- })
- .on('mouseleave', function () {
+ shiftTree(true);
+ })
+ .on('mouseleave', function () {
- shiftTree();
- });
+ shiftTree();
+ });
- event.sub('ready', adjustSpacing);
- event.sub('location.changed', onLocationChanged);
+ event.sub('ready', adjustSpacing);
+ event.sub('location.changed', onLocationChanged);
- $(window).on('resize', function () {
+ $(window).on('resize', function () {
- adjustSpacing();
- shiftTree();
- });
- };
+ adjustSpacing();
+ shiftTree();
+ });
+ };
- init();
+ init();
});
diff --git a/src/_h5ai/client/js/inc/info.js b/src/_h5ai/client/js/inc/info.js
index bd572065..470dd8fc 100644
--- a/src/_h5ai/client/js/inc/info.js
+++ b/src/_h5ai/client/js/inc/info.js
@@ -1,178 +1,178 @@
modulejs.define('info', ['$', 'config'], function ($, config) {
- var testsTemp =
- '
',
+ var testsTemp =
+ '
',
- testTemp =
- '
' +
- ' ' +
- ' ' +
- '
' +
- ' ',
+ testTemp =
+ '
' +
+ ' ' +
+ ' ' +
+ '
' +
+ ' ',
- loginTemp =
- '
' +
- '
' +
- '
login ' +
- '
logout ' +
- '
' +
- 'The preset password is the empty string, so just hit login. ' +
- 'You might change it in the index file to keep this information private.' +
- '
' +
- '
',
+ loginTemp =
+ '
' +
+ '
' +
+ '
login ' +
+ '
logout ' +
+ '
' +
+ 'The preset password is the empty string, so just hit login. ' +
+ 'You might change it in the index file to keep this information private.' +
+ '
' +
+ '
',
- setup = config.setup,
+ setup = config.setup,
- addTests = function () {
+ addTests = function () {
- var addTest = function (label, info, passed, result) {
+ var addTest = function (label, info, passed, result) {
- $(testTemp)
- .find('.label')
- .text(label)
- .end()
- .find('.result')
- .addClass(passed ? 'passed' : 'failed')
- .text(result ? result : (passed ? 'yes' : 'no'))
- .end()
- .find('.info')
- .html(info)
- .end()
- .appendTo('#tests');
- };
+ $(testTemp)
+ .find('.label')
+ .text(label)
+ .end()
+ .find('.result')
+ .addClass(passed ? 'passed' : 'failed')
+ .text(result ? result : (passed ? 'yes' : 'no'))
+ .end()
+ .find('.info')
+ .html(info)
+ .end()
+ .appendTo('#tests');
+ };
- $(testsTemp).appendTo('body');
+ $(testsTemp).appendTo('body');
- addTest(
- 'Index file found', 'Add
' + setup.INDEX_HREF + '
to your index file list',
- setup.INDEX_HREF
- );
+ addTest(
+ 'Index file found', 'Add
' + setup.INDEX_HREF + '
to your index file list',
+ setup.INDEX_HREF
+ );
- addTest(
- 'Options parsable', 'File
options.json
is readable and syntax is correct',
- config.options !== null
- );
+ addTest(
+ 'Options parsable', 'File
options.json
is readable and syntax is correct',
+ config.options !== null
+ );
- addTest(
- 'Types parsable', 'File
types.json
is readable and syntax is correct',
- config.types !== null
- );
+ addTest(
+ 'Types parsable', 'File
types.json
is readable and syntax is correct',
+ config.types !== null
+ );
- addTest(
- 'Server software', 'Server is one of apache, lighttpd, nginx or cherokee',
- setup.HAS_SERVER, setup.SERVER_NAME + ' ' + setup.SERVER_VERSION
- );
+ addTest(
+ 'Server software', 'Server is one of apache, lighttpd, nginx or cherokee',
+ setup.HAS_SERVER, setup.SERVER_NAME + ' ' + setup.SERVER_VERSION
+ );
- addTest(
- 'PHP version', 'PHP version >= ' + setup.MIN_PHP_VERSION,
- setup.HAS_PHP_VERSION, setup.PHP_VERSION
- );
+ addTest(
+ 'PHP version', 'PHP version >= ' + setup.MIN_PHP_VERSION,
+ setup.HAS_PHP_VERSION, setup.PHP_VERSION
+ );
- addTest(
- 'Cache directory', 'Web server has write access',
- setup.HAS_WRITABLE_CACHE
- );
+ addTest(
+ 'Cache directory', 'Web server has write access',
+ setup.HAS_WRITABLE_CACHE
+ );
- addTest(
- 'Image thumbs', 'PHP GD extension with JPEG support available',
- setup.HAS_PHP_JPG
- );
+ addTest(
+ 'Image thumbs', 'PHP GD extension with JPEG support available',
+ setup.HAS_PHP_JPG
+ );
- addTest(
- 'Use EXIF thumbs', 'PHP EXIF extension available',
- setup.HAS_PHP_EXIF
- );
+ addTest(
+ 'Use EXIF thumbs', 'PHP EXIF extension available',
+ setup.HAS_PHP_EXIF
+ );
- addTest(
- 'Movie thumbs', 'Command line program
avconv
or
ffmpeg
available',
- setup.HAS_CMD_AVCONV || setup.HAS_CMD_FFMPEG
- );
+ addTest(
+ 'Movie thumbs', 'Command line program
avconv
or
ffmpeg
available',
+ setup.HAS_CMD_AVCONV || setup.HAS_CMD_FFMPEG
+ );
- addTest(
- 'PDF thumbs', 'Command line program
convert
available',
- setup.HAS_CMD_CONVERT
- );
+ addTest(
+ 'PDF thumbs', 'Command line program
convert
available',
+ setup.HAS_CMD_CONVERT
+ );
- addTest(
- 'Shell tar', 'Command line program
tar
available',
- setup.HAS_CMD_TAR
- );
+ addTest(
+ 'Shell tar', 'Command line program
tar
available',
+ setup.HAS_CMD_TAR
+ );
- addTest(
- 'Shell zip', 'Command line program
zip
available',
- setup.HAS_CMD_ZIP
- );
+ addTest(
+ 'Shell zip', 'Command line program
zip
available',
+ setup.HAS_CMD_ZIP
+ );
- addTest(
- 'Shell du', 'Command line program
du
available',
- setup.HAS_CMD_DU
- );
- },
+ addTest(
+ 'Shell du', 'Command line program
du
available',
+ setup.HAS_CMD_DU
+ );
+ },
- addLogin = function () {
+ addLogin = function () {
- var request = function (data) {
+ var request = function (data) {
- $.ajax({
- url: 'server/php/index.php',
- type: 'POST',
- dataType: 'JSON',
- data: data
- })
- .always(function () {
+ $.ajax({
+ url: 'server/php/index.php',
+ type: 'POST',
+ dataType: 'JSON',
+ data: data
+ })
+ .always(function () {
- window.location.reload();
- });
- },
+ window.location.reload();
+ });
+ },
- onLogin = function () {
+ onLogin = function () {
- request({
- 'action': 'login',
- 'pass': $('#pass').val()
- });
- },
+ request({
+ 'action': 'login',
+ 'pass': $('#pass').val()
+ });
+ },
- onLogout = function () {
+ onLogout = function () {
- request({
- 'action': 'logout'
- });
- },
+ request({
+ 'action': 'logout'
+ });
+ },
- onKeydown = function (event) {
+ onKeydown = function (event) {
- if (event.which === 13) {
- onLogin();
- }
- };
+ if (event.which === 13) {
+ onLogin();
+ }
+ };
- $(loginTemp).appendTo('body');
+ $(loginTemp).appendTo('body');
- if (setup.AS_ADMIN) {
- $('#pass').remove();
- $('#login').remove();
- $('#logout').on('click', onLogout);
- } else {
- $('#pass').on('keydown', onKeydown).focus();
- $('#login').on('click', onLogin);
- $('#logout').remove();
- }
- if (setup.HAS_CUSTOM_PASSHASH) {
- $('#hint').remove();
- }
- },
+ if (setup.AS_ADMIN) {
+ $('#pass').remove();
+ $('#login').remove();
+ $('#logout').on('click', onLogout);
+ } else {
+ $('#pass').on('keydown', onKeydown).focus();
+ $('#login').on('click', onLogin);
+ $('#logout').remove();
+ }
+ if (setup.HAS_CUSTOM_PASSHASH) {
+ $('#hint').remove();
+ }
+ },
- init = function () {
+ init = function () {
- addLogin();
- if (setup.AS_ADMIN) {
- addTests();
- }
- };
+ addLogin();
+ if (setup.AS_ADMIN) {
+ addTests();
+ }
+ };
- init();
+ init();
});
diff --git a/src/_h5ai/client/js/inc/main.js b/src/_h5ai/client/js/inc/main.js
index c8521a76..4f86d6fd 100644
--- a/src/_h5ai/client/js/inc/main.js
+++ b/src/_h5ai/client/js/inc/main.js
@@ -1,17 +1,17 @@
modulejs.define('main', ['_', 'core/event'], function (_, event) {
- modulejs.require('view/ensure');
- modulejs.require('view/items');
- modulejs.require('view/spacing');
- modulejs.require('view/viewmode');
+ modulejs.require('view/ensure');
+ modulejs.require('view/items');
+ modulejs.require('view/spacing');
+ modulejs.require('view/viewmode');
- _.each(modulejs.state(), function (state, id) {
+ _.each(modulejs.state(), function (state, id) {
- if (/^ext\/.+/.test(id)) {
- modulejs.require(id);
- }
- });
+ if (/^ext\/.+/.test(id)) {
+ modulejs.require(id);
+ }
+ });
- event.pub('ready');
+ event.pub('ready');
});
diff --git a/src/_h5ai/client/js/inc/model/item.js b/src/_h5ai/client/js/inc/model/item.js
index d702221e..712a3580 100644
--- a/src/_h5ai/client/js/inc/model/item.js
+++ b/src/_h5ai/client/js/inc/model/item.js
@@ -2,248 +2,248 @@
modulejs.define('model/item', ['_', 'core/types', 'core/event', 'core/settings', 'core/server', 'core/location'], function (_, types, event, settings, server, location) {
- var reEndsWithSlash = /\/$/,
+ var reEndsWithSlash = /\/$/,
- startsWith = function (sequence, part) {
+ startsWith = function (sequence, part) {
- return sequence.slice && part.length && sequence.slice(0, part.length) === part;
- },
+ return sequence.slice && part.length && sequence.slice(0, part.length) === part;
+ },
- createLabel = function (sequence) {
+ createLabel = function (sequence) {
- sequence = sequence.replace(reEndsWithSlash, '');
- try { sequence = decodeURIComponent(sequence); } catch (e) {}
- return sequence;
- },
+ sequence = sequence.replace(reEndsWithSlash, '');
+ try { sequence = decodeURIComponent(sequence); } catch (e) {}
+ return sequence;
+ },
- reSplitPath = /^(.*\/)([^\/]+\/?)$/,
+ reSplitPath = /^(.*\/)([^\/]+\/?)$/,
- splitPath = function (sequence) {
+ splitPath = function (sequence) {
- if (sequence === '/') {
- return { parent: null, name: '/' };
- }
+ if (sequence === '/') {
+ return { parent: null, name: '/' };
+ }
- var match = reSplitPath.exec(sequence);
- if (match) {
- var split = { parent: match[1], name: match[2] };
+ var match = reSplitPath.exec(sequence);
+ if (match) {
+ var split = { parent: match[1], name: match[2] };
- if (split.parent && !startsWith(split.parent, settings.rootHref)) {
- split.parent = null;
- }
- return split;
- }
- },
+ if (split.parent && !startsWith(split.parent, settings.rootHref)) {
+ split.parent = null;
+ }
+ return split;
+ }
+ },
- cache = {},
+ cache = {},
- getItem = function (absHref, time, size, isManaged, isContentFetched, md5, sha1) {
+ getItem = function (absHref, time, size, isManaged, isContentFetched, md5, sha1) {
- absHref = location.forceEncoding(absHref);
+ absHref = location.forceEncoding(absHref);
- if (!startsWith(absHref, settings.rootHref)) {
- return null;
- }
+ if (!startsWith(absHref, settings.rootHref)) {
+ return null;
+ }
- var self = cache[absHref] || new Item(absHref);
+ var self = cache[absHref] || new Item(absHref);
- if (_.isNumber(time)) {
- self.time = time;
- }
- if (_.isNumber(size)) {
- self.size = size;
- }
- if (isManaged) {
- self.isManaged = true;
- }
- if (isContentFetched) {
- self.isContentFetched = true;
- }
- if (md5) {
- self.md5 = md5;
- }
- if (sha1) {
- self.sha1 = sha1;
- }
+ if (_.isNumber(time)) {
+ self.time = time;
+ }
+ if (_.isNumber(size)) {
+ self.size = size;
+ }
+ if (isManaged) {
+ self.isManaged = true;
+ }
+ if (isContentFetched) {
+ self.isContentFetched = true;
+ }
+ if (md5) {
+ self.md5 = md5;
+ }
+ if (sha1) {
+ self.sha1 = sha1;
+ }
- return self;
- },
+ return self;
+ },
- removeItem = function (absHref) {
+ removeItem = function (absHref) {
- absHref = location.forceEncoding(absHref);
+ absHref = location.forceEncoding(absHref);
- var self = cache[absHref];
+ var self = cache[absHref];
- if (self) {
- delete cache[absHref];
- if (self.parent) {
- delete self.parent.content[self.absHref];
- }
- _.each(self.content, function (item) {
+ if (self) {
+ delete cache[absHref];
+ if (self.parent) {
+ delete self.parent.content[self.absHref];
+ }
+ _.each(self.content, function (item) {
- removeItem(item.absHref);
- });
- }
- },
+ removeItem(item.absHref);
+ });
+ }
+ },
- fetchContent = function (absHref, callback) {
+ fetchContent = function (absHref, callback) {
- var self = getItem(absHref);
+ var self = getItem(absHref);
- if (!_.isFunction(callback)) {
- callback = function () {};
- }
+ if (!_.isFunction(callback)) {
+ callback = function () {};
+ }
- if (self.isContentFetched) {
- callback(self);
- } else {
- server.request({action: 'get', items: true, itemsHref: self.absHref, itemsWhat: 1}, function (response) {
+ if (self.isContentFetched) {
+ callback(self);
+ } else {
+ server.request({action: 'get', items: true, itemsHref: self.absHref, itemsWhat: 1}, function (response) {
- if (response.items) {
- _.each(response.items, function (item) {
- getItem(item.absHref, item.time, item.size, item.is_managed, item.content, item.md5, item.sha1);
- });
- }
+ if (response.items) {
+ _.each(response.items, function (item) {
+ getItem(item.absHref, item.time, item.size, item.is_managed, item.content, item.md5, item.sha1);
+ });
+ }
- callback(self);
- });
- }
- };
+ callback(self);
+ });
+ }
+ };
- var Item = function (absHref) {
+ var Item = function (absHref) {
- var split = splitPath(absHref);
+ var split = splitPath(absHref);
- cache[absHref] = this;
+ cache[absHref] = this;
- this.absHref = absHref;
- this.type = types.getType(absHref);
- this.label = createLabel(absHref === '/' ? location.getDomain() : split.name);
- this.time = null;
- this.size = null;
- this.parent = null;
- this.isManaged = null;
- this.content = {};
+ this.absHref = absHref;
+ this.type = types.getType(absHref);
+ this.label = createLabel(absHref === '/' ? location.getDomain() : split.name);
+ this.time = null;
+ this.size = null;
+ this.parent = null;
+ this.isManaged = null;
+ this.content = {};
- if (split.parent) {
- this.parent = getItem(split.parent);
- this.parent.content[this.absHref] = this;
- if (_.keys(this.parent.content).length > 1) {
- this.parent.isContentFetched = true;
- }
- }
- };
+ if (split.parent) {
+ this.parent = getItem(split.parent);
+ this.parent.content[this.absHref] = this;
+ if (_.keys(this.parent.content).length > 1) {
+ this.parent.isContentFetched = true;
+ }
+ }
+ };
- _.extend(Item.prototype, {
+ _.extend(Item.prototype, {
- isFolder: function () {
+ isFolder: function () {
- return reEndsWithSlash.test(this.absHref);
- },
+ return reEndsWithSlash.test(this.absHref);
+ },
- isCurrentFolder: function () {
+ isCurrentFolder: function () {
- return this.absHref === location.getAbsHref();
- },
+ return this.absHref === location.getAbsHref();
+ },
- isInCurrentFolder: function () {
+ isInCurrentFolder: function () {
- return !!this.parent && this.parent.isCurrentFolder();
- },
+ return !!this.parent && this.parent.isCurrentFolder();
+ },
- isCurrentParentFolder: function () {
+ isCurrentParentFolder: function () {
- return this === getItem(location.getAbsHref()).parent;
- },
+ return this === getItem(location.getAbsHref()).parent;
+ },
- isDomain: function () {
+ isDomain: function () {
- return this.absHref === '/';
- },
+ return this.absHref === '/';
+ },
- isRoot: function () {
+ isRoot: function () {
- return this.absHref === settings.rootHref;
- },
+ return this.absHref === settings.rootHref;
+ },
- isH5ai: function () {
+ isH5ai: function () {
- return this.absHref === settings.appHref;
- },
+ return this.absHref === settings.appHref;
+ },
- isEmpty: function () {
+ isEmpty: function () {
- return _.keys(this.content).length === 0;
- },
+ return _.keys(this.content).length === 0;
+ },
- fetchContent: function (callback) {
+ fetchContent: function (callback) {
- return fetchContent(this.absHref, callback);
- },
+ return fetchContent(this.absHref, callback);
+ },
- getCrumb: function () {
+ getCrumb: function () {
- var item = this,
- crumb = [item];
+ var item = this,
+ crumb = [item];
- while (item.parent) {
- item = item.parent;
- crumb.unshift(item);
- }
+ while (item.parent) {
+ item = item.parent;
+ crumb.unshift(item);
+ }
- return crumb;
- },
+ return crumb;
+ },
- getSubfolders: function () {
+ getSubfolders: function () {
- return _.sortBy(_.filter(this.content, function (item) {
+ return _.sortBy(_.filter(this.content, function (item) {
- return item.isFolder();
- }), function (item) {
+ return item.isFolder();
+ }), function (item) {
- return item.label.toLowerCase();
- });
- },
+ return item.label.toLowerCase();
+ });
+ },
- getStats: function () {
+ getStats: function () {
- var folders = 0,
- files = 0;
+ var folders = 0,
+ files = 0;
- _.each(this.content, function (item) {
+ _.each(this.content, function (item) {
- if (item.isFolder()) {
- folders += 1;
- } else {
- files += 1;
- }
- });
+ if (item.isFolder()) {
+ folders += 1;
+ } else {
+ files += 1;
+ }
+ });
- var depth = 0,
- item = this;
+ var depth = 0,
+ item = this;
- while (item.parent) {
- depth += 1;
- item = item.parent;
- }
+ while (item.parent) {
+ depth += 1;
+ item = item.parent;
+ }
- return {
- folders: folders,
- files: files,
- depth: depth
- };
- }
- });
+ return {
+ folders: folders,
+ files: files,
+ depth: depth
+ };
+ }
+ });
- return {
- get: getItem,
- remove: removeItem
- };
+ return {
+ get: getItem,
+ remove: removeItem
+ };
});
diff --git a/src/_h5ai/client/js/inc/view/ensure.js b/src/_h5ai/client/js/inc/view/ensure.js
index 5a9c63b4..253e977f 100644
--- a/src/_h5ai/client/js/inc/view/ensure.js
+++ b/src/_h5ai/client/js/inc/view/ensure.js
@@ -1,50 +1,50 @@
modulejs.define('view/ensure', ['$', 'config', 'core/event'], function ($, config, event) {
- var selb = '#bottombar',
- selr = selb + ' .right',
- sela = selr + ' a',
- sequence = 'powered by h5ai ' + config.setup.VERSION,
- url = 'http://larsjung.de/h5ai/',
- isVisible = ':visible',
- styleKey = 'style',
- styleVal = 'display: inline !important',
+ var selb = '#bottombar',
+ selr = selb + ' .right',
+ sela = selr + ' a',
+ sequence = 'powered by h5ai ' + config.setup.VERSION,
+ url = 'http://larsjung.de/h5ai/',
+ isVisible = ':visible',
+ styleKey = 'style',
+ styleVal = 'display: inline !important',
- ensure = function () {
+ ensure = function () {
- if (
- $(selr).text() !== sequence ||
- $(sela).attr('href') !== url ||
- $(sela).filter(isVisible).length !== 1 ||
- $(selr).filter(isVisible).length !== 1 ||
- $(selb).filter(isVisible).length !== 1
- ) {
- if ($(selb).filter(isVisible).length !== 1) {
- $(selb).remove();
- $('
').attr(styleKey, styleVal).appendTo('body');
- }
- $(selr).remove();
- $('
')
- .addClass('right')
- .attr(styleKey, styleVal)
- .find('a')
- .attr('href', url)
- .attr('title', sequence)
- .text(sequence)
- .attr(styleKey, styleVal)
- .end()
- .prependTo(selb);
- }
- },
+ if (
+ $(selr).text() !== sequence ||
+ $(sela).attr('href') !== url ||
+ $(sela).filter(isVisible).length !== 1 ||
+ $(selr).filter(isVisible).length !== 1 ||
+ $(selb).filter(isVisible).length !== 1
+ ) {
+ if ($(selb).filter(isVisible).length !== 1) {
+ $(selb).remove();
+ $('
').attr(styleKey, styleVal).appendTo('body');
+ }
+ $(selr).remove();
+ $('
')
+ .addClass('right')
+ .attr(styleKey, styleVal)
+ .find('a')
+ .attr('href', url)
+ .attr('title', sequence)
+ .text(sequence)
+ .attr(styleKey, styleVal)
+ .end()
+ .prependTo(selb);
+ }
+ },
- init = function () {
+ init = function () {
- event.sub('ready', function () {
+ event.sub('ready', function () {
- ensure();
- setInterval(ensure, 60000);
- });
- };
+ ensure();
+ setInterval(ensure, 60000);
+ });
+ };
- init();
+ init();
});
diff --git a/src/_h5ai/client/js/inc/view/items.js b/src/_h5ai/client/js/inc/view/items.js
index 9fe17f10..6cfa9db3 100644
--- a/src/_h5ai/client/js/inc/view/items.js
+++ b/src/_h5ai/client/js/inc/view/items.js
@@ -1,165 +1,167 @@
modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core/format', 'core/event', 'core/location'], function (_, $, allsettings, resource, format, event, location) {
- var settings = _.extend({
- binaryPrefix: false,
- hideFolders: false,
- hideParentFolder: false,
- setParentFolderLabels: false
- }, allsettings.view),
+ var settings = _.extend({
+ binaryPrefix: false,
+ hideFolders: false,
+ hideParentFolder: false,
+ setParentFolderLabels: false
+ }, allsettings.view),
- itemTemplate = '
' +
- '' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ',
- hintTemplate = '
',
- contentTemplate = '
',
+ itemTemplate =
+ '
' +
+ '' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ' +
+ ' ',
+ hintTemplate = '
',
+ contentTemplate =
+ '
',
- update = function (item, force) {
+ update = function (item, force) {
- if (!force && item.$view) {
- return item.$view;
- }
+ if (!force && item.$view) {
+ return item.$view;
+ }
- var $html = $(itemTemplate),
- $a = $html.find('a'),
- $iconImg = $html.find('.icon img'),
- $label = $html.find('.label'),
- $date = $html.find('.date'),
- $size = $html.find('.size');
+ var $html = $(itemTemplate),
+ $a = $html.find('a'),
+ $iconImg = $html.find('.icon img'),
+ $label = $html.find('.label'),
+ $date = $html.find('.date'),
+ $size = $html.find('.size');
- $html
- .addClass(item.isFolder() ? 'folder' : 'file')
- .data('item', item);
+ $html
+ .addClass(item.isFolder() ? 'folder' : 'file')
+ .data('item', item);
- location.setLink($a, item);
+ location.setLink($a, item);
- $iconImg.attr('src', resource.icon(item.type)).attr('alt', item.type);
- $label.text(item.label);
- $date.data('time', item.time).text(format.formatDate(item.time));
- $size.data('bytes', item.size).text(format.formatSize(item.size));
+ $iconImg.attr('src', resource.icon(item.type)).attr('alt', item.type);
+ $label.text(item.label);
+ $date.data('time', item.time).text(format.formatDate(item.time));
+ $size.data('bytes', item.size).text(format.formatSize(item.size));
- if (item.isFolder() && !item.isManaged) {
- $html.addClass('page');
- $iconImg.attr('src', resource.icon('folder-page'));
- }
+ if (item.isFolder() && !item.isManaged) {
+ $html.addClass('page');
+ $iconImg.attr('src', resource.icon('folder-page'));
+ }
- if (item.isCurrentParentFolder()) {
- $iconImg.attr('src', resource.icon('folder-parent'));
- if (!settings.setParentFolderLabels) {
- $label.addClass('l10n-parentDirectory');
- }
- $html.addClass('folder-parent');
- }
+ if (item.isCurrentParentFolder()) {
+ $iconImg.attr('src', resource.icon('folder-parent'));
+ if (!settings.setParentFolderLabels) {
+ $label.addClass('l10n-parentDirectory');
+ }
+ $html.addClass('folder-parent');
+ }
- if (item.$view) {
- item.$view.replaceWith($html);
- }
- item.$view = $html;
+ if (item.$view) {
+ item.$view.replaceWith($html);
+ }
+ item.$view = $html;
- return $html;
- },
+ return $html;
+ },
- onMouseenter = function () {
+ onMouseenter = function () {
- var item = $(this).closest('.item').data('item');
- event.pub('item.mouseenter', item);
- },
+ var item = $(this).closest('.item').data('item');
+ event.pub('item.mouseenter', item);
+ },
- onMouseleave = function () {
+ onMouseleave = function () {
- var item = $(this).closest('.item').data('item');
- event.pub('item.mouseleave', item);
- },
+ var item = $(this).closest('.item').data('item');
+ event.pub('item.mouseleave', item);
+ },
- onLocationChanged = function (item) {
+ onLocationChanged = function (item) {
- var $items = $('#items'),
- $empty = $('#view').find('.empty');
+ var $items = $('#items'),
+ $empty = $('#view').find('.empty');
- $items.find('.item').remove();
+ $items.find('.item').remove();
- if (item.parent && !settings.hideParentFolder) {
- $items.append(update(item.parent, true));
- }
+ if (item.parent && !settings.hideParentFolder) {
+ $items.append(update(item.parent, true));
+ }
- _.each(item.content, function (e) {
+ _.each(item.content, function (e) {
- if (!(e.isFolder() && settings.hideFolders)) {
- $items.append(update(e, true));
- }
- });
+ if (!(e.isFolder() && settings.hideFolders)) {
+ $items.append(update(e, true));
+ }
+ });
- if (item.isEmpty()) {
- $empty.show();
- } else {
- $empty.hide();
- }
+ if (item.isEmpty()) {
+ $empty.show();
+ } else {
+ $empty.hide();
+ }
- $('html,body').scrollLeft(0).scrollTop(0);
- },
+ $('html,body').scrollLeft(0).scrollTop(0);
+ },
- onLocationRefreshed = function (item, added, removed) {
+ onLocationRefreshed = function (item, added, removed) {
- var $items = $('#items'),
- $empty = $('#view').find('.empty');
+ var $items = $('#items'),
+ $empty = $('#view').find('.empty');
- _.each(added, function (item) {
+ _.each(added, function (item) {
- if (!(item.isFolder() && settings.hideFolders)) {
- update(item, true).hide().appendTo($items).fadeIn(400);
- }
- });
+ if (!(item.isFolder() && settings.hideFolders)) {
+ update(item, true).hide().appendTo($items).fadeIn(400);
+ }
+ });
- _.each(removed, function (item) {
+ _.each(removed, function (item) {
- item.$view.fadeOut(400, function () {
- item.$view.remove();
- });
- });
+ item.$view.fadeOut(400, function () {
+ item.$view.remove();
+ });
+ });
- if (item.isEmpty()) {
- setTimeout(function () { $empty.show(); }, 400);
- } else {
- $empty.hide();
- }
- },
+ if (item.isEmpty()) {
+ setTimeout(function () { $empty.show(); }, 400);
+ } else {
+ $empty.hide();
+ }
+ },
- init = function () {
+ init = function () {
- var $content = $(contentTemplate),
- $view = $content.find('#view'),
- $items = $view.find('#items'),
- $emtpy = $view.find('.empty').hide();
+ var $content = $(contentTemplate),
+ $view = $content.find('#view'),
+ $items = $view.find('#items'),
+ $emtpy = $view.find('.empty').hide();
- format.setDefaultMetric(settings.binaryPrefix);
+ format.setDefaultMetric(settings.binaryPrefix);
- $items
- .on('mouseenter', '.item a', onMouseenter)
- .on('mouseleave', '.item a', onMouseleave);
+ $items
+ .on('mouseenter', '.item a', onMouseenter)
+ .on('mouseleave', '.item a', onMouseleave);
- event.sub('location.changed', onLocationChanged);
- event.sub('location.refreshed', onLocationRefreshed);
+ event.sub('location.changed', onLocationChanged);
+ event.sub('location.refreshed', onLocationRefreshed);
- $content.appendTo('body');
- };
+ $content.appendTo('body');
+ };
- init();
+ init();
});
diff --git a/src/_h5ai/client/js/inc/view/spacing.js b/src/_h5ai/client/js/inc/view/spacing.js
index 805752ce..7f1ec0f1 100644
--- a/src/_h5ai/client/js/inc/view/spacing.js
+++ b/src/_h5ai/client/js/inc/view/spacing.js
@@ -1,33 +1,33 @@
modulejs.define('view/spacing', ['_', '$', 'core/settings', 'core/event'], function (_, $, allsettings, event) {
- var settings = _.extend({
- maxWidth: 960,
- top: 50,
- right: 'auto',
- bottom: 50,
- left: 'auto'
- }, allsettings.spacing),
+ var settings = _.extend({
+ maxWidth: 960,
+ top: 50,
+ right: 'auto',
+ bottom: 50,
+ left: 'auto'
+ }, allsettings.spacing),
- adjustSpacing = function () {
+ adjustSpacing = function () {
- $('#content').css({
- 'margin-top': settings.top + $('#topbar').outerHeight(),
- 'margin-bottom': settings.bottom + $('#bottombar').outerHeight()
- });
- },
+ $('#content').css({
+ 'margin-top': settings.top + $('#topbar').outerHeight(),
+ 'margin-bottom': settings.bottom + $('#bottombar').outerHeight()
+ });
+ },
- init = function () {
+ init = function () {
- $('#content').css({
- 'max-width': settings.maxWidth,
- 'margin-right': settings.right,
- 'margin-left': settings.left
- });
+ $('#content').css({
+ 'max-width': settings.maxWidth,
+ 'margin-right': settings.right,
+ 'margin-left': settings.left
+ });
- event.sub('ready', adjustSpacing);
- $(window).on('resize', adjustSpacing);
- };
+ event.sub('ready', adjustSpacing);
+ $(window).on('resize', adjustSpacing);
+ };
- init();
+ init();
});
diff --git a/src/_h5ai/client/js/inc/view/viewmode.js b/src/_h5ai/client/js/inc/view/viewmode.js
index d12156be..a53550dd 100644
--- a/src/_h5ai/client/js/inc/view/viewmode.js
+++ b/src/_h5ai/client/js/inc/view/viewmode.js
@@ -1,129 +1,129 @@
modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'core/store', 'core/event'], function (_, $, allsettings, resource, store, event) {
- var modes = ['details', 'grid', 'icons'],
- sizes = [16, 24, 32, 48, 64, 96, 128, 192, 256, 384],
+ var modes = ['details', 'grid', 'icons'],
+ sizes = [16, 24, 32, 48, 64, 96, 128, 192, 256, 384],
- settings = _.extend({}, {
- modes: modes,
- sizes: sizes
- }, allsettings.view),
+ settings = _.extend({}, {
+ modes: modes,
+ sizes: sizes
+ }, allsettings.view),
- storekey = 'viewmode',
- menuIsVisible = false,
+ storekey = 'viewmode',
+ menuIsVisible = false,
- sidebarToggleTemplate =
- '',
+ sidebarToggleTemplate =
+ '',
- modeTemplate =
- '
',
+ modeTemplate =
+ '
',
- sizeTemplate =
- '
',
+ sizeTemplate =
+ '
',
- adjustSpacing = function () {
+ adjustSpacing = function () {
- var contentWidth = $('#content').width(),
- $view = $('#view'),
- itemWidth = ($view.hasClass('view-icons') || $view.hasClass('view-grid')) ? ($view.find('.item').eq(0).outerWidth(true) || 1) : 1;
+ var contentWidth = $('#content').width(),
+ $view = $('#view'),
+ itemWidth = ($view.hasClass('view-icons') || $view.hasClass('view-grid')) ? ($view.find('.item').eq(0).outerWidth(true) || 1) : 1;
- $view.width(Math.floor(contentWidth / itemWidth) * itemWidth);
- },
+ $view.width(Math.floor(contentWidth / itemWidth) * itemWidth);
+ },
- update = function (mode, size) {
+ update = function (mode, size) {
- var $view = $('#view'),
- stored = store.get(storekey);
+ var $view = $('#view'),
+ stored = store.get(storekey);
- mode = mode || stored && stored.mode;
- size = size || stored && stored.size;
- mode = _.contains(settings.modes, mode) ? mode : settings.modes[0];
- size = _.contains(settings.sizes, size) ? size : settings.sizes[0];
- store.put(storekey, {mode: mode, size: size});
+ mode = mode || stored && stored.mode;
+ size = size || stored && stored.size;
+ mode = _.contains(settings.modes, mode) ? mode : settings.modes[0];
+ size = _.contains(settings.sizes, size) ? size : settings.sizes[0];
+ store.put(storekey, {mode: mode, size: size});
- _.each(modes, function (m) {
- if (m === mode) {
- $('#view-' + m).addClass('current');
- $view.addClass('view-' + m).show();
- } else {
- $('#view-' + m).removeClass('current');
- $view.removeClass('view-' + m);
- }
- });
+ _.each(modes, function (m) {
+ if (m === mode) {
+ $('#view-' + m).addClass('current');
+ $view.addClass('view-' + m).show();
+ } else {
+ $('#view-' + m).removeClass('current');
+ $view.removeClass('view-' + m);
+ }
+ });
- _.each(sizes, function (s) {
- if (s === size) {
- $view.addClass('size-' + s).show();
- } else {
- $view.removeClass('size-' + s);
- }
- });
+ _.each(sizes, function (s) {
+ if (s === size) {
+ $view.addClass('size-' + s).show();
+ } else {
+ $view.removeClass('size-' + s);
+ }
+ });
- $('#view-size').val(_.indexOf(_.intersection(sizes, settings.sizes), size));
+ $('#view-size').val(_.indexOf(_.intersection(sizes, settings.sizes), size));
- adjustSpacing();
- },
+ adjustSpacing();
+ },
- init = function () {
+ init = function () {
- var $sidebar = $('#sidebar'),
- $settings = $('#settings'),
- $viewBlock = $('
'),
- max;
+ var $sidebar = $('#sidebar'),
+ $settings = $('#settings'),
+ $viewBlock = $('
'),
+ max;
- $(sidebarToggleTemplate)
- .on('click', 'a', function (event) {
+ $(sidebarToggleTemplate)
+ .on('click', 'a', function (event) {
- menuIsVisible = !menuIsVisible;
- $sidebar.stop().animate({
- right: menuIsVisible ? 0 : -$sidebar.outerWidth()-1
- });
- event.preventDefault();
- })
- .appendTo('#navbar');
+ menuIsVisible = !menuIsVisible;
+ $sidebar.stop().animate({
+ right: menuIsVisible ? 0 : -$sidebar.outerWidth()-1
+ });
+ event.preventDefault();
+ })
+ .appendTo('#navbar');
- settings.modes = _.intersection(settings.modes, modes);
+ settings.modes = _.intersection(settings.modes, modes);
- if (settings.modes.length > 1) {
- _.each(modes, function (mode) {
- if (_.contains(settings.modes, mode)) {
- $(modeTemplate.replace(/\[MODE\]/g, mode))
- .appendTo($viewBlock)
- .on('click', 'a', function (event) {
+ if (settings.modes.length > 1) {
+ _.each(modes, function (mode) {
+ if (_.contains(settings.modes, mode)) {
+ $(modeTemplate.replace(/\[MODE\]/g, mode))
+ .appendTo($viewBlock)
+ .on('click', 'a', function (event) {
- update(mode);
- event.preventDefault();
- });
- }
- });
- }
+ update(mode);
+ event.preventDefault();
+ });
+ }
+ });
+ }
- if (settings.sizes.length > 1) {
- max = settings.sizes.length-1;
- $(sizeTemplate)
- .prop('max', max).attr('max', max)
- .on('input change', function (event) {
+ if (settings.sizes.length > 1) {
+ max = settings.sizes.length-1;
+ $(sizeTemplate)
+ .prop('max', max).attr('max', max)
+ .on('input change', function (event) {
- update(null, settings.sizes[parseInt(event.target.value, 10)]);
- })
- .appendTo($viewBlock);
- }
+ update(null, settings.sizes[parseInt(event.target.value, 10)]);
+ })
+ .appendTo($viewBlock);
+ }
- $viewBlock.appendTo($settings);
+ $viewBlock.appendTo($settings);
- update();
+ update();
- event.sub('location.changed', adjustSpacing);
- $(window).on('resize', adjustSpacing);
- };
+ event.sub('location.changed', adjustSpacing);
+ $(window).on('resize', adjustSpacing);
+ };
- init();
+ init();
});
diff --git a/src/_h5ai/client/js/scripts.js b/src/_h5ai/client/js/scripts.js
index 2cd41816..8999bbbb 100644
--- a/src/_h5ai/client/js/scripts.js
+++ b/src/_h5ai/client/js/scripts.js
@@ -16,45 +16,45 @@
// app
// ---
(function () {
- 'use strict';
+ 'use strict';
- /*global jQuery, marked, Modernizr, moment, _ */
- modulejs.define('$', function () { return jQuery; });
- modulejs.define('marked', function () { return marked; });
- modulejs.define('modernizr', function () { return Modernizr; });
- modulejs.define('moment', function () { return moment; });
- modulejs.define('prism', function () { return Prism; });
- modulejs.define('_', function () { return _; });
+ /*global jQuery, marked, Modernizr, moment, _ */
+ modulejs.define('$', function () { return jQuery; });
+ modulejs.define('marked', function () { return marked; });
+ modulejs.define('modernizr', function () { return Modernizr; });
+ modulejs.define('moment', function () { return moment; });
+ modulejs.define('prism', function () { return Prism; });
+ modulejs.define('_', function () { return _; });
- // @include "inc/**/*.js"
+ // @include "inc/**/*.js"
- var $ = jQuery,
- module = $('script[data-module]').data('module'),
- data = {action: 'get', setup: true, options: true, types: true, theme: true, langs: true},
- url;
+ var $ = jQuery,
+ module = $('script[data-module]').data('module'),
+ data = {action: 'get', setup: true, options: true, types: true, theme: true, langs: true},
+ url;
- if ($('html').hasClass('no-browser')) {
- return;
- }
+ if ($('html').hasClass('no-browser')) {
+ return;
+ }
- if (module === 'main') {
- url = '.';
- } else if (module === 'info') {
- data.updatecmds = true;
- url = 'server/php/index.php';
- } else {
- return;
- }
+ if (module === 'main') {
+ url = '.';
+ } else if (module === 'info') {
+ data.updatecmds = true;
+ url = 'server/php/index.php';
+ } else {
+ return;
+ }
- $.ajax({
- url: url,
- data: data,
- type: 'POST',
- dataType: 'json'
- }).done(function (config) {
+ $.ajax({
+ url: url,
+ data: data,
+ type: 'POST',
+ dataType: 'json'
+ }).done(function (config) {
- modulejs.define('config', config);
- $(function () { modulejs.require(module); });
- });
+ modulejs.define('config', config);
+ $(function () { modulejs.require(module); });
+ });
}());
diff --git a/src/_h5ai/conf/l10n/bg.json b/src/_h5ai/conf/l10n/bg.json
index 38324c12..1179e2ff 100644
--- a/src/_h5ai/conf/l10n/bg.json
+++ b/src/_h5ai/conf/l10n/bg.json
@@ -1,19 +1,19 @@
{
- "lang": "български",
- "details": "детайли",
- "list": "списък",
- "grid": "мрежа",
- "icons": "икони",
- "name": "Име",
- "lastModified": "Последна промяна",
- "size": "Размер",
- "parentDirectory": "Предходна директория",
- "empty": "празна",
- "folders": "директории",
- "files": "файлове",
- "download": "изтегляне",
- "noMatch": "няма съвпадение",
- "dateFormat": "DD-MM-YYYY HH:mm",
- "filter": "филтър",
- "delete": "изтрий"
+ "lang": "български",
+ "details": "детайли",
+ "list": "списък",
+ "grid": "мрежа",
+ "icons": "икони",
+ "name": "Име",
+ "lastModified": "Последна промяна",
+ "size": "Размер",
+ "parentDirectory": "Предходна директория",
+ "empty": "празна",
+ "folders": "директории",
+ "files": "файлове",
+ "download": "изтегляне",
+ "noMatch": "няма съвпадение",
+ "dateFormat": "DD-MM-YYYY HH:mm",
+ "filter": "филтър",
+ "delete": "изтрий"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/cs.json b/src/_h5ai/conf/l10n/cs.json
index 464cf755..be209eb6 100644
--- a/src/_h5ai/conf/l10n/cs.json
+++ b/src/_h5ai/conf/l10n/cs.json
@@ -1,19 +1,19 @@
{
- "lang": "čeština",
- "details": "Podrobnosti",
- "list": "Dlaždice",
- "grid": "Seznam",
- "icons": "Velké ikony",
- "name": "Název",
- "lastModified": "Datum změny",
- "size": "Velikost",
- "parentDirectory": "Nadřazený adresář",
- "empty": "Prázdná složka",
- "folders": "složek",
- "files": "souborů",
- "download": "Stáhnout",
- "noMatch": "Žádná shoda",
- "dateFormat": "DD.MM.YYYY HH:mm",
- "filter": "Filtr",
- "delete": "Odstranit"
+ "lang": "čeština",
+ "details": "Podrobnosti",
+ "list": "Dlaždice",
+ "grid": "Seznam",
+ "icons": "Velké ikony",
+ "name": "Název",
+ "lastModified": "Datum změny",
+ "size": "Velikost",
+ "parentDirectory": "Nadřazený adresář",
+ "empty": "Prázdná složka",
+ "folders": "složek",
+ "files": "souborů",
+ "download": "Stáhnout",
+ "noMatch": "Žádná shoda",
+ "dateFormat": "DD.MM.YYYY HH:mm",
+ "filter": "Filtr",
+ "delete": "Odstranit"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/da.json b/src/_h5ai/conf/l10n/da.json
index ba2344eb..b0bdee2e 100644
--- a/src/_h5ai/conf/l10n/da.json
+++ b/src/_h5ai/conf/l10n/da.json
@@ -1,19 +1,19 @@
{
- "lang": "dansk",
- "details": "detaljer",
- "list": "list",
- "grid": "grid",
- "icons": "ikoner",
- "name": "Navn",
- "lastModified": "Sidst ændret",
- "size": "Størrelse",
- "parentDirectory": "Overordnet mappe",
- "empty": "tom",
- "folders": "mapper",
- "files": "filer",
- "download": "download",
- "noMatch": "ingen match",
- "dateFormat": "DD-MM-YYYY HH:mm",
- "filter": "filter",
- "delete": "slet"
+ "lang": "dansk",
+ "details": "detaljer",
+ "list": "list",
+ "grid": "grid",
+ "icons": "ikoner",
+ "name": "Navn",
+ "lastModified": "Sidst ændret",
+ "size": "Størrelse",
+ "parentDirectory": "Overordnet mappe",
+ "empty": "tom",
+ "folders": "mapper",
+ "files": "filer",
+ "download": "download",
+ "noMatch": "ingen match",
+ "dateFormat": "DD-MM-YYYY HH:mm",
+ "filter": "filter",
+ "delete": "slet"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/de.json b/src/_h5ai/conf/l10n/de.json
index bc76cafc..f3ae294e 100644
--- a/src/_h5ai/conf/l10n/de.json
+++ b/src/_h5ai/conf/l10n/de.json
@@ -1,19 +1,19 @@
{
- "lang": "deutsch",
- "details": "Details",
- "list": "Liste",
- "grid": "Gitter",
- "icons": "Icons",
- "name": "Name",
- "lastModified": "Geändert",
- "size": "Größe",
- "parentDirectory": "Übergeordnetes Verzeichnis",
- "empty": "leer",
- "folders": "Ordner",
- "files": "Dateien",
- "download": "Download",
- "noMatch": "keine Treffer",
- "dateFormat": "DD.MM.YYYY HH:mm",
- "filter": "Filter",
- "delete": "Löschen"
+ "lang": "deutsch",
+ "details": "Details",
+ "list": "Liste",
+ "grid": "Gitter",
+ "icons": "Icons",
+ "name": "Name",
+ "lastModified": "Geändert",
+ "size": "Größe",
+ "parentDirectory": "Übergeordnetes Verzeichnis",
+ "empty": "leer",
+ "folders": "Ordner",
+ "files": "Dateien",
+ "download": "Download",
+ "noMatch": "keine Treffer",
+ "dateFormat": "DD.MM.YYYY HH:mm",
+ "filter": "Filter",
+ "delete": "Löschen"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/el.json b/src/_h5ai/conf/l10n/el.json
index 5a0f4177..d546adec 100644
--- a/src/_h5ai/conf/l10n/el.json
+++ b/src/_h5ai/conf/l10n/el.json
@@ -1,19 +1,19 @@
{
- "lang": "ελληνικά",
- "details": "λεπτομέρειες",
- "list": "λίστα",
- "grid": "πλέγμα",
- "icons": "εικονίδια",
- "name": "Όνομα",
- "lastModified": "Τελευταία τροποποίηση",
- "size": "Μέγεθος",
- "parentDirectory": "Προηγούμενος Κατάλογος",
- "empty": "κενό",
- "folders": "φάκελοι",
- "files": "αρχεία",
- "download": "μεταμόρφωση",
- "noMatch": "κανένα αποτέλεσμα",
- "dateFormat": "DD/MM/YYYY HH:mm",
- "filter": "φίλτρο",
- "delete": "διαγραφή"
+ "lang": "ελληνικά",
+ "details": "λεπτομέρειες",
+ "list": "λίστα",
+ "grid": "πλέγμα",
+ "icons": "εικονίδια",
+ "name": "Όνομα",
+ "lastModified": "Τελευταία τροποποίηση",
+ "size": "Μέγεθος",
+ "parentDirectory": "Προηγούμενος Κατάλογος",
+ "empty": "κενό",
+ "folders": "φάκελοι",
+ "files": "αρχεία",
+ "download": "μεταμόρφωση",
+ "noMatch": "κανένα αποτέλεσμα",
+ "dateFormat": "DD/MM/YYYY HH:mm",
+ "filter": "φίλτρο",
+ "delete": "διαγραφή"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/en.json b/src/_h5ai/conf/l10n/en.json
index befaf35a..322db770 100644
--- a/src/_h5ai/conf/l10n/en.json
+++ b/src/_h5ai/conf/l10n/en.json
@@ -1,20 +1,20 @@
/* only here as a reference, these values are the hardcoded defaults */
{
- "lang": "english",
- "details": "details",
- "list": "list",
- "grid": "grid",
- "icons": "icons",
- "name": "Name",
- "lastModified": "Last modified",
- "size": "Size",
- "parentDirectory": "Parent Directory",
- "empty": "empty",
- "folders": "folders",
- "files": "files",
- "download": "download",
- "noMatch": "no match",
- "dateFormat": "YYYY-MM-DD HH:mm", /* syntax as specified on http://momentjs.com */
- "filter": "filter",
- "delete": "delete"
+ "lang": "english",
+ "details": "details",
+ "list": "list",
+ "grid": "grid",
+ "icons": "icons",
+ "name": "Name",
+ "lastModified": "Last modified",
+ "size": "Size",
+ "parentDirectory": "Parent Directory",
+ "empty": "empty",
+ "folders": "folders",
+ "files": "files",
+ "download": "download",
+ "noMatch": "no match",
+ "dateFormat": "YYYY-MM-DD HH:mm", /* syntax as specified on http://momentjs.com */
+ "filter": "filter",
+ "delete": "delete"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/es.json b/src/_h5ai/conf/l10n/es.json
index 69aba445..8750d074 100644
--- a/src/_h5ai/conf/l10n/es.json
+++ b/src/_h5ai/conf/l10n/es.json
@@ -1,13 +1,13 @@
{
- "lang": "español",
- "details": "Detalles",
- "icons": "Íconos",
- "name": "Nombre",
- "lastModified": "Última modificación",
- "size": "Tamaño",
- "parentDirectory": "Directorio superior",
- "empty": "vacío",
- "folders": "Directorios",
- "files": "Archivos",
- "download": "Descargar"
+ "lang": "español",
+ "details": "Detalles",
+ "icons": "Íconos",
+ "name": "Nombre",
+ "lastModified": "Última modificación",
+ "size": "Tamaño",
+ "parentDirectory": "Directorio superior",
+ "empty": "vacío",
+ "folders": "Directorios",
+ "files": "Archivos",
+ "download": "Descargar"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/fi.json b/src/_h5ai/conf/l10n/fi.json
index 52c6fcc4..e503756b 100644
--- a/src/_h5ai/conf/l10n/fi.json
+++ b/src/_h5ai/conf/l10n/fi.json
@@ -1,19 +1,19 @@
{
- "lang": "finnish",
- "details": "tiedot",
- "list": "lista",
- "grid": "ruudukko",
- "icons": "ikonit",
- "name": "Nimi",
- "lastModified": "Viimeksi muokattu",
- "size": "Koko",
- "parentDirectory": "Ylähakemisto",
- "empty": "tyhjä",
- "folders": "hakemistoa",
- "files": "tiedostoa",
- "download": "lataa",
- "noMatch": "ei osumia",
- "dateFormat": "DD.MM.YYYY HH:mm",
- "filter": "suodata",
- "delete": "poista"
+ "lang": "finnish",
+ "details": "tiedot",
+ "list": "lista",
+ "grid": "ruudukko",
+ "icons": "ikonit",
+ "name": "Nimi",
+ "lastModified": "Viimeksi muokattu",
+ "size": "Koko",
+ "parentDirectory": "Ylähakemisto",
+ "empty": "tyhjä",
+ "folders": "hakemistoa",
+ "files": "tiedostoa",
+ "download": "lataa",
+ "noMatch": "ei osumia",
+ "dateFormat": "DD.MM.YYYY HH:mm",
+ "filter": "suodata",
+ "delete": "poista"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/fr.json b/src/_h5ai/conf/l10n/fr.json
index dc800d0d..88ec1a47 100644
--- a/src/_h5ai/conf/l10n/fr.json
+++ b/src/_h5ai/conf/l10n/fr.json
@@ -1,19 +1,19 @@
{
- "lang": "français",
- "details": "détails",
- "list": "liste",
- "grid": "grille",
- "icons": "icônes",
- "name": "Nom",
- "lastModified": "Dernière modification",
- "size": "Taille",
- "parentDirectory": "Dossier parent",
- "empty": "vide",
- "folders": "Répertoires",
- "files": "Fichiers",
- "download": "télécharger",
- "noMatch": "rien trouvé",
- "dateFormat": "DD/MM/YYYY HH:mm",
- "filter": "filtre",
- "delete": "supprimer"
+ "lang": "français",
+ "details": "détails",
+ "list": "liste",
+ "grid": "grille",
+ "icons": "icônes",
+ "name": "Nom",
+ "lastModified": "Dernière modification",
+ "size": "Taille",
+ "parentDirectory": "Dossier parent",
+ "empty": "vide",
+ "folders": "Répertoires",
+ "files": "Fichiers",
+ "download": "télécharger",
+ "noMatch": "rien trouvé",
+ "dateFormat": "DD/MM/YYYY HH:mm",
+ "filter": "filtre",
+ "delete": "supprimer"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/he.json b/src/_h5ai/conf/l10n/he.json
index dc2336c5..ae1428e7 100644
--- a/src/_h5ai/conf/l10n/he.json
+++ b/src/_h5ai/conf/l10n/he.json
@@ -1,17 +1,17 @@
{
- "lang": "עברית",
- "details": "פרטים",
- "icons": "צלמיות",
- "name": "שם",
- "lastModified": "שינוי אחרון",
- "size": "גודל",
- "parentDirectory": "תיקיית הורה",
- "empty": "ריק",
- "folders": "תיקיות",
- "files": "קבצים",
- "download": "הורדה",
- "noMatch": "אין תוצאות",
- "dateFormat": "DD.MM.YYYY HH:mm",
- "filter": "סינון",
- "delete": "מחיקה"
+ "lang": "עברית",
+ "details": "פרטים",
+ "icons": "צלמיות",
+ "name": "שם",
+ "lastModified": "שינוי אחרון",
+ "size": "גודל",
+ "parentDirectory": "תיקיית הורה",
+ "empty": "ריק",
+ "folders": "תיקיות",
+ "files": "קבצים",
+ "download": "הורדה",
+ "noMatch": "אין תוצאות",
+ "dateFormat": "DD.MM.YYYY HH:mm",
+ "filter": "סינון",
+ "delete": "מחיקה"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/hi.json b/src/_h5ai/conf/l10n/hi.json
index c183f911..93bfdf69 100644
--- a/src/_h5ai/conf/l10n/hi.json
+++ b/src/_h5ai/conf/l10n/hi.json
@@ -1,19 +1,19 @@
{
- "lang": "हिंदी",
- "details": "विस्तार",
- "icons": "आइकॉन",
- "name": "नाम",
- "lastModified": "पिछला परिवर्तन",
- "size": "माप",
- "parentDirectory": "मूल डायरेक्टरी",
- "empty": "खाली",
- "folders": "फोल्डर",
- "files": "फ़ाइलें",
- "download": "डाउनलोड",
- "list": "सूची",
- "grid": "ग्रिड",
- "noMatch": "कोई समानता नहीं",
- "dateFormat": "DD.MM.YYYY HH:mm",
- "filter": "फ़िल्टर",
- "delete": "हटाओ"
+ "lang": "हिंदी",
+ "details": "विस्तार",
+ "icons": "आइकॉन",
+ "name": "नाम",
+ "lastModified": "पिछला परिवर्तन",
+ "size": "माप",
+ "parentDirectory": "मूल डायरेक्टरी",
+ "empty": "खाली",
+ "folders": "फोल्डर",
+ "files": "फ़ाइलें",
+ "download": "डाउनलोड",
+ "list": "सूची",
+ "grid": "ग्रिड",
+ "noMatch": "कोई समानता नहीं",
+ "dateFormat": "DD.MM.YYYY HH:mm",
+ "filter": "फ़िल्टर",
+ "delete": "हटाओ"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/hu.json b/src/_h5ai/conf/l10n/hu.json
index 926b60f4..13dbccf1 100644
--- a/src/_h5ai/conf/l10n/hu.json
+++ b/src/_h5ai/conf/l10n/hu.json
@@ -1,15 +1,15 @@
{
- "lang": "magyar",
- "details": "részletek",
- "icons": "ikonok",
- "name": "Név",
- "lastModified": "Utoljára módosítva",
- "size": "Méret",
- "parentDirectory": "Szülő könyvtár",
- "empty": "üres",
- "folders": "mappák",
- "files": "fájlok",
- "download": "letöltés",
- "noMatch": "nincs találat",
- "dateFormat": "YYYY-MM-DD HH:mm"
+ "lang": "magyar",
+ "details": "részletek",
+ "icons": "ikonok",
+ "name": "Név",
+ "lastModified": "Utoljára módosítva",
+ "size": "Méret",
+ "parentDirectory": "Szülő könyvtár",
+ "empty": "üres",
+ "folders": "mappák",
+ "files": "fájlok",
+ "download": "letöltés",
+ "noMatch": "nincs találat",
+ "dateFormat": "YYYY-MM-DD HH:mm"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/it.json b/src/_h5ai/conf/l10n/it.json
index 6f4cb90f..00790450 100644
--- a/src/_h5ai/conf/l10n/it.json
+++ b/src/_h5ai/conf/l10n/it.json
@@ -1,19 +1,19 @@
{
- "lang": "italiano",
- "details": "dettagli",
- "list": "lista",
- "grid": "griglia",
- "icons": "icone",
- "name": "Nome",
- "lastModified": "Ultima modifica",
- "size": "Dimensione",
- "parentDirectory": "Cartella Superiore",
- "empty": "vuota",
- "folders": "cartelle",
- "files": "file",
- "download": "download",
- "noMatch": "nessun risultato",
- "dateFormat": "DD-MM-YYYY HH:mm",
- "filter": "filtra",
- "delete": "elimina"
+ "lang": "italiano",
+ "details": "dettagli",
+ "list": "lista",
+ "grid": "griglia",
+ "icons": "icone",
+ "name": "Nome",
+ "lastModified": "Ultima modifica",
+ "size": "Dimensione",
+ "parentDirectory": "Cartella Superiore",
+ "empty": "vuota",
+ "folders": "cartelle",
+ "files": "file",
+ "download": "download",
+ "noMatch": "nessun risultato",
+ "dateFormat": "DD-MM-YYYY HH:mm",
+ "filter": "filtra",
+ "delete": "elimina"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/ja.json b/src/_h5ai/conf/l10n/ja.json
index a3900f30..0c7f7669 100644
--- a/src/_h5ai/conf/l10n/ja.json
+++ b/src/_h5ai/conf/l10n/ja.json
@@ -1,14 +1,14 @@
{
- "lang": "日本語",
- "details": "詳細",
- "icons": "アイコン",
- "name": "名前",
- "lastModified": "変更日",
- "size": "サイズ",
- "parentDirectory": "親フォルダ",
- "empty": "項目なし",
- "folders": "フォルダ",
- "files": "ファイル",
- "download": "ダウンロード",
- "noMatch": "一致なし"
+ "lang": "日本語",
+ "details": "詳細",
+ "icons": "アイコン",
+ "name": "名前",
+ "lastModified": "変更日",
+ "size": "サイズ",
+ "parentDirectory": "親フォルダ",
+ "empty": "項目なし",
+ "folders": "フォルダ",
+ "files": "ファイル",
+ "download": "ダウンロード",
+ "noMatch": "一致なし"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/ko.json b/src/_h5ai/conf/l10n/ko.json
index bb9597cf..15d1e690 100644
--- a/src/_h5ai/conf/l10n/ko.json
+++ b/src/_h5ai/conf/l10n/ko.json
@@ -1,19 +1,19 @@
{
- "lang": "한국어",
- "details": "자세히",
- "list": "목록",
- "grid": "그리드",
- "icons": "아이콘",
- "name": "파일명",
- "lastModified": "최근수정일",
- "size": "크기",
- "parentDirectory": "상위폴더",
- "empty": "빈폴더",
- "folders": "폴더",
- "files": "파일",
- "download": "다운로드",
- "noMatch": "해당파일이 없습니다.",
- "dateFormat": "YYYY-MM-DD HH:mm",
- "filter": "필터",
- "delete": "삭제"
+ "lang": "한국어",
+ "details": "자세히",
+ "list": "목록",
+ "grid": "그리드",
+ "icons": "아이콘",
+ "name": "파일명",
+ "lastModified": "최근수정일",
+ "size": "크기",
+ "parentDirectory": "상위폴더",
+ "empty": "빈폴더",
+ "folders": "폴더",
+ "files": "파일",
+ "download": "다운로드",
+ "noMatch": "해당파일이 없습니다.",
+ "dateFormat": "YYYY-MM-DD HH:mm",
+ "filter": "필터",
+ "delete": "삭제"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/lv.json b/src/_h5ai/conf/l10n/lv.json
index 70b24e1a..d127bf28 100644
--- a/src/_h5ai/conf/l10n/lv.json
+++ b/src/_h5ai/conf/l10n/lv.json
@@ -1,19 +1,19 @@
{
- "lang": "latviešu",
- "details": "detaļas",
- "list": "saraksts",
- "grid": "režģis",
- "icons": "ikonas",
- "name": "Nosaukums",
- "lastModified": "Pēdējoreiz modificēts",
- "size": "Izmērs",
- "parentDirectory": "Vecākdirektorijs",
- "empty": "tukšs",
- "folders": "mapes",
- "files": "faili",
- "download": "lejupielādēt",
- "noMatch": "nav sakritības",
- "dateFormat": "YYYY-MM-DD HH:mm",
- "filter": "filtrēt",
- "delete": "izdzēst"
+ "lang": "latviešu",
+ "details": "detaļas",
+ "list": "saraksts",
+ "grid": "režģis",
+ "icons": "ikonas",
+ "name": "Nosaukums",
+ "lastModified": "Pēdējoreiz modificēts",
+ "size": "Izmērs",
+ "parentDirectory": "Vecākdirektorijs",
+ "empty": "tukšs",
+ "folders": "mapes",
+ "files": "faili",
+ "download": "lejupielādēt",
+ "noMatch": "nav sakritības",
+ "dateFormat": "YYYY-MM-DD HH:mm",
+ "filter": "filtrēt",
+ "delete": "izdzēst"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/nb.json b/src/_h5ai/conf/l10n/nb.json
index 3e7f6c9b..34fa921c 100644
--- a/src/_h5ai/conf/l10n/nb.json
+++ b/src/_h5ai/conf/l10n/nb.json
@@ -1,14 +1,14 @@
{
- "lang": "norwegian",
- "details": "detaljer",
- "icons": "ikoner",
- "name": "Navn",
- "lastModified": "Sist endret",
- "size": "Størrelse",
- "parentDirectory": "Overordnet mappe",
- "empty": "tom",
- "folders": "mapper",
- "files": "filer",
- "download": "last ned",
- "noMatch": "ingen treff"
+ "lang": "norwegian",
+ "details": "detaljer",
+ "icons": "ikoner",
+ "name": "Navn",
+ "lastModified": "Sist endret",
+ "size": "Størrelse",
+ "parentDirectory": "Overordnet mappe",
+ "empty": "tom",
+ "folders": "mapper",
+ "files": "filer",
+ "download": "last ned",
+ "noMatch": "ingen treff"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/nl.json b/src/_h5ai/conf/l10n/nl.json
index d9acc7e1..30d7a847 100644
--- a/src/_h5ai/conf/l10n/nl.json
+++ b/src/_h5ai/conf/l10n/nl.json
@@ -1,10 +1,10 @@
{
- "lang": "nederlands",
- "details": "details",
- "icons": "iconen",
- "name": "Naam",
- "lastModified": "Laatste wijziging",
- "size": "Grootte",
- "parentDirectory": "Bovenliggende map",
- "empty": "lege"
+ "lang": "nederlands",
+ "details": "details",
+ "icons": "iconen",
+ "name": "Naam",
+ "lastModified": "Laatste wijziging",
+ "size": "Grootte",
+ "parentDirectory": "Bovenliggende map",
+ "empty": "lege"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/pl.json b/src/_h5ai/conf/l10n/pl.json
index ab672614..a345d771 100644
--- a/src/_h5ai/conf/l10n/pl.json
+++ b/src/_h5ai/conf/l10n/pl.json
@@ -1,19 +1,19 @@
{
- "lang": "polski",
- "details": "szczegóły",
- "list": "lista",
- "grid": "kafelki",
- "icons": "ikony",
- "name": "Nazwa",
- "lastModified": "Ostatnia modyfikacja",
- "size": "Rozmiar",
- "parentDirectory": "Katalog nadrzędny",
- "empty": "pusty",
- "folders": "folderów",
- "files": "plików",
- "download": "pobierz",
- "noMatch": "nie znaleziono",
- "dateFormat": "YYYY-MM-DD HH:mm",
- "filter": "filtr",
- "delete": "usuń"
+ "lang": "polski",
+ "details": "szczegóły",
+ "list": "lista",
+ "grid": "kafelki",
+ "icons": "ikony",
+ "name": "Nazwa",
+ "lastModified": "Ostatnia modyfikacja",
+ "size": "Rozmiar",
+ "parentDirectory": "Katalog nadrzędny",
+ "empty": "pusty",
+ "folders": "folderów",
+ "files": "plików",
+ "download": "pobierz",
+ "noMatch": "nie znaleziono",
+ "dateFormat": "YYYY-MM-DD HH:mm",
+ "filter": "filtr",
+ "delete": "usuń"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/pt.json b/src/_h5ai/conf/l10n/pt.json
index debe6b63..b58184b0 100644
--- a/src/_h5ai/conf/l10n/pt.json
+++ b/src/_h5ai/conf/l10n/pt.json
@@ -1,19 +1,19 @@
{
- "lang": "português",
- "details": "detalhes",
- "list": "lista",
- "grid": "grelha",
- "icons": "ícones",
- "name": "Nome",
- "lastModified": "última modificação",
- "size": "Tamanho",
- "parentDirectory": "diretório acima",
- "empty": "vazio",
- "folders": "pastas",
- "files": "arquivos",
- "download": "descarregar",
- "noMatch": "sem resultados",
- "dateFormat": "DD-MM-YYYY HH:mm",
- "filter": "filtro",
- "delete": "eliminar"
+ "lang": "português",
+ "details": "detalhes",
+ "list": "lista",
+ "grid": "grelha",
+ "icons": "ícones",
+ "name": "Nome",
+ "lastModified": "última modificação",
+ "size": "Tamanho",
+ "parentDirectory": "diretório acima",
+ "empty": "vazio",
+ "folders": "pastas",
+ "files": "arquivos",
+ "download": "descarregar",
+ "noMatch": "sem resultados",
+ "dateFormat": "DD-MM-YYYY HH:mm",
+ "filter": "filtro",
+ "delete": "eliminar"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/ro.json b/src/_h5ai/conf/l10n/ro.json
index 87c3f2da..cd7a0105 100644
--- a/src/_h5ai/conf/l10n/ro.json
+++ b/src/_h5ai/conf/l10n/ro.json
@@ -1,14 +1,14 @@
{
- "lang": "română",
- "details": "detalii",
- "icons": "pictograme",
- "name": "nume",
- "lastModified": "ultima modificare",
- "size": "mărime",
- "parentDirectory": "dosar părinte",
- "empty": "gol",
- "folders": "dosar",
- "files": "fişiere",
- "download": "descarcă",
- "noMatch": "0 rezultate"
+ "lang": "română",
+ "details": "detalii",
+ "icons": "pictograme",
+ "name": "nume",
+ "lastModified": "ultima modificare",
+ "size": "mărime",
+ "parentDirectory": "dosar părinte",
+ "empty": "gol",
+ "folders": "dosar",
+ "files": "fişiere",
+ "download": "descarcă",
+ "noMatch": "0 rezultate"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/ru.json b/src/_h5ai/conf/l10n/ru.json
index 0bb975ec..c5247841 100644
--- a/src/_h5ai/conf/l10n/ru.json
+++ b/src/_h5ai/conf/l10n/ru.json
@@ -1,19 +1,19 @@
{
- "lang": "русский",
- "details": "Детали",
- "list": "Список",
- "grid": "Сетка",
- "icons": "Иконки",
- "name": "Имя",
- "lastModified": "Последние изменения",
- "size": "Размер",
- "parentDirectory": "Главная директория",
- "empty": "Пусто",
- "folders": "Папки",
- "files": "Файлы",
- "download": "Скачать",
- "noMatch": "Нет совпадений",
- "dateFormat": "YYYY-MM-DD HH:mm",
- "filter": "Фильтр",
- "delete": "Удалить"
+ "lang": "русский",
+ "details": "Детали",
+ "list": "Список",
+ "grid": "Сетка",
+ "icons": "Иконки",
+ "name": "Имя",
+ "lastModified": "Последние изменения",
+ "size": "Размер",
+ "parentDirectory": "Главная директория",
+ "empty": "Пусто",
+ "folders": "Папки",
+ "files": "Файлы",
+ "download": "Скачать",
+ "noMatch": "Нет совпадений",
+ "dateFormat": "YYYY-MM-DD HH:mm",
+ "filter": "Фильтр",
+ "delete": "Удалить"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/sk.json b/src/_h5ai/conf/l10n/sk.json
index 58569d5e..55957bd0 100644
--- a/src/_h5ai/conf/l10n/sk.json
+++ b/src/_h5ai/conf/l10n/sk.json
@@ -1,12 +1,12 @@
{
- "lang": "slovenčina",
- "details": "podrobnosti",
- "icons": "ikony",
- "name": "Názov",
- "lastModified": "Upravené",
- "size": "Velkosť",
- "parentDirectory": "Nadriadený priečinok",
- "empty": "prázdny",
- "folders": "priečinkov",
- "files": "súborov"
+ "lang": "slovenčina",
+ "details": "podrobnosti",
+ "icons": "ikony",
+ "name": "Názov",
+ "lastModified": "Upravené",
+ "size": "Velkosť",
+ "parentDirectory": "Nadriadený priečinok",
+ "empty": "prázdny",
+ "folders": "priečinkov",
+ "files": "súborov"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/sl.json b/src/_h5ai/conf/l10n/sl.json
index 147041ce..c2050f5b 100644
--- a/src/_h5ai/conf/l10n/sl.json
+++ b/src/_h5ai/conf/l10n/sl.json
@@ -1,19 +1,19 @@
{
- "lang": "slovenščina",
- "details": "podrobnosti",
- "list": "seznam",
- "grid": "mreža",
- "icons": "ikone",
- "name": "Ime",
- "lastModified": "Zadnja sprememba",
- "size": "Velikost",
- "parentDirectory": "Nadrejena mapa",
- "empty": "prazno",
- "folders": "mape",
- "files": "datoteke",
- "download": "prenesi",
- "noMatch": "ni zadetkov",
- "dateFormat": "DD. MM. YYYY HH:mm",
- "filter": "filter",
- "delete": "izbriši"
+ "lang": "slovenščina",
+ "details": "podrobnosti",
+ "list": "seznam",
+ "grid": "mreža",
+ "icons": "ikone",
+ "name": "Ime",
+ "lastModified": "Zadnja sprememba",
+ "size": "Velikost",
+ "parentDirectory": "Nadrejena mapa",
+ "empty": "prazno",
+ "folders": "mape",
+ "files": "datoteke",
+ "download": "prenesi",
+ "noMatch": "ni zadetkov",
+ "dateFormat": "DD. MM. YYYY HH:mm",
+ "filter": "filter",
+ "delete": "izbriši"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/sr.json b/src/_h5ai/conf/l10n/sr.json
index 899ab20f..e523f0d9 100644
--- a/src/_h5ai/conf/l10n/sr.json
+++ b/src/_h5ai/conf/l10n/sr.json
@@ -1,14 +1,14 @@
{
- "lang": "srpski",
- "details": "detalji",
- "icons": "ikone",
- "name": "Ime",
- "lastModified": "Poslednja modifikacija",
- "size": "Veličina",
- "parentDirectory": "Roditeljski direktorijum",
- "empty": "prazno",
- "folders": "direktorijum",
- "files": "fajlovi",
- "download": "download",
- "noMatch": "bez poklapanja"
+ "lang": "srpski",
+ "details": "detalji",
+ "icons": "ikone",
+ "name": "Ime",
+ "lastModified": "Poslednja modifikacija",
+ "size": "Veličina",
+ "parentDirectory": "Roditeljski direktorijum",
+ "empty": "prazno",
+ "folders": "direktorijum",
+ "files": "fajlovi",
+ "download": "download",
+ "noMatch": "bez poklapanja"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/sv.json b/src/_h5ai/conf/l10n/sv.json
index 5babca34..08a3bdd3 100644
--- a/src/_h5ai/conf/l10n/sv.json
+++ b/src/_h5ai/conf/l10n/sv.json
@@ -1,17 +1,17 @@
{
- "lang": "svenska",
- "details": "detaljerad",
- "list": "lista",
- "grid": "rutnät",
- "icons": "ikoner",
- "name": "Filnamn",
- "lastModified": "Senast ändrad",
- "size": "Filstorlek",
- "parentDirectory": "Till överordnad mapp",
- "empty": "tom",
- "folders": "kataloger",
- "files": "filer",
- "download": "ladda ner",
- "noMatch": "ingen matchning",
- "delete": "radera"
+ "lang": "svenska",
+ "details": "detaljerad",
+ "list": "lista",
+ "grid": "rutnät",
+ "icons": "ikoner",
+ "name": "Filnamn",
+ "lastModified": "Senast ändrad",
+ "size": "Filstorlek",
+ "parentDirectory": "Till överordnad mapp",
+ "empty": "tom",
+ "folders": "kataloger",
+ "files": "filer",
+ "download": "ladda ner",
+ "noMatch": "ingen matchning",
+ "delete": "radera"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/tr.json b/src/_h5ai/conf/l10n/tr.json
index 7595d8b7..2e8c6630 100644
--- a/src/_h5ai/conf/l10n/tr.json
+++ b/src/_h5ai/conf/l10n/tr.json
@@ -1,13 +1,13 @@
{
- "lang": "türkçe",
- "details": "detaylar",
- "icons": "ikonlar",
- "name": "İsim",
- "lastModified": "Son Düzenleme",
- "size": "Boyut",
- "parentDirectory": "Üst Dizin",
- "empty": "boş",
- "folders": "klasörler",
- "files": "dosyalar",
- "download": "indir"
+ "lang": "türkçe",
+ "details": "detaylar",
+ "icons": "ikonlar",
+ "name": "İsim",
+ "lastModified": "Son Düzenleme",
+ "size": "Boyut",
+ "parentDirectory": "Üst Dizin",
+ "empty": "boş",
+ "folders": "klasörler",
+ "files": "dosyalar",
+ "download": "indir"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/uk.json b/src/_h5ai/conf/l10n/uk.json
index 0e3190f6..72b4d00f 100644
--- a/src/_h5ai/conf/l10n/uk.json
+++ b/src/_h5ai/conf/l10n/uk.json
@@ -1,19 +1,19 @@
{
- "lang": "українська",
- "details": "Деталі",
- "list": "Список",
- "grid": "Гратка",
- "icons": "Піктограми",
- "name": "Ім'я",
- "lastModified": "Останні зміни",
- "size": "Розмір",
- "parentDirectory": "Головна тека",
- "empty": "Порожньо",
- "folders": "Тек(и))",
- "files": "Файли(ів)",
- "download": "Завантажити",
- "noMatch": "Немає співпадінь",
- "dateFormat": "YYYY-MM-DD HH:mm",
- "filter": "Фільтр",
- "delete": "Вилучити"
+ "lang": "українська",
+ "details": "Деталі",
+ "list": "Список",
+ "grid": "Гратка",
+ "icons": "Піктограми",
+ "name": "Ім'я",
+ "lastModified": "Останні зміни",
+ "size": "Розмір",
+ "parentDirectory": "Головна тека",
+ "empty": "Порожньо",
+ "folders": "Тек(и))",
+ "files": "Файли(ів)",
+ "download": "Завантажити",
+ "noMatch": "Немає співпадінь",
+ "dateFormat": "YYYY-MM-DD HH:mm",
+ "filter": "Фільтр",
+ "delete": "Вилучити"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/zh-cn.json b/src/_h5ai/conf/l10n/zh-cn.json
index 249a220f..99dfd328 100644
--- a/src/_h5ai/conf/l10n/zh-cn.json
+++ b/src/_h5ai/conf/l10n/zh-cn.json
@@ -1,19 +1,19 @@
{
- "lang": "简体中文",
- "details": "详情",
- "list": "列表",
- "grid": "网格",
- "icons": "图标",
- "name": "文件名",
- "lastModified": "修改时间",
- "size": "大小",
- "parentDirectory": "上层文件夹",
- "empty": "空文件夹",
- "folders": "文件夹",
- "files": "文件",
- "download": "下载",
- "noMatch": "没有匹配",
- "dateFormat": "YYYY-MM-DD HH:mm",
- "filter": "过滤",
- "delete": "删除"
+ "lang": "简体中文",
+ "details": "详情",
+ "list": "列表",
+ "grid": "网格",
+ "icons": "图标",
+ "name": "文件名",
+ "lastModified": "修改时间",
+ "size": "大小",
+ "parentDirectory": "上层文件夹",
+ "empty": "空文件夹",
+ "folders": "文件夹",
+ "files": "文件",
+ "download": "下载",
+ "noMatch": "没有匹配",
+ "dateFormat": "YYYY-MM-DD HH:mm",
+ "filter": "过滤",
+ "delete": "删除"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/l10n/zh-tw.json b/src/_h5ai/conf/l10n/zh-tw.json
index 1e3251f1..5855331c 100644
--- a/src/_h5ai/conf/l10n/zh-tw.json
+++ b/src/_h5ai/conf/l10n/zh-tw.json
@@ -1,19 +1,19 @@
{
- "lang": "正體中文",
- "details": "詳細資料",
- "list": "清單",
- "grid": "網格",
- "icons": "圖示",
- "name": "檔名",
- "lastModified": "上次修改",
- "size": "大小",
- "parentDirectory": "上層目錄",
- "empty": "空資料夾",
- "folders": "資料夾",
- "files": "檔案",
- "download": "下載",
- "noMatch": "沒有符合的檔案",
- "dateFormat": "YYYY-MM-DD HH:mm",
- "filter": "過濾",
- "delete": "刪除"
+ "lang": "正體中文",
+ "details": "詳細資料",
+ "list": "清單",
+ "grid": "網格",
+ "icons": "圖示",
+ "name": "檔名",
+ "lastModified": "上次修改",
+ "size": "大小",
+ "parentDirectory": "上層目錄",
+ "empty": "空資料夾",
+ "folders": "資料夾",
+ "files": "檔案",
+ "download": "下載",
+ "noMatch": "沒有符合的檔案",
+ "dateFormat": "YYYY-MM-DD HH:mm",
+ "filter": "過濾",
+ "delete": "刪除"
}
\ No newline at end of file
diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json
index 6ac2af73..13060b6e 100644
--- a/src/_h5ai/conf/options.json
+++ b/src/_h5ai/conf/options.json
@@ -6,350 +6,350 @@ Options
*/
{
- /*
- Spacing of the main content.
+ /*
+ Spacing of the main content.
- Left and right will be added to a minimum of 30px. Top and bottom
- are added to the top and bottom bar heights.
- */
- "spacing": {
- "top": 50,
- "bottom": 50,
- "left": "auto",
- "right": "auto",
- "maxWidth": 1024
- },
+ Left and right will be added to a minimum of 30px. Top and bottom
+ are added to the top and bottom bar heights.
+ */
+ "spacing": {
+ "top": 50,
+ "bottom": 50,
+ "left": "auto",
+ "right": "auto",
+ "maxWidth": 1024
+ },
- /*
- General view options.
+ /*
+ General view options.
- - binaryPrefix: set to true uses 1024B=1KiB when formatting file sizes (see http://en.wikipedia.org/wiki/Binary_prefix)
- - hidden: don't list items matching these regular expressions
- - hideFolders: hide all folders in the main view
- - hideIf403: hide files and folders that are not readable by the server
- - hideParentFolder: hide parent folder links in the main view
- - modes: array, subset of ["details", "grid", "icons"]
- the first value indicates the default view mode. If only one value
- is given the view mode is fixed and the selector buttons are hidden.
- The user selected view mode is also stored local in modern browsers
- so that it will be persistent.
- - setParentFolderLabels: set parent folder labels to real folder names
- - sizes: array, subset of [16, 24, 32, 48, 64, 96, 128, 192, 256, 384]
- the first value indicates the default view mode. If only one value
- is given the view mode is fixed and the selector buttons are hidden.
- The user selected view mode is also stored local in modern browsers
- so that it will be persistent.
- - smartBrowsing: use History API if available (no need to reload the whole page)
- - theme: name of one of the folders in "_{{pkg.name}}/client/themes", defaults to builtin fallback
- - unmanaged: don't manage folders containing one of those files
- - unmanagedInNewWindow: open unmanaged links in new window/tab
- */
- "view": {
- "binaryPrefix": false,
- "hidden": ["^\\.", "^_{{pkg.name}}"],
- "hideFolders": false,
- "hideIf403": true,
- "hideParentFolder": false,
- "modes": ["details", "grid", "icons"],
- "setParentFolderLabels": true,
- "sizes": [24, 32, 48, 64, 96],
- "smartBrowsing": true,
- "theme": "",
- "unmanaged": ["index.html", "index.htm", "index.php"],
- "unmanagedInNewWindow": false
- },
+ - binaryPrefix: set to true uses 1024B=1KiB when formatting file sizes (see http://en.wikipedia.org/wiki/Binary_prefix)
+ - hidden: don't list items matching these regular expressions
+ - hideFolders: hide all folders in the main view
+ - hideIf403: hide files and folders that are not readable by the server
+ - hideParentFolder: hide parent folder links in the main view
+ - modes: array, subset of ["details", "grid", "icons"]
+ the first value indicates the default view mode. If only one value
+ is given the view mode is fixed and the selector buttons are hidden.
+ The user selected view mode is also stored local in modern browsers
+ so that it will be persistent.
+ - setParentFolderLabels: set parent folder labels to real folder names
+ - sizes: array, subset of [16, 24, 32, 48, 64, 96, 128, 192, 256, 384]
+ the first value indicates the default view mode. If only one value
+ is given the view mode is fixed and the selector buttons are hidden.
+ The user selected view mode is also stored local in modern browsers
+ so that it will be persistent.
+ - smartBrowsing: use History API if available (no need to reload the whole page)
+ - theme: name of one of the folders in "_{{pkg.name}}/client/themes", defaults to builtin fallback
+ - unmanaged: don't manage folders containing one of those files
+ - unmanagedInNewWindow: open unmanaged links in new window/tab
+ */
+ "view": {
+ "binaryPrefix": false,
+ "hidden": ["^\\.", "^_{{pkg.name}}"],
+ "hideFolders": false,
+ "hideIf403": true,
+ "hideParentFolder": false,
+ "modes": ["details", "grid", "icons"],
+ "setParentFolderLabels": true,
+ "sizes": [24, 32, 48, 64, 96],
+ "smartBrowsing": true,
+ "theme": "",
+ "unmanaged": ["index.html", "index.htm", "index.php"],
+ "unmanagedInNewWindow": false
+ },
- /*** Extensions (in alphabetical order) ***/
+ /*** Extensions (in alphabetical order) ***/
- /*
- Watch and update current folder content.
+ /*
+ Watch and update current folder content.
- - interval: number, update interval in milliseconds, at least 1000
- */
- "autorefresh": {
- "enabled": false,
- "interval": 5000
- },
+ - interval: number, update interval in milliseconds, at least 1000
+ */
+ "autorefresh": {
+ "enabled": false,
+ "interval": 5000
+ },
- /*
- Show a clickable breadcrumb.
- */
- "crumb": {
- "enabled": true
- },
+ /*
+ Show a clickable breadcrumb.
+ */
+ "crumb": {
+ "enabled": true
+ },
- /*
- Allow customized header and footer files.
- First checks for files "_h5ai.header.html" and "_h5ai.footer.html" in the current directory.
- If not successful it checks all parent directories (starting in the current directory) for
- files "_h5ai.headers.html" and "_h5ai.footers.html".
- Note the different filenames: "header" (only current) - "headers" (current and sub directories)!
- The file's content will be placed inside a
tag above/below the main content.
- If a file's extension is ".md" instead of ".html" its content will be interpreted as markdown.
- */
- "custom": {
- "enabled": true
- },
+ /*
+ Allow customized header and footer files.
+ First checks for files "_h5ai.header.html" and "_h5ai.footer.html" in the current directory.
+ If not successful it checks all parent directories (starting in the current directory) for
+ files "_h5ai.headers.html" and "_h5ai.footers.html".
+ Note the different filenames: "header" (only current) - "headers" (current and sub directories)!
+ The file's content will be placed inside a
tag above/below the main content.
+ If a file's extension is ".md" instead of ".html" its content will be interpreted as markdown.
+ */
+ "custom": {
+ "enabled": true
+ },
- /*
- Enable packaged download of selected entries.
- To select files the "select"-extension needs to be enabled.
+ /*
+ Enable packaged download of selected entries.
+ To select files the "select"-extension needs to be enabled.
- - type: "php-tar", "shell-tar" or "shell-zip"
- - packageName: basename of the download package, null for current foldername
- - alwaysVisible: always show download button (defaults to download the current folder)
- */
- "download": {
- "enabled": true,
- "type": "php-tar",
- "packageName": null,
- "alwaysVisible": false
- },
+ - type: "php-tar", "shell-tar" or "shell-zip"
+ - packageName: basename of the download package, null for current foldername
+ - alwaysVisible: always show download button (defaults to download the current folder)
+ */
+ "download": {
+ "enabled": true,
+ "type": "php-tar",
+ "packageName": null,
+ "alwaysVisible": false
+ },
- /*
- Allow filtering the displayed files and folders.
- Will check entries for right order of characters, i.e.
- "ab" matches "ab", "axb", "xaxbx" but not "ba".
- Space separated sequences get OR-ed.
+ /*
+ Allow filtering the displayed files and folders.
+ Will check entries for right order of characters, i.e.
+ "ab" matches "ab", "axb", "xaxbx" but not "ba".
+ Space separated sequences get OR-ed.
- Filters will be treated as JavaScript regular expressions
- if you prefix them with "re:".
- */
- "filter": {
- "enabled": true
- },
+ Filters will be treated as JavaScript regular expressions
+ if you prefix them with "re:".
+ */
+ "filter": {
+ "enabled": true
+ },
- /*
- Calc the size of folders.
- This operation is real slow. The calculated sizes differ slightly for both
- calculation types since "php" only adds the file size, while "shell-du"
- also adds the sizes for the actual folder files.
+ /*
+ Calc the size of folders.
+ This operation is real slow. The calculated sizes differ slightly for both
+ calculation types since "php" only adds the file size, while "shell-du"
+ also adds the sizes for the actual folder files.
- - type: "php" (sloooow) or "shell-du" (sloow)
- */
- "foldersize": {
- "enabled": false,
- "type": "php"
- },
+ - type: "php" (sloooow) or "shell-du" (sloow)
+ */
+ "foldersize": {
+ "enabled": false,
+ "type": "php"
+ },
- /*
- Adds Google Analytics asynchronous tracking code.
+ /*
+ Adds Google Analytics asynchronous tracking code.
- for example:
- "gaq": [
- ["_setAccount", "UA-xxxxxx-x"],
- ["_setDomainName", ".your-domain.tld"],
- ["_trackPageview"],
- ["_trackPageLoadTime"]
- ]
+ for example:
+ "gaq": [
+ ["_setAccount", "UA-xxxxxx-x"],
+ ["_setDomainName", ".your-domain.tld"],
+ ["_trackPageview"],
+ ["_trackPageLoadTime"]
+ ]
- see: https://developers.google.com/analytics/devguides/collection/gajs/
- */
- "google-analytics-ga": {
- "enabled": false,
- "gaq": []
- },
+ see: https://developers.google.com/analytics/devguides/collection/gajs/
+ */
+ "google-analytics-ga": {
+ "enabled": false,
+ "gaq": []
+ },
- /*
- Adds Google Universial Analytics asynchronous tracking code.
+ /*
+ Adds Google Universial Analytics asynchronous tracking code.
- see: https://developers.google.com/analytics/devguides/collection/analyticsjs/
- */
- "google-analytics-ua": {
- "enabled": false,
- "id": "UA-000000-0"
- },
+ see: https://developers.google.com/analytics/devguides/collection/analyticsjs/
+ */
+ "google-analytics-ua": {
+ "enabled": false,
+ "id": "UA-000000-0"
+ },
- /*
- Localization, for example "en", "de" etc. - see "_h5ai/conf/l10n" folder for
- possible values. Adjust it to your needs. If lang is not found
- it defaults to "en".
+ /*
+ Localization, for example "en", "de" etc. - see "_h5ai/conf/l10n" folder for
+ possible values. Adjust it to your needs. If lang is not found
+ it defaults to "en".
- - lang: default language
- - useBroserLang: boolean, try to use browser language
- */
- "l10n": {
- "enabled": true,
- "lang": "en",
- "useBrowserLang": true
- },
+ - lang: default language
+ - useBroserLang: boolean, try to use browser language
+ */
+ "l10n": {
+ "enabled": true,
+ "lang": "en",
+ "useBrowserLang": true
+ },
- /*
- Link the hover effects between crumb, main view and tree.
- */
- "link-hover-states": {
- "enabled": true
- },
+ /*
+ Link the hover effects between crumb, main view and tree.
+ */
+ "link-hover-states": {
+ "enabled": true
+ },
- /*
- Adds Piwik tracker javascript code.
+ /*
+ Adds Piwik tracker javascript code.
- - baseURL: do not include the protocol, e.g. "mydomain.tld/piwik"
- - idSite: number
- */
- "piwik-analytics": {
- "enabled": false,
- "baseURL": "some/url",
- "idSite": 1
- },
+ - baseURL: do not include the protocol, e.g. "mydomain.tld/piwik"
+ - idSite: number
+ */
+ "piwik-analytics": {
+ "enabled": false,
+ "baseURL": "some/url",
+ "idSite": 1
+ },
- /*
- Play a audio preview on click.
+ /*
+ Play a audio preview on click.
- - types: array of types
- */
- "preview-aud": {
- "enabled": true,
- "types": ["aud"]
- },
+ - types: array of types
+ */
+ "preview-aud": {
+ "enabled": true,
+ "types": ["aud"]
+ },
- /*
- Show an image preview on click.
+ /*
+ Show an image preview on click.
- - types: array of types
- */
- "preview-img": {
- "enabled": true,
- "types": ["img", "img-bmp", "img-gif", "img-ico", "img-jpg", "img-png"]
- },
+ - types: array of types
+ */
+ "preview-img": {
+ "enabled": true,
+ "types": ["img", "img-bmp", "img-gif", "img-ico", "img-jpg", "img-png"]
+ },
- /*
- Show text file preview on click.
- "types" maps file types to http://prismjs.com languages.
+ /*
+ Show text file preview on click.
+ "types" maps file types to http://prismjs.com languages.
- Additional type are:
- - "markdown" to render Markdown text
- - "none" for floating text
- - "fixed" for fixed width text
+ Additional type are:
+ - "markdown" to render Markdown text
+ - "none" for floating text
+ - "fixed" for fixed width text
- - types: maps types to languages
- */
- "preview-txt": {
- "enabled": true,
- "types": {
- "txt": "fixed",
- "txt-authors": "fixed",
- "txt-license": "fixed",
- "txt-c": "c",
- "txt-cpp": "cpp",
- "txt-css": "css",
- "txt-diff": "fixed",
- "txt-h": "c",
- "txt-hpp": "cpp",
- "txt-install": "fixed",
- "txt-log": "fixed",
- "txt-java": "java",
- "txt-js": "javascript",
- "txt-json": "javascript",
- "txt-makefile": "fixed",
- "txt-md": "markdown",
- // "txt-php": "php",
- "txt-py": "python",
- "txt-readme": "fixed",
- "txt-rb": "ruby",
- "txt-rtf": "fixed",
- "txt-script": "bash",
- "txt-xml": "fixed"
- }
- },
+ - types: maps types to languages
+ */
+ "preview-txt": {
+ "enabled": true,
+ "types": {
+ "txt": "fixed",
+ "txt-authors": "fixed",
+ "txt-license": "fixed",
+ "txt-c": "c",
+ "txt-cpp": "cpp",
+ "txt-css": "css",
+ "txt-diff": "fixed",
+ "txt-h": "c",
+ "txt-hpp": "cpp",
+ "txt-install": "fixed",
+ "txt-log": "fixed",
+ "txt-java": "java",
+ "txt-js": "javascript",
+ "txt-json": "javascript",
+ "txt-makefile": "fixed",
+ "txt-md": "markdown",
+ // "txt-php": "php",
+ "txt-py": "python",
+ "txt-readme": "fixed",
+ "txt-rb": "ruby",
+ "txt-rtf": "fixed",
+ "txt-script": "bash",
+ "txt-xml": "fixed"
+ }
+ },
- /*
- Play a video preview on click.
+ /*
+ Play a video preview on click.
- - types: array of types
- */
- "preview-vid": {
- "enabled": true,
- "types": ["vid-avi", "vid-flv", "vid-mkv", "vid-mov", "vid-mp4", "vid-mpg", "vid-webm"]
- },
+ - types: array of types
+ */
+ "preview-vid": {
+ "enabled": true,
+ "types": ["vid-avi", "vid-flv", "vid-mkv", "vid-mov", "vid-mp4", "vid-mpg", "vid-webm"]
+ },
- /*
- Show QRCodes on hovering files.
+ /*
+ Show QRCodes on hovering files.
- - size: width and height in pixel
- */
- "qrcode": {
- "enabled": true,
- "size": 150
- },
+ - size: width and height in pixel
+ */
+ "qrcode": {
+ "enabled": true,
+ "size": 150
+ },
- /*
- Make entries selectable (first mouse button + drag).
- At the moment only needed for packaged download.
+ /*
+ Make entries selectable (first mouse button + drag).
+ At the moment only needed for packaged download.
- - checkboxes: boolean, show a checkbox on mouse over item
- */
- "select": {
- "enabled": true,
- "checkboxes": true
- },
+ - checkboxes: boolean, show a checkbox on mouse over item
+ */
+ "select": {
+ "enabled": true,
+ "checkboxes": true
+ },
- /*
- Default sort order.
- "column" and "reverse" are locally stored.
+ /*
+ Default sort order.
+ "column" and "reverse" are locally stored.
- - column: int, 0 for "Name", 1 for "Date", 2 for "Size"
- - reverse: boolean, false for ascending, true for descending
- - ignorecase: boolean, compare ignorecase
- - natural: boolean, use natural sort order
- - folders: where to place folders, 0 for "top", 1 for "in place", 2 for "bottom"
- */
- "sort": {
- "enabled": true,
- "column": 0,
- "reverse": false,
- "ignorecase": true,
- "natural": false,
- "folders": 0
- },
+ - column: int, 0 for "Name", 1 for "Date", 2 for "Size"
+ - reverse: boolean, false for ascending, true for descending
+ - ignorecase: boolean, compare ignorecase
+ - natural: boolean, use natural sort order
+ - folders: where to place folders, 0 for "top", 1 for "in place", 2 for "bottom"
+ */
+ "sort": {
+ "enabled": true,
+ "column": 0,
+ "reverse": false,
+ "ignorecase": true,
+ "natural": false,
+ "folders": 0
+ },
- /*
- Show additional info in a statusbar.
- */
- "statusbar": {
- "enabled": true
- },
+ /*
+ Show additional info in a statusbar.
+ */
+ "statusbar": {
+ "enabled": true
+ },
- /*
- Show thumbnails for image files. Needs the "/_{{pkg.name}}/cache" folder to be
- writable for the web Server.
+ /*
+ Show thumbnails for image files. Needs the "/_{{pkg.name}}/cache" folder to be
+ writable for the web Server.
- - img: array of types
- - mov: array of types
- - doc: array of types
- - delay: delay in milliseconds after "dom-ready" before thumb-requesting starts
- - size: number, size in pixel of the generated thumbnails
- - exif: boolean, use included EXIF thumbs if possible
- */
- "thumbnails": {
- "enabled": true,
- "img": ["img-bmp", "img-gif", "img-ico", "img-jpg", "img-png"],
- "mov": ["vid-avi", "vid-flv", "vid-mkv", "vid-mov", "vid-mp4", "vid-mpg", "vid-webm"],
- "doc": ["x-pdf", "x-ps"],
- "delay": 1,
- "size": 96,
- "exif": true
- },
+ - img: array of types
+ - mov: array of types
+ - doc: array of types
+ - delay: delay in milliseconds after "dom-ready" before thumb-requesting starts
+ - size: number, size in pixel of the generated thumbnails
+ - exif: boolean, use included EXIF thumbs if possible
+ */
+ "thumbnails": {
+ "enabled": true,
+ "img": ["img-bmp", "img-gif", "img-ico", "img-jpg", "img-png"],
+ "mov": ["vid-avi", "vid-flv", "vid-mkv", "vid-mov", "vid-mp4", "vid-mpg", "vid-webm"],
+ "doc": ["x-pdf", "x-ps"],
+ "delay": 1,
+ "size": 96,
+ "exif": true
+ },
- /*
- Replace window title with current breadcrumb.
- */
- "title": {
- "enabled": true
- },
+ /*
+ Replace window title with current breadcrumb.
+ */
+ "title": {
+ "enabled": true
+ },
- /*
- Show a folder tree.
- Note that this might affect performance significantly.
+ /*
+ Show a folder tree.
+ Note that this might affect performance significantly.
- - slide: boolean, slide tree bar into viewport if there is enough space
- - maxSubfolders: max number of subfolders to show in tree
- */
- "tree": {
- "enabled": true,
- "slide": true,
- "maxSubfolders": 50
- }
+ - slide: boolean, slide tree bar into viewport if there is enough space
+ - maxSubfolders: max number of subfolders to show in tree
+ */
+ "tree": {
+ "enabled": true,
+ "slide": true,
+ "maxSubfolders": 50
+ }
}
diff --git a/src/_h5ai/conf/types.json b/src/_h5ai/conf/types.json
index d0ac390c..97603f38 100644
--- a/src/_h5ai/conf/types.json
+++ b/src/_h5ai/conf/types.json
@@ -6,77 +6,77 @@ File types mapped to file extensions
*/
{
- // "txt-authors": ["author*"],
- // "txt-install": ["install*"],
- // "txt-license": ["copying*", "license*"],
- // "txt-readme": ["readme*"],
+ // "txt-authors": ["author*"],
+ // "txt-install": ["install*"],
+ // "txt-license": ["copying*", "license*"],
+ // "txt-readme": ["readme*"],
- "ar": ["*.tar.bz2", "*.crx"],
- "ar-apk": ["*.apk"],
- "ar-deb": ["*.deb"],
- "ar-gz": ["*.gz", "*.tar.gz", "*.tgz"],
- "ar-rar": ["*.rar"],
- "ar-rpm": ["*.rpm"],
- "ar-tar": ["*.tar"],
- "ar-zip": ["*.7z", "*.bz2", "*.jar", "*.lzma", "*.war", "*.z", "*.Z", "*.zip"],
- "aud": ["*.aif", "*.aiff", "*.flac", "*.m4a", "*.mid", "*.mp3", "*.mpa", "*.ra", "*.ogg", "*.wav", "*.wma"],
- "aud-pls": ["*.m3u", "*.m3u8", "*.pls"],
- "bak": ["*.bak", "*~"],
- "bin": ["*.class", "*.o", "*.so"],
- "bin-exe": ["*.bat", "*.cmd", "*.exe"],
- "disc": ["*.cue", "*.iso"],
- "img": ["*.xpm"],
- "img-bmp": ["*.bmp"],
- "img-gif": ["*.gif"],
- "img-ico": ["*.ico"],
- "img-jpg": ["*.jpg", "*.jpeg"],
- "img-png": ["*.png"],
- "img-tiff": ["*.tiff"],
- "txt": ["*.text", "*.txt"],
- "txt-build": ["*.pom", "build.xml", "pom.xml"],
- "txt-c": ["*.c"],
- "txt-cpp": ["*.cpp"],
- "txt-css": ["*.css", "*.less"],
- "txt-diff": ["*.diff", "*.patch"],
- "txt-h": ["*.h"],
- "txt-html": ["*.htm", "*.html", "*.shtml", "*.xhtml"],
- "txt-hpp": ["*.hpp"],
- "txt-java": ["*.java"],
- "txt-js": ["*.js"],
- "txt-json": ["*.json"],
- "txt-log": ["*.log", "changelog*"],
- "txt-md": ["*.markdown", "*.md"],
- "txt-php": ["*.php"],
- "txt-py": ["*.py"],
- "txt-rb": ["*.rb"],
- "txt-rss": ["*.rss"],
- "txt-rtf": ["*.rtf"],
- "txt-script": ["*.conf", "*.bsh", "*.csh", "*.ini", "*.ksh", "*.sh", "*.shar", "*.tcl", "*.zsh"],
- "txt-source": [],
- "txt-svg": ["*.svg"],
- "txt-tex": ["*.tex"],
- "txt-vcal": ["*.vcal"],
- "txt-xml": ["*.xml"],
- "vid": [],
- "vid-avi": ["*.avi"],
- "vid-flv": ["*.flv"],
- "vid-mkv": ["*.mkv"],
- "vid-mov": ["*.mov"],
- "vid-mp4": ["*.mp4", "*.m4v"],
- "vid-mpg": ["*.mpg"],
- "vid-rm": ["*.rm"],
- "vid-swf": ["*.swf"],
- "vid-ts": ["*.ts"],
- "vid-vob": ["*.vob"],
- "vid-webm": ["*.webm"],
- "vid-wmv": ["*.wmv"],
- "x": [],
- "x-calc": ["*.ods", "*.ots", "*.xlr", "*.xls", "*.xlsx"],
- "x-doc": ["*.doc", "*.docx", "*.odm", "*.odt", "*.ott"],
- "x-draw": ["*.drw"],
- "x-eps": ["*.eps"],
- "x-pdf": ["*.pdf"],
- "x-pres": ["*.odp", "*.otp", "*.pps", "*.ppt", "*.pptx"],
- "x-ps": ["*.ps"],
- "x-psd": ["*.psd"]
+ "ar": ["*.tar.bz2", "*.crx"],
+ "ar-apk": ["*.apk"],
+ "ar-deb": ["*.deb"],
+ "ar-gz": ["*.gz", "*.tar.gz", "*.tgz"],
+ "ar-rar": ["*.rar"],
+ "ar-rpm": ["*.rpm"],
+ "ar-tar": ["*.tar"],
+ "ar-zip": ["*.7z", "*.bz2", "*.jar", "*.lzma", "*.war", "*.z", "*.Z", "*.zip"],
+ "aud": ["*.aif", "*.aiff", "*.flac", "*.m4a", "*.mid", "*.mp3", "*.mpa", "*.ra", "*.ogg", "*.wav", "*.wma"],
+ "aud-pls": ["*.m3u", "*.m3u8", "*.pls"],
+ "bak": ["*.bak", "*~"],
+ "bin": ["*.class", "*.o", "*.so"],
+ "bin-exe": ["*.bat", "*.cmd", "*.exe"],
+ "disc": ["*.cue", "*.iso"],
+ "img": ["*.xpm"],
+ "img-bmp": ["*.bmp"],
+ "img-gif": ["*.gif"],
+ "img-ico": ["*.ico"],
+ "img-jpg": ["*.jpg", "*.jpeg"],
+ "img-png": ["*.png"],
+ "img-tiff": ["*.tiff"],
+ "txt": ["*.text", "*.txt"],
+ "txt-build": ["*.pom", "build.xml", "pom.xml"],
+ "txt-c": ["*.c"],
+ "txt-cpp": ["*.cpp"],
+ "txt-css": ["*.css", "*.less"],
+ "txt-diff": ["*.diff", "*.patch"],
+ "txt-h": ["*.h"],
+ "txt-html": ["*.htm", "*.html", "*.shtml", "*.xhtml"],
+ "txt-hpp": ["*.hpp"],
+ "txt-java": ["*.java"],
+ "txt-js": ["*.js"],
+ "txt-json": ["*.json"],
+ "txt-log": ["*.log", "changelog*"],
+ "txt-md": ["*.markdown", "*.md"],
+ "txt-php": ["*.php"],
+ "txt-py": ["*.py"],
+ "txt-rb": ["*.rb"],
+ "txt-rss": ["*.rss"],
+ "txt-rtf": ["*.rtf"],
+ "txt-script": ["*.conf", "*.bsh", "*.csh", "*.ini", "*.ksh", "*.sh", "*.shar", "*.tcl", "*.zsh"],
+ "txt-source": [],
+ "txt-svg": ["*.svg"],
+ "txt-tex": ["*.tex"],
+ "txt-vcal": ["*.vcal"],
+ "txt-xml": ["*.xml"],
+ "vid": [],
+ "vid-avi": ["*.avi"],
+ "vid-flv": ["*.flv"],
+ "vid-mkv": ["*.mkv"],
+ "vid-mov": ["*.mov"],
+ "vid-mp4": ["*.mp4", "*.m4v"],
+ "vid-mpg": ["*.mpg"],
+ "vid-rm": ["*.rm"],
+ "vid-swf": ["*.swf"],
+ "vid-ts": ["*.ts"],
+ "vid-vob": ["*.vob"],
+ "vid-webm": ["*.webm"],
+ "vid-wmv": ["*.wmv"],
+ "x": [],
+ "x-calc": ["*.ods", "*.ots", "*.xlr", "*.xls", "*.xlsx"],
+ "x-doc": ["*.doc", "*.docx", "*.odm", "*.odt", "*.ott"],
+ "x-draw": ["*.drw"],
+ "x-eps": ["*.eps"],
+ "x-pdf": ["*.pdf"],
+ "x-pres": ["*.odp", "*.otp", "*.pps", "*.ppt", "*.pptx"],
+ "x-ps": ["*.ps"],
+ "x-psd": ["*.psd"]
}
diff --git a/src/_h5ai/index.html.jade b/src/_h5ai/index.html.jade
index d248a2f2..101f7d23 100644
--- a/src/_h5ai/index.html.jade
+++ b/src/_h5ai/index.html.jade
@@ -1,43 +1,43 @@
doctype html
//if lt IE 10
-
+
//[if gt IE 9]>actions = array("login", "logout", "get", "getThumbHref", "download");
- $this->app = $app;
- $this->options = $app->get_options();
- }
+ $this->actions = array("login", "logout", "get", "getThumbHref", "download");
+ $this->app = $app;
+ $this->options = $app->get_options();
+ }
- public function apply() {
+ public function apply() {
- $action = use_request_param("action");
- json_fail(100, "unsupported request", !in_array($action, $this->actions));
+ $action = use_request_param("action");
+ json_fail(100, "unsupported request", !in_array($action, $this->actions));
- $methodname = "on_${action}";
- $this->$methodname();
- }
+ $methodname = "on_${action}";
+ $this->$methodname();
+ }
- private function on_login() {
+ private function on_login() {
- $pass = use_request_param("pass");
- $_SESSION[AS_ADMIN_SESSION_KEY] = sha1($pass) === PASSHASH;
- json_exit(array("as_admin" => $_SESSION[AS_ADMIN_SESSION_KEY]));
- }
+ $pass = use_request_param("pass");
+ $_SESSION[AS_ADMIN_SESSION_KEY] = sha1($pass) === PASSHASH;
+ json_exit(array("as_admin" => $_SESSION[AS_ADMIN_SESSION_KEY]));
+ }
- private function on_logout() {
+ private function on_logout() {
- $_SESSION[AS_ADMIN_SESSION_KEY] = false;
- json_exit(array("as_admin" => $_SESSION[AS_ADMIN_SESSION_KEY]));
- }
+ $_SESSION[AS_ADMIN_SESSION_KEY] = false;
+ json_exit(array("as_admin" => $_SESSION[AS_ADMIN_SESSION_KEY]));
+ }
- private function on_get() {
+ private function on_get() {
- $response = array();
+ $response = array();
- if (has_request_param("setup")) {
+ if (has_request_param("setup")) {
- use_request_param("setup");
- $response["setup"] = $this->app->get_setup();
- }
+ use_request_param("setup");
+ $response["setup"] = $this->app->get_setup();
+ }
- if (has_request_param("options")) {
+ if (has_request_param("options")) {
- use_request_param("options");
- $response["options"] = $this->app->get_options();
- }
+ use_request_param("options");
+ $response["options"] = $this->app->get_options();
+ }
- if (has_request_param("types")) {
+ if (has_request_param("types")) {
- use_request_param("types");
- $response["types"] = $this->app->get_types();
- }
+ use_request_param("types");
+ $response["types"] = $this->app->get_types();
+ }
- if (has_request_param("theme")) {
+ if (has_request_param("theme")) {
- use_request_param("theme");
- $response["theme"] = $this->app->get_theme();
- }
+ use_request_param("theme");
+ $response["theme"] = $this->app->get_theme();
+ }
- if (has_request_param("langs")) {
+ if (has_request_param("langs")) {
- use_request_param("langs");
- $response["langs"] = $this->app->get_l10n_list();
- }
+ use_request_param("langs");
+ $response["langs"] = $this->app->get_l10n_list();
+ }
- if (has_request_param("l10n")) {
+ if (has_request_param("l10n")) {
- use_request_param("l10n");
- $iso_codes = use_request_param("l10nCodes");
- $iso_codes = explode(":", $iso_codes);
- $response["l10n"] = $this->app->get_l10n($iso_codes);
- }
+ use_request_param("l10n");
+ $iso_codes = use_request_param("l10nCodes");
+ $iso_codes = explode(":", $iso_codes);
+ $response["l10n"] = $this->app->get_l10n($iso_codes);
+ }
- if (has_request_param("custom")) {
+ if (has_request_param("custom")) {
- use_request_param("custom");
- $url = use_request_param("customHref");
- $response["custom"] = $this->app->get_customizations($url);
- }
+ use_request_param("custom");
+ $url = use_request_param("customHref");
+ $response["custom"] = $this->app->get_customizations($url);
+ }
- if (has_request_param("items")) {
+ if (has_request_param("items")) {
- use_request_param("items");
- $url = use_request_param("itemsHref");
- $what = use_request_param("itemsWhat");
- $what = is_numeric($what) ? intval($what, 10) : 1;
- $response["items"] = $this->app->get_items($url, $what);
- }
+ use_request_param("items");
+ $url = use_request_param("itemsHref");
+ $what = use_request_param("itemsWhat");
+ $what = is_numeric($what) ? intval($what, 10) : 1;
+ $response["items"] = $this->app->get_items($url, $what);
+ }
- if (has_request_param("all_items")) {
+ if (has_request_param("all_items")) {
- use_request_param("all_items");
- $response["all_items"] = $this->app->get_all_items();
- }
+ use_request_param("all_items");
+ $response["all_items"] = $this->app->get_all_items();
+ }
- if (AS_ADMIN && count($_REQUEST)) {
- $response["unused"] = $_REQUEST;
- }
+ if (AS_ADMIN && count($_REQUEST)) {
+ $response["unused"] = $_REQUEST;
+ }
- json_exit($response);
- }
+ json_exit($response);
+ }
- private function on_getThumbHref() {
+ private function on_getThumbHref() {
- json_fail(1, "thumbnails disabled", !$this->options["thumbnails"]["enabled"]);
- json_fail(2, "thumbnails not supported", !HAS_PHP_JPG);
+ json_fail(1, "thumbnails disabled", !$this->options["thumbnails"]["enabled"]);
+ json_fail(2, "thumbnails not supported", !HAS_PHP_JPG);
- $type = use_request_param("type");
- $src_url = use_request_param("href");
- $mode = use_request_param("mode");
- $width = use_request_param("width");
- $height = use_request_param("height");
+ $type = use_request_param("type");
+ $src_url = use_request_param("href");
+ $mode = use_request_param("mode");
+ $width = use_request_param("width");
+ $height = use_request_param("height");
- $thumb = new Thumb($this->app);
- $thumb_url = $thumb->thumb($type, $src_url, $mode, $width, $height);
- json_fail(3, "thumbnail creation failed", $thumb_url === null);
+ $thumb = new Thumb($this->app);
+ $thumb_url = $thumb->thumb($type, $src_url, $mode, $width, $height);
+ json_fail(3, "thumbnail creation failed", $thumb_url === null);
- json_exit(array("absHref" => $thumb_url));
- }
+ json_exit(array("absHref" => $thumb_url));
+ }
- private function on_download() {
+ private function on_download() {
- json_fail(1, "downloads disabled", !$this->options["download"]["enabled"]);
+ json_fail(1, "downloads disabled", !$this->options["download"]["enabled"]);
- $as = use_request_param("as");
- $type = use_request_param("type");
- $hrefs = use_request_param("hrefs");
+ $as = use_request_param("as");
+ $type = use_request_param("type");
+ $hrefs = use_request_param("hrefs");
- $archive = new Archive($this->app);
+ $archive = new Archive($this->app);
- $hrefs = explode("|:|", trim($hrefs));
+ $hrefs = explode("|:|", trim($hrefs));
- set_time_limit(0);
- header("Content-Type: application/octet-stream");
- header("Content-Disposition: attachment; filename=\"$as\"");
- header("Connection: close");
- $rc = $archive->output($type, $hrefs);
+ set_time_limit(0);
+ header("Content-Type: application/octet-stream");
+ header("Content-Disposition: attachment; filename=\"$as\"");
+ header("Connection: close");
+ $rc = $archive->output($type, $hrefs);
- json_fail(2, "packaging failed", $rc !== 0);
- exit;
- }
+ json_fail(2, "packaging failed", $rc !== 0);
+ exit;
+ }
}
diff --git a/src/_h5ai/server/php/inc/class-app.php b/src/_h5ai/server/php/inc/class-app.php
index 6b786c32..003f2c81 100644
--- a/src/_h5ai/server/php/inc/class-app.php
+++ b/src/_h5ai/server/php/inc/class-app.php
@@ -2,397 +2,397 @@
class App {
- private static $RE_DELIMITER = "|";
- private static $ICON_EXTS = array("svg", "png", "jpg");
- private static $CUSTOM_EXTS = array("html", "md");
+ private static $RE_DELIMITER = "|";
+ private static $ICON_EXTS = array("svg", "png", "jpg");
+ private static $CUSTOM_EXTS = array("html", "md");
- private $options;
+ private $options;
- public function __construct() {
+ public function __construct() {
- $this->options = load_commented_json(APP_PATH . "/conf/options.json");
- }
+ $this->options = load_commented_json(APP_PATH . "/conf/options.json");
+ }
- public function get_options() {
+ public function get_options() {
- return $this->options;
- }
+ return $this->options;
+ }
- public function get_setup() {
+ public function get_setup() {
- $consts = get_defined_constants(true);
- $setup = $consts["user"];
+ $consts = get_defined_constants(true);
+ $setup = $consts["user"];
- $setup["PHP_VERSION"] = PHP_VERSION;
- unset($setup["AS_ADMIN_SESSION_KEY"]);
- unset($setup["PASSHASH"]);
+ $setup["PHP_VERSION"] = PHP_VERSION;
+ unset($setup["AS_ADMIN_SESSION_KEY"]);
+ unset($setup["PASSHASH"]);
- if (!AS_ADMIN) {
- unset($setup["APP_PATH"]);
- unset($setup["CACHE_PATH"]);
- unset($setup["CURRENT_PATH"]);
- unset($setup["PHP_VERSION"]);
- unset($setup["ROOT_PATH"]);
- unset($setup["SERVER_NAME"]);
- unset($setup["SERVER_VERSION"]);
- }
+ if (!AS_ADMIN) {
+ unset($setup["APP_PATH"]);
+ unset($setup["CACHE_PATH"]);
+ unset($setup["CURRENT_PATH"]);
+ unset($setup["PHP_VERSION"]);
+ unset($setup["ROOT_PATH"]);
+ unset($setup["SERVER_NAME"]);
+ unset($setup["SERVER_VERSION"]);
+ }
- return $setup;
- }
+ return $setup;
+ }
- public function get_types() {
+ public function get_types() {
- return load_commented_json(APP_PATH . "/conf/types.json");
- }
+ return load_commented_json(APP_PATH . "/conf/types.json");
+ }
- public function get_theme() {
+ public function get_theme() {
- $theme = $this->options["view"]["theme"];
- $theme_path = APP_PATH . "/client/themes/${theme}/icons";
+ $theme = $this->options["view"]["theme"];
+ $theme_path = APP_PATH . "/client/themes/${theme}/icons";
- $icons = array();
+ $icons = array();
- if (is_dir($theme_path)) {
- if ($dir = opendir($theme_path)) {
- while (($name = readdir($dir)) !== false) {
- $path_parts = pathinfo($name);
- if (in_array($path_parts["extension"], App::$ICON_EXTS)) {
- $icons[$path_parts["filename"]] = "${theme}/icons/${name}";
- }
- }
- closedir($dir);
- }
- }
+ if (is_dir($theme_path)) {
+ if ($dir = opendir($theme_path)) {
+ while (($name = readdir($dir)) !== false) {
+ $path_parts = pathinfo($name);
+ if (in_array($path_parts["extension"], App::$ICON_EXTS)) {
+ $icons[$path_parts["filename"]] = "${theme}/icons/${name}";
+ }
+ }
+ closedir($dir);
+ }
+ }
- return $icons;
- }
+ return $icons;
+ }
- public function to_url($path, $trailing_slash = true) {
+ public function to_url($path, $trailing_slash = true) {
- $rel_path = substr($path, strlen(ROOT_PATH));
- $parts = explode("/", $rel_path);
- $encoded_parts = array();
- foreach ($parts as $part) {
- if ($part) {
- $encoded_parts[] = rawurlencode($part);
- }
- }
+ $rel_path = substr($path, strlen(ROOT_PATH));
+ $parts = explode("/", $rel_path);
+ $encoded_parts = array();
+ foreach ($parts as $part) {
+ if ($part) {
+ $encoded_parts[] = rawurlencode($part);
+ }
+ }
- return normalize_path(ROOT_HREF . implode("/", $encoded_parts), $trailing_slash);
- }
+ return normalize_path(ROOT_HREF . implode("/", $encoded_parts), $trailing_slash);
+ }
- public function to_path($url) {
+ public function to_path($url) {
- $rel_url = substr($url, strlen(ROOT_HREF));
- return normalize_path(ROOT_PATH . "/" . rawurldecode($rel_url));
- }
+ $rel_url = substr($url, strlen(ROOT_HREF));
+ return normalize_path(ROOT_PATH . "/" . rawurldecode($rel_url));
+ }
- public function is_hidden($name) {
+ public function is_hidden($name) {
- // always hide
- if ($name === "." || $name === "..") {
- return true;
- }
+ // always hide
+ if ($name === "." || $name === "..") {
+ return true;
+ }
- foreach ($this->options["view"]["hidden"] as $re) {
- $re = App::$RE_DELIMITER . str_replace(App::$RE_DELIMITER, '\\' . App::$RE_DELIMITER, $re) . App::$RE_DELIMITER;
- if (preg_match($re, $name)) {
- return true;
- }
- }
+ foreach ($this->options["view"]["hidden"] as $re) {
+ $re = App::$RE_DELIMITER . str_replace(App::$RE_DELIMITER, '\\' . App::$RE_DELIMITER, $re) . App::$RE_DELIMITER;
+ if (preg_match($re, $name)) {
+ return true;
+ }
+ }
- return false;
- }
+ return false;
+ }
- public function read_dir($path) {
+ public function read_dir($path) {
- $names = array();
- if (is_dir($path)) {
- if ($dir = opendir($path)) {
- while (($name = readdir($dir)) !== false) {
- if (
- $this->is_hidden($name)
- || $this->is_hidden($this->to_url($path) . $name)
- || (!is_readable($path .'/'. $name) && $this->options["view"]["hideIf403"])
- ) {
- continue;
- }
- $names[] = $name;
- }
- closedir($dir);
- }
- }
- return $names;
- }
+ $names = array();
+ if (is_dir($path)) {
+ if ($dir = opendir($path)) {
+ while (($name = readdir($dir)) !== false) {
+ if (
+ $this->is_hidden($name)
+ || $this->is_hidden($this->to_url($path) . $name)
+ || (!is_readable($path .'/'. $name) && $this->options["view"]["hideIf403"])
+ ) {
+ continue;
+ }
+ $names[] = $name;
+ }
+ closedir($dir);
+ }
+ }
+ return $names;
+ }
- public function is_managed_url($url) {
+ public function is_managed_url($url) {
- return $this->is_managed_path($this->to_path($url));
- }
+ return $this->is_managed_path($this->to_path($url));
+ }
- public function is_managed_path($path) {
+ public function is_managed_path($path) {
- if (!is_dir($path) || strpos($path, '../') !== false || strpos($path, '/..') !== false || $path === '..') {
- return false;
- }
+ if (!is_dir($path) || strpos($path, '../') !== false || strpos($path, '/..') !== false || $path === '..') {
+ return false;
+ }
- foreach ($this->options["view"]["unmanaged"] as $name) {
- if (file_exists($path . "/" . $name)) {
- return false;
- }
- }
+ foreach ($this->options["view"]["unmanaged"] as $name) {
+ if (file_exists($path . "/" . $name)) {
+ return false;
+ }
+ }
- while ($path !== ROOT_PATH) {
- if (@is_dir($path . "/_h5ai/server")) {
- return false;
- }
- $parent_path = normalize_path(dirname($path));
- if ($parent_path === $path) {
- return false;
- }
- $path = $parent_path;
- }
- return true;
- }
+ while ($path !== ROOT_PATH) {
+ if (@is_dir($path . "/_h5ai/server")) {
+ return false;
+ }
+ $parent_path = normalize_path(dirname($path));
+ if ($parent_path === $path) {
+ return false;
+ }
+ $path = $parent_path;
+ }
+ return true;
+ }
- public function get_items($url, $what) {
+ public function get_items($url, $what) {
- if (!$this->is_managed_url($url)) {
- return array();
- }
+ if (!$this->is_managed_url($url)) {
+ return array();
+ }
- // return $this->get_all_items();
- // return json_decode(file_get_contents(CACHE_PATH . "/item.json"));
-
- $cache = array();
- $folder = Item::get($this, $this->to_path($url), $cache);
+ // return $this->get_all_items();
+ // return json_decode(file_get_contents(CACHE_PATH . "/item.json"));
+
+ $cache = array();
+ $folder = Item::get($this, $this->to_path($url), $cache);
- // add content of subfolders
- if ($what >= 2 && $folder !== null) {
- foreach ($folder->get_content($cache) as $item) {
- $item->get_content($cache);
- }
- $folder = $folder->get_parent($cache);
- }
+ // add content of subfolders
+ if ($what >= 2 && $folder !== null) {
+ foreach ($folder->get_content($cache) as $item) {
+ $item->get_content($cache);
+ }
+ $folder = $folder->get_parent($cache);
+ }
- // add content of this folder and all parent folders
- while ($what >= 1 && $folder !== null) {
- $folder->get_content($cache);
- $folder = $folder->get_parent($cache);
- }
-
- uasort($cache, array("Item", "cmp"));
- $result = array();
- foreach ($cache as $p => $item) {
- $result[] = $item->to_json_object();
- }
-
- return $result;
- }
-
-
- private function get_all_item_content($item, &$cache) {
-
- foreach ($item->get_content($cache) as $child) {
- if ($child->is_folder) {
- $this->get_all_item_content($child, $cache);
- }
- }
- }
-
-
- public function cummulate_folders($item, &$cache) {
-
- if (!$item->is_folder) {
- return;
- }
-
- $max_date = $item->date;
- $sum_size = 0;
- foreach ($item->get_content($cache) as $child) {
- $this->cummulate_folders($child, $cache);
- if ($child->date > $max_date) {
- $max_date = $child->date;
- }
- $sum_size += $child->size;
- }
-
- $item->date = $max_date;
- $item->size = $sum_size;
- }
+ // add content of this folder and all parent folders
+ while ($what >= 1 && $folder !== null) {
+ $folder->get_content($cache);
+ $folder = $folder->get_parent($cache);
+ }
+
+ uasort($cache, array("Item", "cmp"));
+ $result = array();
+ foreach ($cache as $p => $item) {
+ $result[] = $item->to_json_object();
+ }
+
+ return $result;
+ }
+
+
+ private function get_all_item_content($item, &$cache) {
+
+ foreach ($item->get_content($cache) as $child) {
+ if ($child->is_folder) {
+ $this->get_all_item_content($child, $cache);
+ }
+ }
+ }
+
+
+ public function cummulate_folders($item, &$cache) {
+
+ if (!$item->is_folder) {
+ return;
+ }
+
+ $max_date = $item->date;
+ $sum_size = 0;
+ foreach ($item->get_content($cache) as $child) {
+ $this->cummulate_folders($child, $cache);
+ if ($child->date > $max_date) {
+ $max_date = $child->date;
+ }
+ $sum_size += $child->size;
+ }
+
+ $item->date = $max_date;
+ $item->size = $sum_size;
+ }
- public function get_all_items() {
+ public function get_all_items() {
- $cache = array();
- $root = Item::get($this, ROOT_PATH, $cache);
-
- $this->get_all_item_content($root, $cache);
- $this->cummulate_folders($root, $cache);
-
- uasort($cache, array("Item", "cmp"));
- $result = array();
- foreach ($cache as $p => $item) {
- $result[] = $item->to_json_object();
- }
-
- @file_put_contents(CACHE_PATH . "/item.json", json_encode($result));
- return $result;
- }
-
-
- public function get_fallback() {
-
- $cache = array();
- $folder = Item::get($this, CURRENT_PATH, $cache);
- $items = $folder->get_content($cache);
- uasort($items, array("Item", "cmp"));
-
- $html = "
";
-
- $html .= "";
- $html .= " ";
- $html .= "Name ";
- $html .= "Last modified ";
- $html .= "Size ";
- $html .= " ";
-
- if ($folder->get_parent($cache)) {
- $html .= "";
- $html .= " ";
- $html .= "Parent Directory ";
- $html .= " ";
- $html .= " ";
- $html .= " ";
- }
-
- foreach ($items as $item) {
- $type = $item->is_folder ? "folder" : "file";
-
- $html .= "";
- $html .= " ";
- $html .= "" . basename($item->path) . " ";
- $html .= "" . date("Y-m-d H:i", $item->date) . " ";
- $html .= "" . ($item->size !== null ? intval($item->size / 1000) . " KB" : "" ) . " ";
- $html .= " ";
- }
-
- $html .= "
";
-
- return $html;
- }
-
-
- public function get_l10n_list() {
-
- $langs = array();
- $l10n_path = APP_PATH . "/conf/l10n";
- if (is_dir($l10n_path)) {
- if ($dir = opendir($l10n_path)) {
- while (($file = readdir($dir)) !== false) {
- if (ends_with($file, ".json")) {
- $translations = load_commented_json($l10n_path . "/" . $file);
- $langs[basename($file, ".json")] = $translations["lang"];
- }
- }
- closedir($dir);
- }
- }
- ksort($langs);
- return $langs;
- }
-
-
- public function get_l10n($iso_codes) {
-
- if (!is_array($iso_codes)) {
- $iso_codes = func_get_args();
- }
-
- $results = array();
- foreach ($iso_codes as $iso_code) {
- if ($iso_code !== "") {
- $file = APP_PATH . "/conf/l10n/" . $iso_code . ".json";
- $results[$iso_code] = load_commented_json($file);
- $results[$iso_code]["isoCode"] = $iso_code;
- }
- }
-
- return $results;
- }
-
-
- private function read_custom_file($path, $name, &$content, &$type) {
-
- foreach (APP::$CUSTOM_EXTS as $ext) {
- $file = "$path/" . FILE_PREFIX . ".$name.$ext";
- if (is_readable($file)) {
- $content = file_get_contents($file);
- $type = $ext;
- return;
- }
- }
- }
-
-
- public function get_customizations($url) {
-
- if (!$this->options["custom"]["enabled"]) {
- return array(
- "header" => null,
- "header_type" => null,
- "footer" => null,
- "footer_type" => null
- );
- }
-
- $path = $this->to_path($url);
-
- $header = null;
- $header_type = null;
- $footer = null;
- $footer_type = null;
-
- $this->read_custom_file($path, "header", $header, $header_type);
- $this->read_custom_file($path, "footer", $footer, $footer_type);
-
- while ($header === null || $footer === null) {
-
- if ($header === null) {
- $this->read_custom_file($path, "headers", $header, $header_type);
- }
- if ($footer === null) {
- $this->read_custom_file($path, "footers", $footer, $footer_type);
- }
-
- if ($path === ROOT_PATH) {
- break;
- }
- $parent_path = normalize_path(dirname($path));
- if ($parent_path === $path) {
- break;
- }
- $path = $parent_path;
- }
-
- return array(
- "header" => $header,
- "header_type" => $header_type,
- "footer" => $footer,
- "footer_type" => $footer_type
- );
- }
+ $cache = array();
+ $root = Item::get($this, ROOT_PATH, $cache);
+
+ $this->get_all_item_content($root, $cache);
+ $this->cummulate_folders($root, $cache);
+
+ uasort($cache, array("Item", "cmp"));
+ $result = array();
+ foreach ($cache as $p => $item) {
+ $result[] = $item->to_json_object();
+ }
+
+ @file_put_contents(CACHE_PATH . "/item.json", json_encode($result));
+ return $result;
+ }
+
+
+ public function get_fallback() {
+
+ $cache = array();
+ $folder = Item::get($this, CURRENT_PATH, $cache);
+ $items = $folder->get_content($cache);
+ uasort($items, array("Item", "cmp"));
+
+ $html = "
";
+
+ $html .= "";
+ $html .= " ";
+ $html .= "Name ";
+ $html .= "Last modified ";
+ $html .= "Size ";
+ $html .= " ";
+
+ if ($folder->get_parent($cache)) {
+ $html .= "";
+ $html .= " ";
+ $html .= "Parent Directory ";
+ $html .= " ";
+ $html .= " ";
+ $html .= " ";
+ }
+
+ foreach ($items as $item) {
+ $type = $item->is_folder ? "folder" : "file";
+
+ $html .= "";
+ $html .= " ";
+ $html .= "" . basename($item->path) . " ";
+ $html .= "" . date("Y-m-d H:i", $item->date) . " ";
+ $html .= "" . ($item->size !== null ? intval($item->size / 1000) . " KB" : "" ) . " ";
+ $html .= " ";
+ }
+
+ $html .= "
";
+
+ return $html;
+ }
+
+
+ public function get_l10n_list() {
+
+ $langs = array();
+ $l10n_path = APP_PATH . "/conf/l10n";
+ if (is_dir($l10n_path)) {
+ if ($dir = opendir($l10n_path)) {
+ while (($file = readdir($dir)) !== false) {
+ if (ends_with($file, ".json")) {
+ $translations = load_commented_json($l10n_path . "/" . $file);
+ $langs[basename($file, ".json")] = $translations["lang"];
+ }
+ }
+ closedir($dir);
+ }
+ }
+ ksort($langs);
+ return $langs;
+ }
+
+
+ public function get_l10n($iso_codes) {
+
+ if (!is_array($iso_codes)) {
+ $iso_codes = func_get_args();
+ }
+
+ $results = array();
+ foreach ($iso_codes as $iso_code) {
+ if ($iso_code !== "") {
+ $file = APP_PATH . "/conf/l10n/" . $iso_code . ".json";
+ $results[$iso_code] = load_commented_json($file);
+ $results[$iso_code]["isoCode"] = $iso_code;
+ }
+ }
+
+ return $results;
+ }
+
+
+ private function read_custom_file($path, $name, &$content, &$type) {
+
+ foreach (APP::$CUSTOM_EXTS as $ext) {
+ $file = "$path/" . FILE_PREFIX . ".$name.$ext";
+ if (is_readable($file)) {
+ $content = file_get_contents($file);
+ $type = $ext;
+ return;
+ }
+ }
+ }
+
+
+ public function get_customizations($url) {
+
+ if (!$this->options["custom"]["enabled"]) {
+ return array(
+ "header" => null,
+ "header_type" => null,
+ "footer" => null,
+ "footer_type" => null
+ );
+ }
+
+ $path = $this->to_path($url);
+
+ $header = null;
+ $header_type = null;
+ $footer = null;
+ $footer_type = null;
+
+ $this->read_custom_file($path, "header", $header, $header_type);
+ $this->read_custom_file($path, "footer", $footer, $footer_type);
+
+ while ($header === null || $footer === null) {
+
+ if ($header === null) {
+ $this->read_custom_file($path, "headers", $header, $header_type);
+ }
+ if ($footer === null) {
+ $this->read_custom_file($path, "footers", $footer, $footer_type);
+ }
+
+ if ($path === ROOT_PATH) {
+ break;
+ }
+ $parent_path = normalize_path(dirname($path));
+ if ($parent_path === $path) {
+ break;
+ }
+ $path = $parent_path;
+ }
+
+ return array(
+ "header" => $header,
+ "header_type" => $header_type,
+ "footer" => $footer,
+ "footer_type" => $footer_type
+ );
+ }
}
diff --git a/src/_h5ai/server/php/inc/class-archive.php b/src/_h5ai/server/php/inc/class-archive.php
index dcc099a1..27b0b48b 100644
--- a/src/_h5ai/server/php/inc/class-archive.php
+++ b/src/_h5ai/server/php/inc/class-archive.php
@@ -2,200 +2,200 @@
class Archive {
- private static $SEGMENT_SIZE = 16777216; // 1024 * 1024 * 16 = 16MiB
- private static $TAR_PASSTHRU_CMD = "cd [ROOTDIR] && tar --no-recursion -c -- [DIRS] [FILES]";
- private static $ZIP_PASSTHRU_CMD = "cd [ROOTDIR] && zip - -- [FILES]";
+ private static $SEGMENT_SIZE = 16777216; // 1024 * 1024 * 16 = 16MiB
+ private static $TAR_PASSTHRU_CMD = "cd [ROOTDIR] && tar --no-recursion -c -- [DIRS] [FILES]";
+ private static $ZIP_PASSTHRU_CMD = "cd [ROOTDIR] && zip - -- [FILES]";
- private $app, $dirs, $files;
+ private $app, $dirs, $files;
- public function __construct($app) {
+ public function __construct($app) {
- $this->app = $app;
- }
+ $this->app = $app;
+ }
- public function output($type, $urls) {
+ public function output($type, $urls) {
- $this->dirs = array();
- $this->files = array();
+ $this->dirs = array();
+ $this->files = array();
- $this->add_hrefs($urls);
+ $this->add_hrefs($urls);
- if (count($this->dirs) === 0 && count($this->files) === 0) {
- if ($type === "php-tar") {
- $this->add_dir(CURRENT_PATH, "/");
- } else {
- $this->add_dir(CURRENT_PATH, ".");
- }
- }
+ if (count($this->dirs) === 0 && count($this->files) === 0) {
+ if ($type === "php-tar") {
+ $this->add_dir(CURRENT_PATH, "/");
+ } else {
+ $this->add_dir(CURRENT_PATH, ".");
+ }
+ }
- if ($type === "php-tar") {
+ if ($type === "php-tar") {
- return $this->php_tar($this->dirs, $this->files);
+ return $this->php_tar($this->dirs, $this->files);
- } else if ($type === "shell-tar") {
+ } else if ($type === "shell-tar") {
- return $this->shell_cmd(Archive::$TAR_PASSTHRU_CMD);
+ return $this->shell_cmd(Archive::$TAR_PASSTHRU_CMD);
- } else if ($type === "shell-zip") {
+ } else if ($type === "shell-zip") {
- return $this->shell_cmd(Archive::$ZIP_PASSTHRU_CMD);
- }
- return 500;
- }
+ return $this->shell_cmd(Archive::$ZIP_PASSTHRU_CMD);
+ }
+ return 500;
+ }
- private function shell_cmd($cmd) {
+ private function shell_cmd($cmd) {
- $cmd = str_replace("[ROOTDIR]", escapeshellarg(CURRENT_PATH), $cmd);
- $cmd = str_replace("[DIRS]", count($this->dirs) ? implode(" ", array_map("escapeshellarg", $this->dirs)) : "", $cmd);
- $cmd = str_replace("[FILES]", count($this->files) ? implode(" ", array_map("escapeshellarg", $this->files)) : "", $cmd);
- try {
- passthru_cmd($cmd);
- } catch (Exeption $err) {
- return 500;
- }
- return 0;
- }
+ $cmd = str_replace("[ROOTDIR]", escapeshellarg(CURRENT_PATH), $cmd);
+ $cmd = str_replace("[DIRS]", count($this->dirs) ? implode(" ", array_map("escapeshellarg", $this->dirs)) : "", $cmd);
+ $cmd = str_replace("[FILES]", count($this->files) ? implode(" ", array_map("escapeshellarg", $this->files)) : "", $cmd);
+ try {
+ passthru_cmd($cmd);
+ } catch (Exeption $err) {
+ return 500;
+ }
+ return 0;
+ }
- private function php_tar($dirs, $files) {
+ private function php_tar($dirs, $files) {
- $filesizes = array();
- $total_size = 512 * count($dirs);
- foreach (array_keys($files) as $real_file) {
+ $filesizes = array();
+ $total_size = 512 * count($dirs);
+ foreach (array_keys($files) as $real_file) {
- $size = filesize($real_file);
+ $size = filesize($real_file);
- $filesizes[$real_file] = $size;
- $total_size += 512 + $size;
- if ($size % 512 != 0) {
- $total_size += 512 - ($size % 512);
- }
- }
+ $filesizes[$real_file] = $size;
+ $total_size += 512 + $size;
+ if ($size % 512 != 0) {
+ $total_size += 512 - ($size % 512);
+ }
+ }
- header("Content-Length: " . $total_size);
+ header("Content-Length: " . $total_size);
- foreach ($dirs as $archived_dir) {
+ foreach ($dirs as $archived_dir) {
- echo $this->php_tar_header($archived_dir, 0, 0, 5);
- }
- foreach ($files as $real_file => $archived_file) {
+ echo $this->php_tar_header($archived_dir, 0, 0, 5);
+ }
+ foreach ($files as $real_file => $archived_file) {
- $size = $filesizes[$real_file];
+ $size = $filesizes[$real_file];
- echo $this->php_tar_header($archived_file, $size, @filemtime($real_file), 0);
- $this->print_file($real_file);
+ echo $this->php_tar_header($archived_file, $size, @filemtime($real_file), 0);
+ $this->print_file($real_file);
- if ($size % 512 != 0) {
- echo str_repeat("\0", 512 - ($size % 512));
- }
- }
+ if ($size % 512 != 0) {
+ echo str_repeat("\0", 512 - ($size % 512));
+ }
+ }
- return 0;
- }
+ return 0;
+ }
- private function php_tar_header($filename, $size, $mtime, $type) {
+ private function php_tar_header($filename, $size, $mtime, $type) {
- $name = substr(basename($filename), -99);
- $prefix = substr(normalize_path(dirname($filename)), -154);
- if ($prefix === '.') {
- $prefix = '';
- }
+ $name = substr(basename($filename), -99);
+ $prefix = substr(normalize_path(dirname($filename)), -154);
+ if ($prefix === '.') {
+ $prefix = '';
+ }
- $header =
- str_pad($name, 100, "\0") // filename [100]
- . "0000755\0" // file mode [8]
- . "0000000\0" // uid [8]
- . "0000000\0" // gid [8]
- . str_pad(decoct($size), 11, "0", STR_PAD_LEFT) . "\0" // file size [12]
- . str_pad(decoct($mtime), 11, "0", STR_PAD_LEFT) . "\0" // file modification time [12]
- . " " // checksum [8]
- . str_pad($type, 1) // file type [1]
- . str_repeat("\0", 100) // linkname [100]
- . "ustar\0" // magic [6]
- . "00" // version [2]
- . str_repeat("\0", 80) // uname, gname, defmajor, devminor [32 + 32 + 8 + 8]
- . str_pad($prefix, 155, "\0") // filename [155]
- . str_repeat("\0", 12); // fill [12]
- assert(strlen($header) === 512);
+ $header =
+ str_pad($name, 100, "\0") // filename [100]
+ . "0000755\0" // file mode [8]
+ . "0000000\0" // uid [8]
+ . "0000000\0" // gid [8]
+ . str_pad(decoct($size), 11, "0", STR_PAD_LEFT) . "\0" // file size [12]
+ . str_pad(decoct($mtime), 11, "0", STR_PAD_LEFT) . "\0" // file modification time [12]
+ . " " // checksum [8]
+ . str_pad($type, 1) // file type [1]
+ . str_repeat("\0", 100) // linkname [100]
+ . "ustar\0" // magic [6]
+ . "00" // version [2]
+ . str_repeat("\0", 80) // uname, gname, defmajor, devminor [32 + 32 + 8 + 8]
+ . str_pad($prefix, 155, "\0") // filename [155]
+ . str_repeat("\0", 12); // fill [12]
+ assert(strlen($header) === 512);
- // checksum
- $checksum = array_sum(array_map('ord', str_split($header)));
- $checksum = str_pad(decoct($checksum), 6, "0", STR_PAD_LEFT) . "\0 ";
- $header = substr_replace($header, $checksum, 148, 8);
+ // checksum
+ $checksum = array_sum(array_map('ord', str_split($header)));
+ $checksum = str_pad(decoct($checksum), 6, "0", STR_PAD_LEFT) . "\0 ";
+ $header = substr_replace($header, $checksum, 148, 8);
- return $header;
- }
+ return $header;
+ }
- private function print_file($file) {
+ private function print_file($file) {
- // Send file content in segments to not hit PHP's memory limit (default: 128M)
- if ($fd = fopen($file, 'rb')) {
- while (!feof($fd)) {
- print fread($fd, Archive::$SEGMENT_SIZE);
- @ob_flush();
- @flush();
- }
- fclose($fd);
- }
- }
+ // Send file content in segments to not hit PHP's memory limit (default: 128M)
+ if ($fd = fopen($file, 'rb')) {
+ while (!feof($fd)) {
+ print fread($fd, Archive::$SEGMENT_SIZE);
+ @ob_flush();
+ @flush();
+ }
+ fclose($fd);
+ }
+ }
- private function add_hrefs($urls) {
+ private function add_hrefs($urls) {
- foreach ($urls as $href) {
+ foreach ($urls as $href) {
- if (trim($href) === "") {
- continue;
- }
+ if (trim($href) === "") {
+ continue;
+ }
- $d = normalize_path(dirname($href), true);
- $n = basename($href);
+ $d = normalize_path(dirname($href), true);
+ $n = basename($href);
- if ($this->app->is_managed_url($d) && !$this->app->is_hidden($n)) {
+ if ($this->app->is_managed_url($d) && !$this->app->is_hidden($n)) {
- $real_file = $this->app->to_path($href);
- $archived_file = preg_replace("!^" . preg_quote(normalize_path(CURRENT_PATH, true)) . "!", "", $real_file);
+ $real_file = $this->app->to_path($href);
+ $archived_file = preg_replace("!^" . preg_quote(normalize_path(CURRENT_PATH, true)) . "!", "", $real_file);
- if (is_dir($real_file)) {
- $this->add_dir($real_file, $archived_file);
- } else {
- $this->add_file($real_file, $archived_file);
- }
- }
- }
- }
+ if (is_dir($real_file)) {
+ $this->add_dir($real_file, $archived_file);
+ } else {
+ $this->add_file($real_file, $archived_file);
+ }
+ }
+ }
+ }
- private function add_file($real_file, $archived_file) {
+ private function add_file($real_file, $archived_file) {
- if (is_readable($real_file)) {
- $this->files[$real_file] = $archived_file;
- }
- }
+ if (is_readable($real_file)) {
+ $this->files[$real_file] = $archived_file;
+ }
+ }
- private function add_dir($real_dir, $archived_dir) {
+ private function add_dir($real_dir, $archived_dir) {
- if ($this->app->is_managed_path($real_dir)) {
- $this->dirs[] = $archived_dir;
+ if ($this->app->is_managed_path($real_dir)) {
+ $this->dirs[] = $archived_dir;
- $files = $this->app->read_dir($real_dir);
- foreach ($files as $file) {
+ $files = $this->app->read_dir($real_dir);
+ foreach ($files as $file) {
- $real_file = $real_dir . "/" . $file;
- $archived_file = $archived_dir . "/" . $file;
+ $real_file = $real_dir . "/" . $file;
+ $archived_file = $archived_dir . "/" . $file;
- if (is_dir($real_file)) {
- $this->add_dir($real_file, $archived_file);
- } else {
- $this->add_file($real_file, $archived_file);
- }
- }
- }
- }
+ if (is_dir($real_file)) {
+ $this->add_dir($real_file, $archived_file);
+ } else {
+ $this->add_file($real_file, $archived_file);
+ }
+ }
+ }
+ }
}
diff --git a/src/_h5ai/server/php/inc/class-item.php b/src/_h5ai/server/php/inc/class-item.php
index b6d1b3f0..45dc0aa3 100644
--- a/src/_h5ai/server/php/inc/class-item.php
+++ b/src/_h5ai/server/php/inc/class-item.php
@@ -2,179 +2,179 @@
class Item {
- public static function cmp($item1, $item2) {
+ public static function cmp($item1, $item2) {
- if ($item1->is_folder && !$item2->is_folder) {
- return -1;
- }
- if (!$item1->is_folder && $item2->is_folder) {
- return 1;
- }
+ if ($item1->is_folder && !$item2->is_folder) {
+ return -1;
+ }
+ if (!$item1->is_folder && $item2->is_folder) {
+ return 1;
+ }
- return strcasecmp($item1->path, $item2->path);
- }
+ return strcasecmp($item1->path, $item2->path);
+ }
- private static $size_cache = array();
+ private static $size_cache = array();
- private static function filesize($app, $path) {
+ private static function filesize($app, $path) {
- if (array_key_exists($path, Item::$size_cache)) {
- return Item::$size_cache[$path];
- }
+ if (array_key_exists($path, Item::$size_cache)) {
+ return Item::$size_cache[$path];
+ }
- $size = null;
+ $size = null;
- if (is_file($path)) {
+ if (is_file($path)) {
- if (PHP_INT_SIZE < 8) {
- $_handle = fopen($path, "r");
+ if (PHP_INT_SIZE < 8) {
+ $_handle = fopen($path, "r");
- $_pos = 0;
- $_size = 1073741824;
- fseek($_handle, 0, SEEK_SET);
- while ($_size > 1) {
- fseek($_handle, $_size, SEEK_CUR);
+ $_pos = 0;
+ $_size = 1073741824;
+ fseek($_handle, 0, SEEK_SET);
+ while ($_size > 1) {
+ fseek($_handle, $_size, SEEK_CUR);
- if (fgetc($_handle) === false) {
- fseek($_handle, -$_size, SEEK_CUR);
- $_size = (int)($_size / 2);
- } else {
- fseek($_handle, -1, SEEK_CUR);
- $_pos += $_size;
- }
- }
+ if (fgetc($_handle) === false) {
+ fseek($_handle, -$_size, SEEK_CUR);
+ $_size = (int)($_size / 2);
+ } else {
+ fseek($_handle, -1, SEEK_CUR);
+ $_pos += $_size;
+ }
+ }
- while (fgetc($_handle) !== false) {
- $_pos++;
- }
- fclose($_handle);
+ while (fgetc($_handle) !== false) {
+ $_pos++;
+ }
+ fclose($_handle);
- $size = $_pos;
- } else {
- $size = @filesize($path);
- }
+ $size = $_pos;
+ } else {
+ $size = @filesize($path);
+ }
- } else if (is_dir($path)) {
+ } else if (is_dir($path)) {
- $options = $app->get_options();
- if ($options["foldersize"]["enabled"]) {
- if (HAS_CMD_DU && $options["foldersize"]["type"] === "shell-du") {
- $cmdv = array("du", "-sk", $path);
- $size = intval(preg_replace("#\s.*$#", "", exec_cmdv($cmdv)), 10) * 1024;
- } else {
- $size = 0;
- foreach ($app->read_dir($path) as $name) {
- $size += Item::filesize($app, $path . "/" . $name);
- }
- }
- }
- }
+ $options = $app->get_options();
+ if ($options["foldersize"]["enabled"]) {
+ if (HAS_CMD_DU && $options["foldersize"]["type"] === "shell-du") {
+ $cmdv = array("du", "-sk", $path);
+ $size = intval(preg_replace("#\s.*$#", "", exec_cmdv($cmdv)), 10) * 1024;
+ } else {
+ $size = 0;
+ foreach ($app->read_dir($path) as $name) {
+ $size += Item::filesize($app, $path . "/" . $name);
+ }
+ }
+ }
+ }
- Item::$size_cache[$path] = $size;
- return $size;
- }
+ Item::$size_cache[$path] = $size;
+ return $size;
+ }
- public static function get($app, $path, &$cache) {
+ public static function get($app, $path, &$cache) {
- if (!starts_with($path, ROOT_PATH)) {
- err_log("ILLEGAL REQUEST: " . $path . ", " . ROOT_PATH);
- return null;
- }
+ if (!starts_with($path, ROOT_PATH)) {
+ err_log("ILLEGAL REQUEST: " . $path . ", " . ROOT_PATH);
+ return null;
+ }
- if (is_array($cache) && array_key_exists($path, $cache)) {
- return $cache[$path];
- }
+ if (is_array($cache) && array_key_exists($path, $cache)) {
+ return $cache[$path];
+ }
- $item = new Item($app, $path);
+ $item = new Item($app, $path);
- if (is_array($cache)) {
- $cache[$path] = $item;
- }
- return $item;
- }
+ if (is_array($cache)) {
+ $cache[$path] = $item;
+ }
+ return $item;
+ }
- public $app,
- $path, $url,
- $date, $size,
- $is_folder,
- $is_content_fetched;
+ public $app,
+ $path, $url,
+ $date, $size,
+ $is_folder,
+ $is_content_fetched;
- private function __construct($app, $path) {
+ private function __construct($app, $path) {
- $this->app = $app;
+ $this->app = $app;
- $this->path = normalize_path($path, false);
- $this->is_folder = is_dir($this->path);
- $this->url = $app->to_url($this->path, $this->is_folder);
- $this->date = @filemtime($this->path);
- $this->size = Item::filesize($app, $this->path);
- $this->is_content_fetched = false;
+ $this->path = normalize_path($path, false);
+ $this->is_folder = is_dir($this->path);
+ $this->url = $app->to_url($this->path, $this->is_folder);
+ $this->date = @filemtime($this->path);
+ $this->size = Item::filesize($app, $this->path);
+ $this->is_content_fetched = false;
- // $options = $app->get_options();
- // if (!$this->is_folder && $options["hashes"]["enabled"]) {
- if (!$this->is_folder) {
- // $this->md5 = md5_file($this->path);
- // $this->sha1 = sha1_file($this->path);
- $this->md5 = null;
- $this->sha1 = null;
- } else {
- $this->md5 = null;
- $this->sha1 = null;
- }
- }
+ // $options = $app->get_options();
+ // if (!$this->is_folder && $options["hashes"]["enabled"]) {
+ if (!$this->is_folder) {
+ // $this->md5 = md5_file($this->path);
+ // $this->sha1 = sha1_file($this->path);
+ $this->md5 = null;
+ $this->sha1 = null;
+ } else {
+ $this->md5 = null;
+ $this->sha1 = null;
+ }
+ }
- public function to_json_object() {
+ public function to_json_object() {
- $obj = array(
- "absHref" => $this->url,
- "time" => $this->date * 1000, // seconds (PHP) to milliseconds (JavaScript)
- "size" => $this->size
- );
+ $obj = array(
+ "absHref" => $this->url,
+ "time" => $this->date * 1000, // seconds (PHP) to milliseconds (JavaScript)
+ "size" => $this->size
+ );
- if ($this->is_folder) {
- $obj["is_managed"] = $this->app->is_managed_url($this->url);
- $obj["content"] = $this->is_content_fetched;
- } else {
- $obj["md5"] = $this->md5;
- $obj["sha1"] = $this->sha1;
- }
+ if ($this->is_folder) {
+ $obj["is_managed"] = $this->app->is_managed_url($this->url);
+ $obj["content"] = $this->is_content_fetched;
+ } else {
+ $obj["md5"] = $this->md5;
+ $obj["sha1"] = $this->sha1;
+ }
- return $obj;
- }
+ return $obj;
+ }
- public function get_parent(&$cache) {
+ public function get_parent(&$cache) {
- $parent_path = normalize_path(dirname($this->path), false);
- if ($parent_path !== $this->path && starts_with($parent_path, ROOT_PATH)) {
- return Item::get($this->app, $parent_path, $cache);
- }
- return null;
- }
+ $parent_path = normalize_path(dirname($this->path), false);
+ if ($parent_path !== $this->path && starts_with($parent_path, ROOT_PATH)) {
+ return Item::get($this->app, $parent_path, $cache);
+ }
+ return null;
+ }
- public function get_content(&$cache) {
+ public function get_content(&$cache) {
- $items = array();
+ $items = array();
- if (!$this->app->is_managed_url($this->url)) {
- return $items;
- }
+ if (!$this->app->is_managed_url($this->url)) {
+ return $items;
+ }
- $files = $this->app->read_dir($this->path);
- foreach ($files as $file) {
- $item = Item::get($this->app, $this->path . "/" . $file, $cache);
- $items[$item->path] = $item;
- }
+ $files = $this->app->read_dir($this->path);
+ foreach ($files as $file) {
+ $item = Item::get($this->app, $this->path . "/" . $file, $cache);
+ $items[$item->path] = $item;
+ }
- $this->is_content_fetched = true;
+ $this->is_content_fetched = true;
- return $items;
- }
+ return $items;
+ }
}
diff --git a/src/_h5ai/server/php/inc/class-thumb.php b/src/_h5ai/server/php/inc/class-thumb.php
index 17ce4412..b2219ed3 100644
--- a/src/_h5ai/server/php/inc/class-thumb.php
+++ b/src/_h5ai/server/php/inc/class-thumb.php
@@ -2,363 +2,363 @@
class Thumb {
- private static $FFMPEG_CMDV = array("ffmpeg", "-ss", "0:01:00", "-i", "[SRC]", "-an", "-vframes", "1", "[DEST]");
- private static $AVCONV_CMDV = array("avconv", "-ss", "0:01:00", "-i", "[SRC]", "-an", "-vframes", "1", "[DEST]");
- private static $CONVERT_CMDV = array("convert", "-strip", "[SRC][0]", "[DEST]");
- private static $THUMB_CACHE = "thumbs";
+ private static $FFMPEG_CMDV = array("ffmpeg", "-ss", "0:01:00", "-i", "[SRC]", "-an", "-vframes", "1", "[DEST]");
+ private static $AVCONV_CMDV = array("avconv", "-ss", "0:01:00", "-i", "[SRC]", "-an", "-vframes", "1", "[DEST]");
+ private static $CONVERT_CMDV = array("convert", "-strip", "[SRC][0]", "[DEST]");
+ private static $THUMB_CACHE = "thumbs";
- private $app, $thumbs_path, $thumbs_href;
+ private $app, $thumbs_path, $thumbs_href;
- public function __construct($app) {
+ public function __construct($app) {
- $this->app = $app;
- $this->thumbs_path = CACHE_PATH . "/" . Thumb::$THUMB_CACHE;
- $this->thumbs_href = CACHE_HREF . Thumb::$THUMB_CACHE;
+ $this->app = $app;
+ $this->thumbs_path = CACHE_PATH . "/" . Thumb::$THUMB_CACHE;
+ $this->thumbs_href = CACHE_HREF . Thumb::$THUMB_CACHE;
- if (!is_dir($this->thumbs_path)) {
- @mkdir($this->thumbs_path, 0755, true);
- }
- }
+ if (!is_dir($this->thumbs_path)) {
+ @mkdir($this->thumbs_path, 0755, true);
+ }
+ }
- public function thumb($type, $source_url, $mode, $width, $height) {
+ public function thumb($type, $source_url, $mode, $width, $height) {
- $source_path = $this->app->to_path($source_url);
- if (!file_exists($source_path) || starts_with($source_path, CACHE_PATH)) {
- return null;
- }
+ $source_path = $this->app->to_path($source_url);
+ if (!file_exists($source_path) || starts_with($source_path, CACHE_PATH)) {
+ return null;
+ }
- if ($type === "img") {
- $capture_path = $source_path;
- } else if ($type === "mov") {
- if (HAS_CMD_AVCONV) {
- $capture_path = $this->capture(Thumb::$AVCONV_CMDV, $source_path);
- } else if (HAS_CMD_FFMPEG) {
- $capture_path = $this->capture(Thumb::$FFMPEG_CMDV, $source_path);
- }
- } else if ($type === "doc" && HAS_CMD_CONVERT) {
- $capture_path = $this->capture(Thumb::$CONVERT_CMDV, $source_path);
- }
+ if ($type === "img") {
+ $capture_path = $source_path;
+ } else if ($type === "mov") {
+ if (HAS_CMD_AVCONV) {
+ $capture_path = $this->capture(Thumb::$AVCONV_CMDV, $source_path);
+ } else if (HAS_CMD_FFMPEG) {
+ $capture_path = $this->capture(Thumb::$FFMPEG_CMDV, $source_path);
+ }
+ } else if ($type === "doc" && HAS_CMD_CONVERT) {
+ $capture_path = $this->capture(Thumb::$CONVERT_CMDV, $source_path);
+ }
- return $this->thumb_href($capture_path, $mode, $width, $height);
- }
+ return $this->thumb_href($capture_path, $mode, $width, $height);
+ }
- private function thumb_href($source_path, $mode, $width, $height) {
+ private function thumb_href($source_path, $mode, $width, $height) {
- if (!file_exists($source_path)) {
- return null;
- }
+ if (!file_exists($source_path)) {
+ return null;
+ }
- $name = "thumb-" . sha1("$source_path-$width-$height-$mode") . ".jpg";
- $thumb_path = $this->thumbs_path . "/" . $name;
- $thumb_url = $this->thumbs_href . "/" . $name;
+ $name = "thumb-" . sha1("$source_path-$width-$height-$mode") . ".jpg";
+ $thumb_path = $this->thumbs_path . "/" . $name;
+ $thumb_url = $this->thumbs_href . "/" . $name;
- if (!file_exists($thumb_path) || filemtime($source_path) >= filemtime($thumb_path)) {
+ if (!file_exists($thumb_path) || filemtime($source_path) >= filemtime($thumb_path)) {
- $image = new Image();
+ $image = new Image();
- $et = false;
- $opts = $this->app->get_options();
- if (HAS_PHP_EXIF && $opts["thumbnails"]["exif"] === true) {
- $et = @exif_thumbnail($source_path);
- }
- if($et !== false) {
- file_put_contents($thumb_path, $et);
- $image->set_source($thumb_path);
- $image->normalize_exif_orientation($source_path);
- } else {
- $image->set_source($source_path);
- }
+ $et = false;
+ $opts = $this->app->get_options();
+ if (HAS_PHP_EXIF && $opts["thumbnails"]["exif"] === true) {
+ $et = @exif_thumbnail($source_path);
+ }
+ if($et !== false) {
+ file_put_contents($thumb_path, $et);
+ $image->set_source($thumb_path);
+ $image->normalize_exif_orientation($source_path);
+ } else {
+ $image->set_source($source_path);
+ }
- $image->thumb($mode, $width, $height);
- $image->save_dest_jpeg($thumb_path, 80);
- }
+ $image->thumb($mode, $width, $height);
+ $image->save_dest_jpeg($thumb_path, 80);
+ }
- return file_exists($thumb_path) ? $thumb_url : null;
- }
+ return file_exists($thumb_path) ? $thumb_url : null;
+ }
- private function capture($cmdv, $source_path) {
+ private function capture($cmdv, $source_path) {
- if (!file_exists($source_path)) {
- return null;
- }
+ if (!file_exists($source_path)) {
+ return null;
+ }
- $capture_path = $this->thumbs_path . "/capture-" . sha1($source_path) . ".jpg";
+ $capture_path = $this->thumbs_path . "/capture-" . sha1($source_path) . ".jpg";
- if (!file_exists($capture_path) || filemtime($source_path) >= filemtime($capture_path)) {
+ if (!file_exists($capture_path) || filemtime($source_path) >= filemtime($capture_path)) {
- foreach ($cmdv as &$arg) {
- $arg = str_replace("[SRC]", $source_path, $arg);
- $arg = str_replace("[DEST]", $capture_path, $arg);
- }
+ foreach ($cmdv as &$arg) {
+ $arg = str_replace("[SRC]", $source_path, $arg);
+ $arg = str_replace("[DEST]", $capture_path, $arg);
+ }
- exec_cmdv($cmdv);
- }
+ exec_cmdv($cmdv);
+ }
- return file_exists($capture_path) ? $capture_path : null;
- }
+ return file_exists($capture_path) ? $capture_path : null;
+ }
}
class Image {
- private $source_file, $source, $width, $height, $type, $dest;
+ private $source_file, $source, $width, $height, $type, $dest;
- public function __construct($filename = null) {
+ public function __construct($filename = null) {
- $this->source_file = null;
- $this->source = null;
- $this->width = null;
- $this->height = null;
- $this->type = null;
+ $this->source_file = null;
+ $this->source = null;
+ $this->width = null;
+ $this->height = null;
+ $this->type = null;
- $this->dest = null;
+ $this->dest = null;
- $this->set_source($filename);
- }
+ $this->set_source($filename);
+ }
- public function __destruct() {
+ public function __destruct() {
- $this->release_source();
- $this->release_dest();
- }
+ $this->release_source();
+ $this->release_dest();
+ }
- public function set_source($filename) {
+ public function set_source($filename) {
- $this->release_source();
- $this->release_dest();
+ $this->release_source();
+ $this->release_dest();
- if (is_null($filename)) {
- return;
- }
+ if (is_null($filename)) {
+ return;
+ }
- $this->source_file = $filename;
+ $this->source_file = $filename;
- list($this->width, $this->height, $this->type) = @getimagesize($this->source_file);
+ list($this->width, $this->height, $this->type) = @getimagesize($this->source_file);
- if (!$this->width || !$this->height) {
- $this->source_file = null;
- $this->width = null;
- $this->height = null;
- $this->type = null;
- return;
- }
+ if (!$this->width || !$this->height) {
+ $this->source_file = null;
+ $this->width = null;
+ $this->height = null;
+ $this->type = null;
+ return;
+ }
- $this->source = imagecreatefromstring(file_get_contents($this->source_file));
- }
+ $this->source = imagecreatefromstring(file_get_contents($this->source_file));
+ }
- public function save_dest_jpeg($filename, $quality = 80) {
+ public function save_dest_jpeg($filename, $quality = 80) {
- if (!is_null($this->dest)) {
- @imagejpeg($this->dest, $filename, $quality);
- @chmod($filename, 0775);
- }
- }
+ if (!is_null($this->dest)) {
+ @imagejpeg($this->dest, $filename, $quality);
+ @chmod($filename, 0775);
+ }
+ }
- public function save_dest_png($filename, $quality = 9) {
+ public function save_dest_png($filename, $quality = 9) {
- if (!is_null($this->dest)) {
- @imagepng($this->dest, $filename, $quality);
- @chmod($filename, 0775);
- }
- }
+ if (!is_null($this->dest)) {
+ @imagepng($this->dest, $filename, $quality);
+ @chmod($filename, 0775);
+ }
+ }
- public function release_dest() {
+ public function release_dest() {
- if (!is_null($this->dest)) {
- @imagedestroy($this->dest);
- $this->dest = null;
- }
- }
+ if (!is_null($this->dest)) {
+ @imagedestroy($this->dest);
+ $this->dest = null;
+ }
+ }
- public function release_source() {
+ public function release_source() {
- if (!is_null($this->source)) {
- @imagedestroy($this->source);
- $this->source_file = null;
- $this->source = null;
- $this->width = null;
- $this->height = null;
- $this->type = null;
- }
- }
+ if (!is_null($this->source)) {
+ @imagedestroy($this->source);
+ $this->source_file = null;
+ $this->source = null;
+ $this->width = null;
+ $this->height = null;
+ $this->type = null;
+ }
+ }
- private function magic($dest_x, $dest_y, $src_x, $src_y, $dest_width, $dest_height, $src_width, $src_height, $can_width = null, $can_height = null, $color = null) {
+ private function magic($dest_x, $dest_y, $src_x, $src_y, $dest_width, $dest_height, $src_width, $src_height, $can_width = null, $can_height = null, $color = null) {
- if (is_null($this->source)) {
- return;
- }
+ if (is_null($this->source)) {
+ return;
+ }
- if ($can_width === 0) {
- $can_width = 1;
- }
- if ($can_height === 0) {
- $can_height = 1;
- }
- if ($dest_width === 0) {
- $dest_width = 1;
- }
- if ($dest_height === 0) {
- $dest_height = 1;
- }
+ if ($can_width === 0) {
+ $can_width = 1;
+ }
+ if ($can_height === 0) {
+ $can_height = 1;
+ }
+ if ($dest_width === 0) {
+ $dest_width = 1;
+ }
+ if ($dest_height === 0) {
+ $dest_height = 1;
+ }
- if (!is_null($can_width) && !is_null($can_height)) {
- $this->dest = imagecreatetruecolor($can_width, $can_height);
- } else {
- $this->dest = imagecreatetruecolor($dest_width, $dest_height);
- }
+ if (!is_null($can_width) && !is_null($can_height)) {
+ $this->dest = imagecreatetruecolor($can_width, $can_height);
+ } else {
+ $this->dest = imagecreatetruecolor($dest_width, $dest_height);
+ }
- if (is_null($color)) {
- $color = array(255, 255, 255);
- }
- $icol = imagecolorallocate($this->dest, $color[0], $color[1], $color[2]);
- imagefill($this->dest, 0, 0, $icol);
+ if (is_null($color)) {
+ $color = array(255, 255, 255);
+ }
+ $icol = imagecolorallocate($this->dest, $color[0], $color[1], $color[2]);
+ imagefill($this->dest, 0, 0, $icol);
- imagecopyresampled($this->dest, $this->source, $dest_x, $dest_y, $src_x, $src_y, $dest_width, $dest_height, $src_width, $src_height);
- }
+ imagecopyresampled($this->dest, $this->source, $dest_x, $dest_y, $src_x, $src_y, $dest_width, $dest_height, $src_width, $src_height);
+ }
- public function thumb($mode, $width, $height = null, $color = null) {
+ public function thumb($mode, $width, $height = null, $color = null) {
- if ($height === null) {
- $height = $width;
- }
- if ($mode === "square") {
- $this->square_thumb($width);
- } elseif ($mode === "rational") {
- $this->rational_thumb($width, $height);
- } elseif ($mode === "center") {
- $this->center_thumb($width, $height, $color);
- } else {
- $this->free_thumb($width, $height);
- }
- }
+ if ($height === null) {
+ $height = $width;
+ }
+ if ($mode === "square") {
+ $this->square_thumb($width);
+ } elseif ($mode === "rational") {
+ $this->rational_thumb($width, $height);
+ } elseif ($mode === "center") {
+ $this->center_thumb($width, $height, $color);
+ } else {
+ $this->free_thumb($width, $height);
+ }
+ }
- public function square_thumb($width) {
+ public function square_thumb($width) {
- if (is_null($this->source)) {
- return;
- }
+ if (is_null($this->source)) {
+ return;
+ }
- $a = min($this->width, $this->height);
- $x = intval(($this->width - $a) / 2);
- $y = intval(($this->height - $a) / 2);
+ $a = min($this->width, $this->height);
+ $x = intval(($this->width - $a) / 2);
+ $y = intval(($this->height - $a) / 2);
- $this->magic(0, 0, $x, $y, $width, $width, $a, $a);
- }
+ $this->magic(0, 0, $x, $y, $width, $width, $a, $a);
+ }
- public function rational_thumb($width, $height) {
+ public function rational_thumb($width, $height) {
- if (is_null($this->source)) {
- return;
- }
+ if (is_null($this->source)) {
+ return;
+ }
- $r = 1.0 * $this->width / $this->height;
+ $r = 1.0 * $this->width / $this->height;
- $h = $height;
- $w = $r * $h;
+ $h = $height;
+ $w = $r * $h;
- if ($w > $width) {
+ if ($w > $width) {
- $w = $width;
- $h = 1.0 / $r * $w;
- }
+ $w = $width;
+ $h = 1.0 / $r * $w;
+ }
- $w = intval($w);
- $h = intval($h);
+ $w = intval($w);
+ $h = intval($h);
- $this->magic(0, 0, 0, 0, $w, $h, $this->width, $this->height);
- }
+ $this->magic(0, 0, 0, 0, $w, $h, $this->width, $this->height);
+ }
- public function center_thumb($width, $height, $color = null) {
+ public function center_thumb($width, $height, $color = null) {
- if (is_null($this->source)) {
- return;
- }
+ if (is_null($this->source)) {
+ return;
+ }
- $r = 1.0 * $this->width / $this->height;
+ $r = 1.0 * $this->width / $this->height;
- $h = $height;
- $w = $r * $h;
+ $h = $height;
+ $w = $r * $h;
- if ($w > $width) {
+ if ($w > $width) {
- $w = $width;
- $h = 1.0 / $r * $w;
- }
+ $w = $width;
+ $h = 1.0 / $r * $w;
+ }
- $w = intval($w);
- $h = intval($h);
+ $w = intval($w);
+ $h = intval($h);
- $x = intval(($width - $w) / 2);
- $y = intval(($height - $h) / 2);
+ $x = intval(($width - $w) / 2);
+ $y = intval(($height - $h) / 2);
- $this->magic($x, $y, 0, 0, $w, $h, $this->width, $this->height, $width, $height, $color);
- }
+ $this->magic($x, $y, 0, 0, $w, $h, $this->width, $this->height, $width, $height, $color);
+ }
- public function free_thumb($width, $height) {
+ public function free_thumb($width, $height) {
- if (is_null($this->source)) {
- return;
- }
+ if (is_null($this->source)) {
+ return;
+ }
- $w = intval($width);
- $h = intval($height);
+ $w = intval($width);
+ $h = intval($height);
- $this->magic(0, 0, 0, 0, $w, $h, $this->width, $this->height);
- }
+ $this->magic(0, 0, 0, 0, $w, $h, $this->width, $this->height);
+ }
- public function rotate($angle) {
+ public function rotate($angle) {
- if (is_null($this->source) || ($angle !== 90 && $angle !== 180 && $angle !== 270)) {
- return;
- }
+ if (is_null($this->source) || ($angle !== 90 && $angle !== 180 && $angle !== 270)) {
+ return;
+ }
- $this->source = imagerotate($this->source, $angle, 0);
- if ( $angle === 90 || $angle === 270 ) {
- list($this->width, $this->height) = array($this->height, $this->width);
- }
- }
+ $this->source = imagerotate($this->source, $angle, 0);
+ if ( $angle === 90 || $angle === 270 ) {
+ list($this->width, $this->height) = array($this->height, $this->width);
+ }
+ }
- public function normalize_exif_orientation($exif_source_file = null) {
+ public function normalize_exif_orientation($exif_source_file = null) {
- if (is_null($this->source) || !function_exists("exif_read_data")) {
- return;
- }
+ if (is_null($this->source) || !function_exists("exif_read_data")) {
+ return;
+ }
- if ($exif_source_file === null) {
- $exif_source_file = $this->source_file;
- }
+ if ($exif_source_file === null) {
+ $exif_source_file = $this->source_file;
+ }
- $exif = exif_read_data($exif_source_file);
- switch(@$exif["Orientation"]) {
- case 3:
- $this->rotate(180);
- break;
- case 6:
- $this->rotate(270);
- break;
- case 8:
- $this->rotate(90);
- break;
- }
- }
+ $exif = exif_read_data($exif_source_file);
+ switch(@$exif["Orientation"]) {
+ case 3:
+ $this->rotate(180);
+ break;
+ case 6:
+ $this->rotate(270);
+ break;
+ case 8:
+ $this->rotate(90);
+ break;
+ }
+ }
}
diff --git a/src/_h5ai/server/php/inc/page.php.jade b/src/_h5ai/server/php/inc/page.php.jade
index fb4b0e77..71b0bee5 100644
--- a/src/_h5ai/server/php/inc/page.php.jade
+++ b/src/_h5ai/server/php/inc/page.php.jade
@@ -5,41 +5,41 @@
doctype html
//if lt IE 10
-
+
//[if gt IE 9]>= 0);
- define("HAS_PHP_EXIF", function_exists("exif_thumbnail"));
- $has_php_jpg = false;
- if (function_exists("gd_info")) {
- $infos = gd_info();
- $has_php_jpg = array_key_exists("JPG Support", $infos) && $infos["JPG Support"] || array_key_exists("JPEG Support", $infos) && $infos["JPEG Support"];
- }
- define("HAS_PHP_JPG", $has_php_jpg);
+ // PHP
+ define("MIN_PHP_VERSION", "5.3.0");
+ define("HAS_PHP_VERSION", version_compare(PHP_VERSION, MIN_PHP_VERSION) >= 0);
+ define("HAS_PHP_EXIF", function_exists("exif_thumbnail"));
+ $has_php_jpg = false;
+ if (function_exists("gd_info")) {
+ $infos = gd_info();
+ $has_php_jpg = array_key_exists("JPG Support", $infos) && $infos["JPG Support"] || array_key_exists("JPEG Support", $infos) && $infos["JPEG Support"];
+ }
+ define("HAS_PHP_JPG", $has_php_jpg);
- // SERVER
- $server_name = null;
- $server_version = null;
- $server_software = getenv("SERVER_SOFTWARE");
- if ($server_software && preg_match("#^(.*?)(?:/(.*?))?(?: |$)#", strtolower($server_software), $matches)) {
- $server_name = $matches[1];
- $server_version = count($matches) > 2 ? $matches[2] : '';
- }
- define("SERVER_NAME", $server_name);
- define("SERVER_VERSION", $server_version);
- define("HAS_SERVER", in_array($server_name, array("apache", "lighttpd", "nginx", "cherokee")));
- define("HAS_WIN_OS", strtolower(substr(PHP_OS, 0, 3)) === "win");
+ // SERVER
+ $server_name = null;
+ $server_version = null;
+ $server_software = getenv("SERVER_SOFTWARE");
+ if ($server_software && preg_match("#^(.*?)(?:/(.*?))?(?: |$)#", strtolower($server_software), $matches)) {
+ $server_name = $matches[1];
+ $server_version = count($matches) > 2 ? $matches[2] : '';
+ }
+ define("SERVER_NAME", $server_name);
+ define("SERVER_VERSION", $server_version);
+ define("HAS_SERVER", in_array($server_name, array("apache", "lighttpd", "nginx", "cherokee")));
+ define("HAS_WIN_OS", strtolower(substr(PHP_OS, 0, 3)) === "win");
- // PATHS
- $script_name = getenv("SCRIPT_NAME");
- if (SERVER_NAME === "lighttpd") {
- $script_name = preg_replace("#^.*?//#", "/", $script_name);
- }
- define("APP_HREF", normalize_path(dirname(dirname(dirname($script_name))), true));
- define("APP_PATH", normalize_path(dirname(dirname(dirname(dirname(__FILE__)))), false));
+ // PATHS
+ $script_name = getenv("SCRIPT_NAME");
+ if (SERVER_NAME === "lighttpd") {
+ $script_name = preg_replace("#^.*?//#", "/", $script_name);
+ }
+ define("APP_HREF", normalize_path(dirname(dirname(dirname($script_name))), true));
+ define("APP_PATH", normalize_path(dirname(dirname(dirname(dirname(__FILE__)))), false));
- define("ROOT_HREF", normalize_path(dirname(APP_HREF), true));
- define("ROOT_PATH", normalize_path(dirname(APP_PATH), false));
+ define("ROOT_HREF", normalize_path(dirname(APP_HREF), true));
+ define("ROOT_PATH", normalize_path(dirname(APP_PATH), false));
- $uri_parts = parse_url(getenv("REQUEST_URI"));
- $current_href = normalize_path($uri_parts["path"], true);
- $rel_href = substr($current_href, strlen(ROOT_HREF));
- $current_path = normalize_path(ROOT_PATH . "/" . rawurldecode($rel_href));
- if (!is_dir($current_path)) {
- $current_href = normalize_path(dirname($current_href), true);
- $current_path = normalize_path(dirname($current_path), false);
- }
- define("CURRENT_HREF", $current_href);
- define("CURRENT_PATH", $current_path);
+ $uri_parts = parse_url(getenv("REQUEST_URI"));
+ $current_href = normalize_path($uri_parts["path"], true);
+ $rel_href = substr($current_href, strlen(ROOT_HREF));
+ $current_path = normalize_path(ROOT_PATH . "/" . rawurldecode($rel_href));
+ if (!is_dir($current_path)) {
+ $current_href = normalize_path(dirname($current_href), true);
+ $current_path = normalize_path(dirname($current_path), false);
+ }
+ define("CURRENT_HREF", $current_href);
+ define("CURRENT_PATH", $current_path);
- $index_href = null;
- if (@is_readable(normalize_path(APP_PATH . "/server/php/index.php", false))) {
- $index_href = normalize_path(APP_HREF . "/server/php/index.php", false);
- }
- define("INDEX_HREF", $index_href);
+ $index_href = null;
+ if (@is_readable(normalize_path(APP_PATH . "/server/php/index.php", false))) {
+ $index_href = normalize_path(APP_HREF . "/server/php/index.php", false);
+ }
+ define("INDEX_HREF", $index_href);
- define("CACHE_HREF", normalize_path(APP_HREF . "/cache", true));
- define("CACHE_PATH", normalize_path(APP_PATH . "/cache", false));
- define("HAS_WRITABLE_CACHE", @is_writable(CACHE_PATH));
- define("CMDS_PATH", normalize_path(CACHE_PATH . "/cmds.json", false));
+ define("CACHE_HREF", normalize_path(APP_HREF . "/cache", true));
+ define("CACHE_PATH", normalize_path(APP_PATH . "/cache", false));
+ define("HAS_WRITABLE_CACHE", @is_writable(CACHE_PATH));
+ define("CMDS_PATH", normalize_path(CACHE_PATH . "/cmds.json", false));
- // EXTERNAL COMMANDS
- $cmds = load_commented_json(CMDS_PATH);
- if (sizeof($cmds) === 0 || has_request_param("updatecmds")) {
- $cmds["command"] = exec_0("command -v command");
- $cmds["which"] = exec_0("which which");
+ // EXTERNAL COMMANDS
+ $cmds = load_commented_json(CMDS_PATH);
+ if (sizeof($cmds) === 0 || has_request_param("updatecmds")) {
+ $cmds["command"] = exec_0("command -v command");
+ $cmds["which"] = exec_0("which which");
- $cmd = false;
- if ($cmds["command"]) {
- $cmd = "command -v";
- } else if ($cmds["which"]) {
- $cmd = "which";
- }
+ $cmd = false;
+ if ($cmds["command"]) {
+ $cmd = "command -v";
+ } else if ($cmds["which"]) {
+ $cmd = "which";
+ }
- foreach (array("tar", "zip", "convert", "ffmpeg", "avconv", "du") as $c) {
- $cmds[$c] = ($cmd !== false) && exec_0($cmd . " " . $c);
- }
+ foreach (array("tar", "zip", "convert", "ffmpeg", "avconv", "du") as $c) {
+ $cmds[$c] = ($cmd !== false) && exec_0($cmd . " " . $c);
+ }
- safe_json(CMDS_PATH, $cmds);
- }
- foreach ($cmds as $c => $has) {
- define("HAS_CMD_" . strtoupper($c), $has);
- }
+ safe_json(CMDS_PATH, $cmds);
+ }
+ foreach ($cmds as $c => $has) {
+ define("HAS_CMD_" . strtoupper($c), $has);
+ }
}
diff --git a/src/_h5ai/server/php/inc/util.php b/src/_h5ai/server/php/inc/util.php
index 338a9332..d8a0a377 100644
--- a/src/_h5ai/server/php/inc/util.php
+++ b/src/_h5ai/server/php/inc/util.php
@@ -3,115 +3,115 @@
function normalize_path($path, $trailing_slash = false) {
- $path = preg_replace("#[\\\\/]+#", "/", $path);
- return preg_match("#^(\w:)?/$#", $path) ? $path : (rtrim($path, "/") . ($trailing_slash ? "/" : ""));
+ $path = preg_replace("#[\\\\/]+#", "/", $path);
+ return preg_match("#^(\w:)?/$#", $path) ? $path : (rtrim($path, "/") . ($trailing_slash ? "/" : ""));
}
function json_exit($obj = array()) {
- if (!isset($obj["code"])) {
- $obj["code"] = 0;
- }
+ if (!isset($obj["code"])) {
+ $obj["code"] = 0;
+ }
- header("Content-type: application/json;charset=utf-8");
- echo json_encode($obj);
- exit;
+ header("Content-type: application/json;charset=utf-8");
+ echo json_encode($obj);
+ exit;
}
function json_fail($code, $msg = "", $cond = true) {
- if ($cond) {
- json_exit(array("code" => $code, "msg" => $msg));
- }
+ if ($cond) {
+ json_exit(array("code" => $code, "msg" => $msg));
+ }
}
function has_request_param($key) {
- return array_key_exists($key, $_REQUEST);
+ return array_key_exists($key, $_REQUEST);
}
function use_request_param($key, $default = null) {
- if (!array_key_exists($key, $_REQUEST)) {
- json_fail(101, "parameter '$key' is missing", $default === null);
- return $default;
- }
+ if (!array_key_exists($key, $_REQUEST)) {
+ json_fail(101, "parameter '$key' is missing", $default === null);
+ return $default;
+ }
- $value = $_REQUEST[$key];
- unset($_REQUEST[$key]);
- return $value;
+ $value = $_REQUEST[$key];
+ unset($_REQUEST[$key]);
+ return $value;
}
function starts_with($sequence, $head) {
- return substr($sequence, 0, strlen($head)) === $head;
+ return substr($sequence, 0, strlen($head)) === $head;
}
function ends_with($sequence, $tail) {
- return substr($sequence, -strlen($tail)) === $tail;
+ return substr($sequence, -strlen($tail)) === $tail;
}
function load_commented_json($path) {
- if (!file_exists($path)) {
- return array();
- }
+ if (!file_exists($path)) {
+ return array();
+ }
- $content = file_get_contents($path);
+ $content = file_get_contents($path);
- // remove comments to get pure json
- $content = preg_replace("/\/\*.*?\*\/|\/\/.*?(\n|$)/s", "", $content);
+ // remove comments to get pure json
+ $content = preg_replace("/\/\*.*?\*\/|\/\/.*?(\n|$)/s", "", $content);
- return json_decode($content, true);
+ return json_decode($content, true);
}
function safe_json($path, $obj) {
- $json = json_encode($obj);
- return file_put_contents($path, $json) !== false;
+ $json = json_encode($obj);
+ return file_put_contents($path, $json) !== false;
}
function passthru_cmd($cmd) {
- $rc = null;
- passthru($cmd, $rc);
- return $rc;
+ $rc = null;
+ passthru($cmd, $rc);
+ return $rc;
}
function exec_cmdv($cmdv) {
- if (!is_array($cmdv)) {
- $cmdv = func_get_args();
- }
- $cmd = implode(" ", array_map("escapeshellarg", $cmdv));
+ if (!is_array($cmdv)) {
+ $cmdv = func_get_args();
+ }
+ $cmd = implode(" ", array_map("escapeshellarg", $cmdv));
- $lines = array();
- $rc = null;
- exec($cmd, $lines, $rc);
- return implode("\n", $lines);
+ $lines = array();
+ $rc = null;
+ exec($cmd, $lines, $rc);
+ return implode("\n", $lines);
}
function exec_0($cmd) {
- $lines = array();
- $rc = null;
- try {
- @exec($cmd, $lines, $rc);
- return $rc === 0;
- } catch (Exception $e) {}
- return false;
+ $lines = array();
+ $rc = null;
+ try {
+ @exec($cmd, $lines, $rc);
+ return $rc === 0;
+ } catch (Exception $e) {}
+ return false;
}
@@ -122,13 +122,13 @@ function exec_0($cmd) {
function err_log($message, $obj = null) {
- error_log($message . ": " . var_export($obj, true));
+ error_log($message . ": " . var_export($obj, true));
}
function scr_log($message, $obj = null) {
- echo("
" . $message . ": " . var_export($obj, true) . " \n");
+ echo("
" . $message . ": " . var_export($obj, true) . " \n");
}
@@ -138,16 +138,16 @@ $__TIMER_PREV = $__TIMER_START;
function time_log($message) {
- global $__TIMER_START, $__TIMER_PREV;
+ global $__TIMER_START, $__TIMER_PREV;
- $now = microtime(true);
+ $now = microtime(true);
- if ($__TIMER_START === $__TIMER_PREV) {
- error_log("------------------------------");
- register_shutdown_function(function () { time_log('ex'); });
- }
+ if ($__TIMER_START === $__TIMER_PREV) {
+ error_log("------------------------------");
+ register_shutdown_function(function () { time_log('ex'); });
+ }
- error_log($message . " DT " . number_format($now - $__TIMER_PREV, 5) . " TT " . number_format($now - $__TIMER_START, 5));
+ error_log($message . " DT " . number_format($now - $__TIMER_PREV, 5) . " TT " . number_format($now - $__TIMER_START, 5));
- $__TIMER_PREV = $now;
+ $__TIMER_PREV = $now;
}
diff --git a/src/_h5ai/server/php/index.php b/src/_h5ai/server/php/index.php
index bfd13c08..8e974bfd 100644
--- a/src/_h5ai/server/php/index.php
+++ b/src/_h5ai/server/php/index.php
@@ -13,7 +13,7 @@ define("PASSHASH", "da39a3ee5e6b4b0d3255bfef95601890afd80709");
function normalized_require_once($lib) {
- require_once(preg_replace("#[\\\\/]+#", "/", dirname(__FILE__) . "/inc/${lib}.php"));
+ require_once(preg_replace("#[\\\\/]+#", "/", dirname(__FILE__) . "/inc/${lib}.php"));
}
normalized_require_once("util");
@@ -28,9 +28,9 @@ setup();
$app = new App();
if (has_request_param("action")) {
- $api = new Api($app);
- $api->apply();
+ $api = new Api($app);
+ $api->apply();
} else {
- define("FALLBACK", $app->get_fallback());
- normalized_require_once("page");
+ define("FALLBACK", $app->get_fallback());
+ normalized_require_once("page");
}