Commit 42eb8015 authored by Henning Leutz's avatar Henning Leutz 🥋

Merge branch 'dev'

parents ef04db5e 4af84c2d
......@@ -9,7 +9,7 @@
*/
QUI::$Ajax->registerFunction(
'ajax_site_children_sort',
function ($project, $parent, $ids, $from) {
function ($project, $parent, $ids, $from, $sortType) {
$Project = QUI::getProjectManager()->decode($project);
$ids = \json_decode($ids, true);
$from = (int)$from;
......@@ -18,6 +18,11 @@ QUI::$Ajax->registerFunction(
$Parent = $Project->get($parent);
$Parent->checkPermission('quiqqer.projects.site.edit');
if (!empty($sortType)) {
$Parent->setAttribute('order_type', $sortType);
$Parent->save();
}
$childrenIds = $Parent->getChildrenIds();
foreach ($ids as $id) {
......@@ -46,5 +51,5 @@ QUI::$Ajax->registerFunction(
)
);
},
['project', 'parent', 'ids', 'from']
['project', 'parent', 'ids', 'from', 'sortType']
);
......@@ -23,7 +23,7 @@ QUI::$Ajax->registerFunction(
$attributes = \explode(',', $params['attributes']);
}
// forerst kein limit
// vorerst kein limit
if (isset($params['limit']) && $params['limit']) {
$children = $Site->getChildren([
'limit' => $params['limit']
......
......@@ -9,12 +9,14 @@ define('controls/cache/Settings', [
'qui/QUI',
'qui/controls/Control',
'qui/controls/buttons/Button',
'qui/controls/windows/Confirm',
'Ajax',
'Locale',
'css!controls/cache/Settings.css'
], function (QUI, QUIControl, QUIButton, Ajax, QUILocale) {
], function (QUI, QUIControl, QUIButton, QUIConfirm, Ajax, QUILocale) {
"use strict";
var lg = 'quiqqer/quiqqer';
......@@ -25,7 +27,8 @@ define('controls/cache/Settings', [
Type : 'controls/cache/Settings',
Binds: [
'$onImport'
'$onImport',
'$confirmCacheClearDialog'
],
initialize: function (Settings) {
......@@ -63,16 +66,7 @@ define('controls/cache/Settings', [
text : QUILocale.get(lg, 'quiqqer.settings.cache.clear.complete'),
textimage: 'fa fa-trash-o',
events : {
onClick: function (Btn) {
Btn.setAttribute('textimage', 'fa fa-spinner fa-spin');
self.clear(
{complete: true},
function () {
Btn.setAttribute('textimage', 'fa fa-trash-o');
}
);
}
onClick: this.$confirmCacheClearDialog
}
}).inject(ClearCacheBody);
......@@ -154,6 +148,50 @@ define('controls/cache/Settings', [
}).inject(PurgeCacheBody);
},
/**
* Confirm the clearing of the complete QUIQQER cache
*/
$confirmCacheClearDialog: function () {
var self = this;
new QUIConfirm({
maxHeight: 300,
maxWidth : 700,
autoclose: false,
information: QUILocale.get(lg, 'quiqqer.settings.cache.clear.complete.confirm.information'),
title : QUILocale.get(lg, 'quiqqer.settings.cache.clear.complete'),
texticon : 'fa fa-exclamation-triangle',
text : QUILocale.get(lg, 'quiqqer.settings.cache.clear.complete.confirm.text'),
icon : 'fa fa-trash-o',
cancel_button: {
text : QUILocale.get(lg, 'cancel'),
textimage: 'icon-remove fa fa-remove'
},
ok_button : {
'class:' : 'btn btn-red',
text : QUILocale.get(lg, 'quiqqer.settings.cache.clear.complete.confirm.submit'),
textimage: 'icon-ok fa fa-trash-o'
},
events : {
onOpen : function (Win) {
Win.getButton('submit').getElm().addClass('btn-red');
},
onSubmit: function (Win) {
Win.Loader.show();
self.clear(
{complete: true},
function () {
Win.close();
}
);
}
}
}).open();
},
/**
* Clear the cache
......
......@@ -279,11 +279,12 @@ define('controls/projects/project/site/SiteChildrenSort', [
return new Promise(function (resolve, reject) {
Ajax.post('ajax_site_children_sort', resolve, {
project: Project.encode(),
parent : self.$Site.getId(),
ids : JSON.encode(ids),
start : (page - 1) * perPage,
onError: reject
project : Project.encode(),
parent : self.$Site.getId(),
ids : JSON.encode(ids),
start : (page - 1) * perPage,
sortType: 'manuell',
onError : reject
});
}).then(function () {
return self.displayChildren();
......
......@@ -566,6 +566,7 @@ class Edit extends Site
$order_type = 'manuell';
switch ($this->getAttribute('order_type')) {
case 'manual':
case 'manuell':
case 'name ASC':
case 'name DESC':
......@@ -840,6 +841,7 @@ class Edit extends Site
$params['order'] = $this->getAttribute('order_type');
break;
case 'manual':
case 'manuell':
default:
$params['order'] = 'order_field';
......@@ -1121,6 +1123,7 @@ class Edit extends Site
// get new order_field if manually sorting
if ($Parent->getAttribute('order_type') === ''
|| $Parent->getAttribute('order_type') === 'manuell'
|| $Parent->getAttribute('order_type') === 'manual'
|| !$Parent->getAttribute('order_type')) {
$LastChild = $Parent->lastChild(['active' => '0&1']);
......
......@@ -2628,6 +2628,17 @@
<locale name="quiqqer.settings.cache.clear.complete">
<de><![CDATA[Kompletten Cache leeren]]></de>
</locale>
<locale name="quiqqer.settings.cache.clear.complete.confirm.information">
<de><![CDATA[Durch das Leeren des kompletten QUIQQER Caches können ggf. größere Datenmengen gelöscht werden, deren Neuerstellung eine längere Zeit benötigt. Dies kann dazu führen, dass Ihre Website in diesem Zeitraum erheblich langsamer ist.]]></de>
</locale>
<locale name="quiqqer.settings.cache.clear.complete.confirm.text">
<de><![CDATA[Sind Sie sicher, dass der komplette QUIQQER Cache gelöscht werden soll?]]></de>
</locale>
<locale name="quiqqer.settings.cache.clear.complete.confirm.submit">
<de><![CDATA[Jetzt kompletten QUIQQER Cache löschen]]></de>
</locale>
<locale name="quiqqer.settings.cache.clear.quiqqer">
<de><![CDATA[Kompletten QUIQQER Cache leeren]]></de>
</locale>
......
......@@ -1047,10 +1047,10 @@ You can also ignore the console user permissions check with '--ignore-file-permi
<en><![CDATA[Company]]></en>
</locale>
<locale name="message.clear.cache.successful">
<en><![CDATA[Cache successful cleared.]]></en>
<en><![CDATA[Cache cleared successfully.]]></en>
</locale>
<locale name="message.clear.cache.purged">
<en><![CDATA[Cache successful purged.]]></en>
<en><![CDATA[Cache purged successfully.]]></en>
</locale>
<locale name="message.unknown.root.group">
<en><![CDATA[Unknown ROOT group. Please contact an administrator.]]></en>
......@@ -2572,6 +2572,15 @@ You can also ignore the console user permissions check with '--ignore-file-permi
<locale name="quiqqer.settings.cache.clear.quiqqer">
<en><![CDATA[Clear complete QUIQQER cache]]></en>
</locale>
<locale name="quiqqer.settings.cache.clear.complete.confirm.information">
<en><![CDATA[By clearing the entire QUIQQER cache, larger amounts of data can be deleted, whose re-creation may require a longer time. This can cause your website to be considerably slower during this period.]]></en>
</locale>
<locale name="quiqqer.settings.cache.clear.complete.confirm.text">
<en><![CDATA[Are you sure you want to clear the entire QUIQQER cache?]]></en>
</locale>
<locale name="quiqqer.settings.cache.clear.complete.confirm.submit">
<en><![CDATA[Clear complete QUIQQER cache now]]></en>
</locale>
<locale name="quiqqer.settings.cache.quiqqer.title">
<en><![CDATA[QUIQQER System Cache]]></en>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment