Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 58e03e903c | |||
| 9747820cb8 | |||
| d8d6aededa | |||
| a27e723657 | |||
| c7db75cea3 | |||
| 4cd5421e53 | |||
| f2d1de1cbe | |||
| 6be679c569 | |||
| 0893ddd5fe | |||
| c893391065 | |||
| b06df8ad9f | |||
| 13f7e63514 | |||
| 64da45e676 | |||
| 77e27bcc1a | |||
| 99858d86c1 | |||
| 6984efdafd | |||
| 48d80edb0a | |||
| b57743c61a | |||
| a58ca57e46 | |||
| dc6ec4eb89 | |||
| 8588f1510f | |||
| 02825cee67 | |||
| 10e90df4b8 | |||
| 99590447e5 | |||
| b5e41ff96e | |||
| 680587e75c | |||
| 9f7d6c931e | |||
| 205a72f74d | |||
| ef00aae51f | |||
| b208c8cb19 | |||
| 0e5cd135b4 | |||
| 854beb8078 | |||
| 709f938f48 | |||
| 80700cac32 | |||
| a71a8c7208 | |||
| cf80c3512c | |||
| a5d88317e6 | |||
| b2103a012c | |||
| 847b3696cb | |||
| c67bfa0ce4 | |||
| 7edd6d6d84 | |||
| ae148aba02 | |||
| 575f963902 | |||
| ae74e745db | |||
| b749a9be2e | |||
| d279fbd813 | |||
| 0d98a40536 | |||
| 5e894f9f08 | |||
| 731d4f826b | |||
| 4225b157e0 | |||
| 0eefcd23cd | |||
| ead4ce9a6f |
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
name: "New feature"
|
||||||
|
about: "Use this template if you want to request a feature"
|
||||||
|
title: "[FEATURE] "
|
||||||
|
labels:
|
||||||
|
- enhancement
|
||||||
|
---
|
||||||
|
## Feature
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
### Benefits
|
||||||
|
|
||||||
|
...
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: "New issue"
|
||||||
|
about: "Use this template if you have a bug"
|
||||||
|
title: "[BUG] "
|
||||||
|
labels:
|
||||||
|
- bug
|
||||||
|
---
|
||||||
|
## Issue
|
||||||
|
|
||||||
|
### Environment
|
||||||
|
|
||||||
|
* Custom menu version:
|
||||||
|
* Nextcloud version:
|
||||||
|
* PHP version:
|
||||||
|
* Web server (Nginx, Apache2):
|
||||||
|
* Web browser and version (Firefox 80, Google Chrome 74, etc):
|
||||||
|
|
||||||
|
```
|
||||||
|
Insert your configuration here. You can export the configuration using the admin page.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Steps to reproduce
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
### Observed Results
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
### Expected Results
|
||||||
|
|
||||||
|
...
|
||||||
+1027
File diff suppressed because one or more lines are too long
@@ -1,35 +0,0 @@
|
|||||||
## Feature
|
|
||||||
|
|
||||||
### Description
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
### Benefits
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Issue
|
|
||||||
|
|
||||||
### Environment
|
|
||||||
|
|
||||||
* Side menu version: ...
|
|
||||||
* Nextcloud version: ...
|
|
||||||
* PHP version: ...
|
|
||||||
* Web server (Nginx, Apache2): ...
|
|
||||||
* Web browser and version (Firefox 80, Google Chrome 74, etc): ...
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
|
|
||||||
* ...
|
|
||||||
* ...
|
|
||||||
* ...
|
|
||||||
|
|
||||||
### Observed Results
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
### Expected Results
|
|
||||||
|
|
||||||
...
|
|
||||||
@@ -6,22 +6,35 @@ You can also define apps that must be displayed in the top menu. Fully customisa
|
|||||||
|
|
||||||
This application is rather suitable for instances that activate a lot of applications.
|
This application is rather suitable for instances that activate a lot of applications.
|
||||||
|
|
||||||
Comptatible with AppOrder.
|
You can customize colors depending of the theme (Dark theme and Breeze Dark). Comptatible with AppOrder.
|
||||||
|
|
||||||
* [Installation and upgrade](#installation-and-upgrade)
|
* [Installation and upgrade](#installation-and-upgrade)
|
||||||
* [How to contribute?](#how-to-contribute)
|
* [How to contribute?](#how-to-contribute)
|
||||||
* [Screenshots](https://gitnet.fr/deblan/side_menu/src/branch/master/screenshots/)
|
* [Screenshots](https://gitnet.fr/deblan/side_menu/src/branch/master/screenshots/)
|
||||||
|
|
||||||
You like this app and you want to support me? [Buy me a coffee](https://www.buymeacoffee.com/deblan) ☕
|
You like this app and you want to support me? ☕ [Buy me a coffee](https://www.buymeacoffee.com/deblan) or [Donate with liberapay](https://liberapay.com/deblan)
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
* PHP >= 7.3
|
||||||
|
* App `theming` enabled
|
||||||
|
|
||||||
Installation and upgrade
|
Installation and upgrade
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
Custom menu is available from the app store. If you want to install it from source: go to https://gitnet.fr/deblan/side_menu/releases and download the last release (side_menu_vX.Y.Z.zip). Copy the content into `apps`.
|
Custom menu is available from the app store.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cd /path/to/nextcloud
|
||||||
|
$ php occ app:install side_menu
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to install it from source, go to https://gitnet.fr/deblan/side_menu/releases and copy the link to the last release (side_menu_vX.Y.Z.tar.gz). Then:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cd /path/to/nextcloud/apps
|
$ cd /path/to/nextcloud/apps
|
||||||
$ unzip /path/to/side_menu_vX.Y.Z.zip # tar xvf /path/to/side_menu_vX.Y.Z.tar.gz
|
$ curl -sS https://gitnet.fr/attachments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | tar xvfz -
|
||||||
```
|
```
|
||||||
|
|
||||||
Administrators can edit many settings using the administration page.
|
Administrators can edit many settings using the administration page.
|
||||||
|
|||||||
+19
-12
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<info>
|
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
|
||||||
<id>side_menu</id>
|
<id>side_menu</id>
|
||||||
<name>Custom menu</name>
|
<name>Custom menu</name>
|
||||||
<summary>Modify the display of the menu.</summary>
|
<summary>Modify the display of the menu.</summary>
|
||||||
@@ -10,22 +11,32 @@ This application is rather suitable for instances that activate a lot of applica
|
|||||||
|
|
||||||
Use the shortcut `Ctrl`+`o` to open and to hide the side menu. Use `tab` to navigate.
|
Use the shortcut `Ctrl`+`o` to open and to hide the side menu. Use `tab` to navigate.
|
||||||
|
|
||||||
Comptatible with AppOrder.
|
You can customize colors depending of the theme (Dark theme and Breeze Dark). Comptatible with AppOrder.
|
||||||
|
|
||||||
You can report a bug or request a feature by opening an issue.
|
You can report a bug or request a feature by opening an issue.
|
||||||
|
|
||||||
If you like this application and want to support the development:
|
Requirements:
|
||||||
|
|
||||||
* ☕ [Buy me a coffee](https://www.buymeacoffee.com/deblan)
|
* PHP >= 7.3
|
||||||
* 😃 [Leave a comment](https://apps.nextcloud.com/apps/side_menu#comments)
|
* App `theming` enabled
|
||||||
|
|
||||||
|
If you like this application and if you want to support the development:
|
||||||
|
|
||||||
|
* [Buy me a coffee](https://www.buymeacoffee.com/deblan)
|
||||||
|
* [Donate with liberapay](https://liberapay.com/deblan)
|
||||||
|
* [Leave a comment](https://apps.nextcloud.com/apps/side_menu#comments)
|
||||||
]]></description>
|
]]></description>
|
||||||
|
<version>1.23.0</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
|
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
|
||||||
<version>1.16.2</version>
|
|
||||||
<namespace>SideMenu</namespace>
|
<namespace>SideMenu</namespace>
|
||||||
|
<documentation>
|
||||||
|
<admin>https://gitnet.fr/deblan/side_menu/src/branch/master/README.md</admin>
|
||||||
|
<developer>https://gitnet.fr/deblan/side_menu/src/branch/master/README.md</developer>
|
||||||
|
</documentation>
|
||||||
<category>customization</category>
|
<category>customization</category>
|
||||||
<website>https://gitnet.fr/deblan/side_menu</website>
|
<website>https://gitnet.fr/deblan/side_menu</website>
|
||||||
<discussion>https://matrix.to/#/!GhfQePnOSPYpYEunWM:neutralnetwork.org</discussion>
|
<discussion>https://matrix.to/#/!TFPucDATKODpHNVAtu:neutralnetwork.org?via=neutralnetwork.org</discussion>
|
||||||
<bugs>https://gitnet.fr/deblan/side_menu/issues</bugs>
|
<bugs>https://gitnet.fr/deblan/side_menu/issues</bugs>
|
||||||
<repository type="git">https://gitnet.fr/deblan/side_menu</repository>
|
<repository type="git">https://gitnet.fr/deblan/side_menu</repository>
|
||||||
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc19_default_menu.png</screenshot>
|
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc19_default_menu.png</screenshot>
|
||||||
@@ -34,12 +45,8 @@ If you like this application and want to support the development:
|
|||||||
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc18_menu_always_displayed.png</screenshot>
|
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc18_menu_always_displayed.png</screenshot>
|
||||||
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc20_big_menu_responsive.png</screenshot>
|
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc20_big_menu_responsive.png</screenshot>
|
||||||
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/personal_settings.png</screenshot>
|
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/personal_settings.png</screenshot>
|
||||||
<documentation>
|
|
||||||
<admin>https://gitnet.fr/deblan/side_menu/src/branch/master/README.md</admin>
|
|
||||||
<developer>https://gitnet.fr/deblan/side_menu/src/branch/master/README.md</developer>
|
|
||||||
</documentation>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<nextcloud min-version="18" max-version="20"/>
|
<nextcloud min-version="18" max-version="21"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<settings>
|
<settings>
|
||||||
<admin>OCA\SideMenu\Settings\Admin</admin>
|
<admin>OCA\SideMenu\Settings\Admin</admin>
|
||||||
|
|||||||
+7
-5
@@ -19,10 +19,12 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'routes' => [
|
'routes' => [
|
||||||
['name' => 'Css#stylesheet', 'url' => '/css/stylesheet', 'verb' => 'GET'],
|
['name' => 'Css#stylesheet', 'url' => '/css/stylesheet', 'verb' => 'GET'],
|
||||||
['name' => 'Js#script', 'url' => '/js/script', 'verb' => 'GET'],
|
['name' => 'Js#script', 'url' => '/js/script', 'verb' => 'GET'],
|
||||||
['name' => 'Js#config', 'url' => '/js/config', 'verb' => 'GET'],
|
['name' => 'Js#config', 'url' => '/js/config', 'verb' => 'GET'],
|
||||||
['name' => 'Nav#items', 'url' => '/nav/items', 'verb' => 'GET'],
|
['name' => 'Nav#items', 'url' => '/nav/items', 'verb' => 'GET'],
|
||||||
['name' => 'PersonalSetting#valueSet', 'url' => '/personalSetting/valueSet', 'verb' => 'POST'],
|
['name' => 'PersonalSetting#valueSet', 'url' => '/personalSetting/valueSet', 'verb' => 'POST'],
|
||||||
|
['name' => 'AdminSetting#removeCache', 'url' => '/admin/cache/remove', 'verb' => 'GET'],
|
||||||
|
['name' => 'AdminSetting#exportConfiguration', 'url' => '/admin/config/export', 'verb' => 'GET'],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Generates l10n files using Yaml.
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* php bin/generate_l10n.php
|
||||||
|
*/
|
||||||
|
|
||||||
function generateJsContent($translations)
|
function generateJsContent($translations)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Imports a json configuration into a sqlite database.
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* php bin/import_config.php /path/to/config.json /path/to/owncloud.db
|
||||||
|
*/
|
||||||
|
|
||||||
|
$configFile = $argv[1];
|
||||||
|
$databaseFile = $argv[2];
|
||||||
|
|
||||||
|
$content = file_get_contents($configFile);
|
||||||
|
$config = json_decode($content, true);
|
||||||
|
|
||||||
|
$pdo = new \Pdo(sprintf('sqlite:%s', $databaseFile));
|
||||||
|
$stmt = $pdo->prepare('UPDATE oc_appconfig SET configvalue=:value WHERE configkey=:key and appid=:appId');
|
||||||
|
|
||||||
|
foreach ($config as $key => $value) {
|
||||||
|
$stmt->execute([
|
||||||
|
'appId' => 'side_menu',
|
||||||
|
'key' => $key,
|
||||||
|
'value' => $value,
|
||||||
|
]);
|
||||||
|
}
|
||||||
@@ -68,3 +68,54 @@
|
|||||||
.side-menu-toggler {
|
.side-menu-toggler {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.side-menu-setting-list {
|
||||||
|
margin: 10px 4px 4px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-setting-list-item {
|
||||||
|
padding: 5px 10px;
|
||||||
|
border: 1px solid var(--color-border-dark);
|
||||||
|
max-width: 300px;
|
||||||
|
margin: -1px 0 0 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-setting.arrow {
|
||||||
|
color: #ccc;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-setting-list-item input {
|
||||||
|
min-height: auto;
|
||||||
|
margin-top: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.side-menu-setting-table {
|
||||||
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-setting-row {
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-setting-label {
|
||||||
|
display: table-cell;
|
||||||
|
width: 400px;
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-setting-form {
|
||||||
|
display: table-cell;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-setting-label-short {
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-setting-form-long {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -37,6 +37,34 @@
|
|||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.side-menu-settings {
|
||||||
|
margin-right: 9px;
|
||||||
|
margin-top: 2px;
|
||||||
|
float: right;
|
||||||
|
line-height: 34px;
|
||||||
|
height: 28px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-settings a {
|
||||||
|
color: var(--side-menu-text-color, #fff);
|
||||||
|
display: block;
|
||||||
|
padding: 4px 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-settings:hover a, .side-menu-settings a:active, .side-menu-settings a:focus {
|
||||||
|
background: var(--side-menu-current-app-background-color, #444);
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-settings img {
|
||||||
|
vertical-align: bottom;
|
||||||
|
margin-left: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu.open .side-menu-settings {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
.side-menu-opener {
|
.side-menu-opener {
|
||||||
background: var(--side-menu-opener, url('../img/side-menu-opener.svg'));
|
background: var(--side-menu-opener, url('../img/side-menu-opener.svg'));
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use OC;
|
|||||||
use OC\Security\CSP\ContentSecurityPolicyNonceManager;
|
use OC\Security\CSP\ContentSecurityPolicyNonceManager;
|
||||||
use OC\User\User;
|
use OC\User\User;
|
||||||
use OCA\SideMenu\Service\AppRepository;
|
use OCA\SideMenu\Service\AppRepository;
|
||||||
|
use OCA\SideMenu\Service\CategoryRepository;
|
||||||
use OCA\SideMenu\Service\ConfigProxy;
|
use OCA\SideMenu\Service\ConfigProxy;
|
||||||
use OCP\AppFramework\App;
|
use OCP\AppFramework\App;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
@@ -58,7 +59,16 @@ class Application extends App
|
|||||||
$isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0');
|
$isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0');
|
||||||
|
|
||||||
if (null !== $this->user && !$isForced) {
|
if (null !== $this->user && !$isForced) {
|
||||||
$enabled = (bool) $this->config->getUserValue($this->user->getUid(), self::APP_ID, 'enabled', '1');
|
$enabled = (bool) $this->config->getUserValue(
|
||||||
|
$this->user->getUid(),
|
||||||
|
self::APP_ID,
|
||||||
|
'enabled',
|
||||||
|
$this->config->getAppValue(
|
||||||
|
self::APP_ID,
|
||||||
|
'default-enabled',
|
||||||
|
'1'
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $enabled;
|
return $enabled;
|
||||||
@@ -72,11 +82,15 @@ class Application extends App
|
|||||||
$container = $this->getContainer();
|
$container = $this->getContainer();
|
||||||
|
|
||||||
$container->registerService('AppRepository', function (ContainerInterface $c) {
|
$container->registerService('AppRepository', function (ContainerInterface $c) {
|
||||||
return new AppRepository(new OC_App());
|
return new AppRepository();
|
||||||
|
});
|
||||||
|
|
||||||
|
$container->registerService('CategoryRepository', function (ContainerInterface $c) {
|
||||||
|
return new CategoryRepository();
|
||||||
});
|
});
|
||||||
|
|
||||||
$container->registerService('ConfigProxy', function (ContainerInterface $c) {
|
$container->registerService('ConfigProxy', function (ContainerInterface $c) {
|
||||||
return new ConfigProxy($this->config);
|
return new ConfigProxy();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @license GNU AGPL version 3 or any later version
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OCA\SideMenu\Controller;
|
||||||
|
|
||||||
|
use OCA\SideMenu\AppInfo\Application;
|
||||||
|
use OCP\AppFramework\Controller;
|
||||||
|
use OCP\AppFramework\Http\DataDownloadResponse;
|
||||||
|
use OCP\AppFramework\Http\RedirectResponse;
|
||||||
|
use OCP\AppFramework\Http\Response;
|
||||||
|
use OCP\IConfig;
|
||||||
|
use OCP\IRequest;
|
||||||
|
use OCP\IURLGenerator;
|
||||||
|
|
||||||
|
class AdminSettingController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var IConfig
|
||||||
|
*/
|
||||||
|
protected $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var IURLGenerator
|
||||||
|
*/
|
||||||
|
protected $urlGenerator;
|
||||||
|
|
||||||
|
public function __construct($appName, IRequest $request, IConfig $config, IURLGenerator $urlGenerator)
|
||||||
|
{
|
||||||
|
parent::__construct($appName, $request);
|
||||||
|
|
||||||
|
$this->config = $config;
|
||||||
|
$this->urlGenerator = $urlGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @NoCSRFRequired
|
||||||
|
*
|
||||||
|
* @return RedirectResponse
|
||||||
|
*/
|
||||||
|
public function removeCache()
|
||||||
|
{
|
||||||
|
$this->config->setAppValue(Application::APP_ID, 'cache-categories', '[]');
|
||||||
|
|
||||||
|
return new RedirectResponse($this->urlGenerator->linkToRoute('settings.AdminSettings.index', [
|
||||||
|
'section' => Application::APP_ID,
|
||||||
|
]).'#more');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @NoCSRFRequired
|
||||||
|
*
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function exportConfiguration()
|
||||||
|
{
|
||||||
|
$keys = $this->config->getAppKeys(Application::APP_ID);
|
||||||
|
$config = [];
|
||||||
|
$excludedKeys = [
|
||||||
|
'cache',
|
||||||
|
'cache-categories',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($keys as $key) {
|
||||||
|
if (in_array($key, $excludedKeys)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$config[$key] = $this->config->getAppValue(Application::APP_ID, $key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new DataDownloadResponse(
|
||||||
|
json_encode($config, JSON_PRETTY_PRINT),
|
||||||
|
'config.json',
|
||||||
|
'text/json'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -65,29 +65,61 @@ class CssController extends Controller
|
|||||||
|
|
||||||
protected function getConfig(): array
|
protected function getConfig(): array
|
||||||
{
|
{
|
||||||
$backgroundColor = $this->config->getAppValue('background-color', '#333333');
|
|
||||||
$backgroundColorTo = $this->config->getAppValue('background-color-to', $backgroundColor);
|
|
||||||
$isForced = $this->config->getAppValueBool('force', '0');
|
$isForced = $this->config->getAppValueBool('force', '0');
|
||||||
$topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]');
|
$topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]');
|
||||||
|
|
||||||
|
$isAccessibilityAppEnabled = $this->config->getAppValueBool('enabled', '0', 'accessibility');
|
||||||
|
$isBreezeDarkAppEnabled = $this->config->getAppValueBool('enabled', '0', 'breezedark');
|
||||||
|
$isBreezeDarkGlobalEnabled = $this->config->getAppValueBool('theme_enabled', '0', 'breezedark');
|
||||||
|
|
||||||
if ($this->user) {
|
if ($this->user) {
|
||||||
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
|
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
|
||||||
|
|
||||||
if (!empty($userTopMenuApps) && !$isForced) {
|
if (!empty($userTopMenuApps) && !$isForced) {
|
||||||
$topMenuApps = $userTopMenuApps;
|
$topMenuApps = $userTopMenuApps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$isDarkThemeUserEnabled = $this->config->getUserValue($this->user, 'theme', '', 'accessibility') === 'dark';
|
||||||
|
$isBreezeDarkUserEnabled = $this->config->getUserValue($this->user, 'theme_enabled', '', 'breezedark');
|
||||||
|
|
||||||
|
$isBreezeDarkUserEnabled = $isBreezeDarkUserEnabled === '1' || ($isBreezeDarkGlobalEnabled && $isBreezeDarkUserEnabled === '');
|
||||||
|
} else {
|
||||||
|
$isDarkThemeUserEnabled = false;
|
||||||
|
$isBreezeDarkUserEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$isDarkMode = ($isAccessibilityAppEnabled && $isDarkThemeUserEnabled) || ($isBreezeDarkAppEnabled && $isBreezeDarkUserEnabled);
|
||||||
|
|
||||||
|
if ($isDarkMode) {
|
||||||
|
$backgroundColor = $this->config->getAppValue('dark-mode-background-color', '#333333');
|
||||||
|
$backgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $backgroundColor);
|
||||||
|
$currentAppBackgroundColor = $this->config->getAppValue('dark-mode-current-app-background-color', '#444444');
|
||||||
|
$loaderColor = $this->config->getAppValue('dark-mode-loader-color', '#cccccc');
|
||||||
|
$textColor = $this->config->getAppValue('dark-mode-text-color', '#FFFFFF');
|
||||||
|
$iconInvertFilter = abs($this->config->getAppValueInt('dark-mode-icon-invert-filter', '0')).'%';
|
||||||
|
$iconOpacity = abs($this->config->getAppValueInt('dark-mode-icon-opacity', '100') / 100);
|
||||||
|
$opener = $this->config->getAppValue('dark-mode-opener', 'side-menu-opener');
|
||||||
|
} else {
|
||||||
|
$backgroundColor = $this->config->getAppValue('background-color', '#333333');
|
||||||
|
$backgroundColorTo = $this->config->getAppValue('background-color-to', $backgroundColor);
|
||||||
|
$currentAppBackgroundColor = $this->config->getAppValue('current-app-background-color', '#444444');
|
||||||
|
$loaderColor = $this->config->getAppValue('loader-color', '#0e75ac');
|
||||||
|
$textColor = $this->config->getAppValue('text-color', '#FFFFFF');
|
||||||
|
$iconInvertFilter = abs($this->config->getAppValueInt('icon-invert-filter', '0')).'%';
|
||||||
|
$iconOpacity = abs($this->config->getAppValueInt('icon-opacity', '100') / 100);
|
||||||
|
$opener = $this->config->getAppValue('opener', 'side-menu-opener');
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'vars' => [
|
'vars' => [
|
||||||
'background-color' => $backgroundColor,
|
'background-color' => $backgroundColor,
|
||||||
'background-color-to' => $backgroundColorTo,
|
'background-color-to' => $backgroundColorTo,
|
||||||
'current-app-background-color' => $this->config->getAppValue('current-app-background-color', '#444444'),
|
'current-app-background-color' => $currentAppBackgroundColor,
|
||||||
'loader-color' => $this->config->getAppValue('loader-color', '#0e75ac'),
|
'loader-color' => $loaderColor,
|
||||||
'text-color' => $this->config->getAppValue('text-color', '#FFFFFF'),
|
'text-color' => $textColor,
|
||||||
'opener' => $this->config->getAppValue('opener', 'side-menu-opener'),
|
'opener' => $opener,
|
||||||
'icon-invert-filter' => abs($this->config->getAppValueInt('icon-invert-filter', '0')).'%',
|
'icon-invert-filter' => $iconInvertFilter,
|
||||||
'icon-opacity' => abs($this->config->getAppValueInt('icon-opacity', '100') / 100),
|
'icon-opacity' => $iconOpacity,
|
||||||
],
|
],
|
||||||
'display-logo' => $this->config->getAppValueBool('display-logo', '1'),
|
'display-logo' => $this->config->getAppValueBool('display-logo', '1'),
|
||||||
'opener-only' => $this->config->getAppValueBool('opener-only', '0'),
|
'opener-only' => $this->config->getAppValueBool('opener-only', '0'),
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ use OCP\AppFramework\Http\JSONResponse;
|
|||||||
use OCP\AppFramework\Http\TemplateResponse;
|
use OCP\AppFramework\Http\TemplateResponse;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
|
use OCP\L10N\IFactory;
|
||||||
|
|
||||||
class JsController extends Controller
|
class JsController extends Controller
|
||||||
{
|
{
|
||||||
@@ -46,14 +47,25 @@ class JsController extends Controller
|
|||||||
*/
|
*/
|
||||||
protected $themingDefaults;
|
protected $themingDefaults;
|
||||||
|
|
||||||
public function __construct(string $appName, IRequest $request, ConfigProxy $config, ThemingDefaults $themingDefaults)
|
/**
|
||||||
{
|
* @var IFactory
|
||||||
|
*/
|
||||||
|
protected $l10nFactory;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
string $appName,
|
||||||
|
IRequest $request,
|
||||||
|
ConfigProxy $config,
|
||||||
|
ThemingDefaults $themingDefaults,
|
||||||
|
IFactory $l10nFactory
|
||||||
|
) {
|
||||||
parent::__construct($appName, $request);
|
parent::__construct($appName, $request);
|
||||||
|
|
||||||
$this->themingDefaults = $themingDefaults;
|
$this->themingDefaults = $themingDefaults;
|
||||||
|
|
||||||
$this->user = OC::$server[IUserSession::class]->getUser();
|
$this->user = OC::$server[IUserSession::class]->getUser();
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
$this->l10nFactory = $l10nFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,7 +97,9 @@ class JsController extends Controller
|
|||||||
$targetBlankApps = $this->config->getAppValueArray('target-blank-apps', '[]');
|
$targetBlankApps = $this->config->getAppValueArray('target-blank-apps', '[]');
|
||||||
$useAvatar = $this->config->getAppValueBool('use-avatar', '0');
|
$useAvatar = $this->config->getAppValueBool('use-avatar', '0');
|
||||||
$isForced = $this->config->getAppValueBool('force', '0');
|
$isForced = $this->config->getAppValueBool('force', '0');
|
||||||
|
$addLogoLink = $this->config->getAppValueBool('add-logo-link', '1');
|
||||||
$avatar = null;
|
$avatar = null;
|
||||||
|
$settings = null;
|
||||||
|
|
||||||
if ($this->user) {
|
if ($this->user) {
|
||||||
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
|
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
|
||||||
@@ -104,16 +118,32 @@ class JsController extends Controller
|
|||||||
$isAvatarSet = OC::$server->getAvatarManager()->getAvatar($this->user->getUid())->exists();
|
$isAvatarSet = OC::$server->getAvatarManager()->getAvatar($this->user->getUid())->exists();
|
||||||
|
|
||||||
if ($useAvatar && $isAvatarSet) {
|
if ($useAvatar && $isAvatarSet) {
|
||||||
$avatar = OC::$server->getURLGenerator()->linkToRoute(
|
$avatar = OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', [
|
||||||
'core.avatar.getAvatar', [
|
'userId' => $this->user->getUid(),
|
||||||
'userId' => $this->user->getUid(),
|
'size' => 128,
|
||||||
'size' => 128,
|
'v' => $this->config->getUserValueInt($this->user, 'avatar', 'version', 0),
|
||||||
'v' => $this->config->getUserValueInt($this->user, 'avatar', 'version', 0),
|
]);
|
||||||
]
|
}
|
||||||
);
|
|
||||||
|
if ($this->config->getAppValueBool('show-settings', '0')) {
|
||||||
|
$settingsNav = OC::$server->getNavigationManager()->getAll('settings');
|
||||||
|
|
||||||
|
if (isset($settingsNav['settings'])) {
|
||||||
|
$settings = [
|
||||||
|
'href' => $settingsNav['settings']['href'],
|
||||||
|
'name' => $settingsNav['settings']['name'],
|
||||||
|
'avatar' => OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', [
|
||||||
|
'userId' => $this->user->getUid(),
|
||||||
|
'size' => 32,
|
||||||
|
'v' => $this->config->getUserValueInt($this->user, 'avatar', 'version', 0),
|
||||||
|
]),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$indexUrl = OC::$server->getURLGenerator()->linkTo('', 'index.php');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'opener-position' => $this->config->getAppValue('opener-position', 'before'),
|
'opener-position' => $this->config->getAppValue('opener-position', 'before'),
|
||||||
'opener-hover' => $this->config->getAppValueBool('opener-hover', '0'),
|
'opener-hover' => $this->config->getAppValueBool('opener-hover', '0'),
|
||||||
@@ -123,10 +153,13 @@ class JsController extends Controller
|
|||||||
'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'),
|
'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'),
|
||||||
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
|
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
|
||||||
'big-menu' => $this->config->getAppValueBool('big-menu', '0'),
|
'big-menu' => $this->config->getAppValueBool('big-menu', '0'),
|
||||||
|
'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'),
|
||||||
'avatar' => $avatar,
|
'avatar' => $avatar,
|
||||||
'top-menu-apps' => $topMenuApps,
|
'top-menu-apps' => $topMenuApps,
|
||||||
'target-blank-apps' => $targetBlankApps,
|
'target-blank-apps' => $targetBlankApps,
|
||||||
|
'settings' => $settings,
|
||||||
'logo' => $this->themingDefaults->getLogo(),
|
'logo' => $this->themingDefaults->getLogo(),
|
||||||
|
'logo-link' => $addLogoLink ? $indexUrl : null,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,13 +21,11 @@ namespace OCA\SideMenu\Controller;
|
|||||||
use OC;
|
use OC;
|
||||||
use OC\App\AppStore\Fetcher\CategoryFetcher;
|
use OC\App\AppStore\Fetcher\CategoryFetcher;
|
||||||
use OC\URLGenerator;
|
use OC\URLGenerator;
|
||||||
use OCA\SideMenu\AppInfo\Application;
|
|
||||||
use OCA\SideMenu\Service\AppRepository;
|
use OCA\SideMenu\Service\AppRepository;
|
||||||
|
use OCA\SideMenu\Service\CategoryRepository;
|
||||||
use OCA\SideMenu\Service\ConfigProxy;
|
use OCA\SideMenu\Service\ConfigProxy;
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\Controller;
|
||||||
use OCP\AppFramework\Http\JSONResponse;
|
use OCP\AppFramework\Http\JSONResponse;
|
||||||
use OCP\IConfig;
|
|
||||||
use OCP\IL10N;
|
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use OCP\L10N\IFactory;
|
use OCP\L10N\IFactory;
|
||||||
@@ -39,11 +37,6 @@ class NavController extends Controller
|
|||||||
*/
|
*/
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var IConfig
|
|
||||||
*/
|
|
||||||
protected $iConfig;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var AppRepository
|
* @var AppRepository
|
||||||
*/
|
*/
|
||||||
@@ -67,20 +60,17 @@ class NavController extends Controller
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
string $appName,
|
string $appName,
|
||||||
IRequest $request,
|
IRequest $request,
|
||||||
IConfig $iConfig,
|
|
||||||
ConfigProxy $config,
|
ConfigProxy $config,
|
||||||
AppRepository $appRepository,
|
AppRepository $appRepository,
|
||||||
CategoryFetcher $categoryFetcher,
|
CategoryRepository $categoryRepository,
|
||||||
URLGenerator $router,
|
URLGenerator $router,
|
||||||
IL10N $trans,
|
IFactory $l10nFactory
|
||||||
IFactory $l10nFactory)
|
) {
|
||||||
{
|
|
||||||
parent::__construct($appName, $request);
|
parent::__construct($appName, $request);
|
||||||
|
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->iConfig = $iConfig;
|
|
||||||
$this->appRepository = $appRepository;
|
$this->appRepository = $appRepository;
|
||||||
$this->categoryFetcher = $categoryFetcher;
|
$this->categoryRepository = $categoryRepository;
|
||||||
$this->l10nFactory = $l10nFactory;
|
$this->l10nFactory = $l10nFactory;
|
||||||
$this->router = $router;
|
$this->router = $router;
|
||||||
}
|
}
|
||||||
@@ -94,13 +84,7 @@ class NavController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function items()
|
public function items()
|
||||||
{
|
{
|
||||||
$apps = $this->appRepository->getVisibleApps();
|
|
||||||
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
|
|
||||||
$externalSitesInTopMenu = $this->config->getAppValueBool('external-sites-in-top-menu', '0');
|
|
||||||
$user = OC::$server[IUserSession::class]->getUser();
|
$user = OC::$server[IUserSession::class]->getUser();
|
||||||
$isForced = $this->config->getAppValueBool('force', '0');
|
|
||||||
$appsCategories = [];
|
|
||||||
$categoriesAppsCount = [];
|
|
||||||
$items = [];
|
$items = [];
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
@@ -109,39 +93,28 @@ class NavController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$categoriesLabels = $this->config->getAppValueArray('cache-categories', '[]');
|
$apps = $this->appRepository->getVisibleApps();
|
||||||
|
$categoriesLabels = $this->categoryRepository->getOrderedCategories();
|
||||||
if (empty($categoriesLabels)) {
|
$hiddenApps = $this->config->getAppValueArray('big-menu-hidden-apps', '[]');
|
||||||
$categoriesLabels = $this->categoryFetcher->get();
|
$isForced = $this->config->getAppValueBool('force', '0');
|
||||||
|
|
||||||
$this->iConfig->setAppValue(Application::APP_ID, 'cache-categories', json_encode($categoriesLabels));
|
|
||||||
}
|
|
||||||
|
|
||||||
$topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]');
|
$topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]');
|
||||||
$userTopMenuApps = $this->config->getUserValueArray($user, 'top-menu-apps', '[]');
|
$userTopMenuApps = $this->config->getUserValueArray($user, 'top-menu-apps', '[]');
|
||||||
|
$appsCategories = [];
|
||||||
|
$categoriesAppsCount = [];
|
||||||
|
|
||||||
if (!$isForced && !empty($userTopMenuApps)) {
|
if (!$isForced && !empty($userTopMenuApps)) {
|
||||||
$topMenuApps = $userTopMenuApps;
|
$topMenuApps = $userTopMenuApps;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($categoriesLabels as $k => $category) {
|
|
||||||
$categoriesLabels[$category['id']] = $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name'];
|
|
||||||
|
|
||||||
unset($categoriesLabels[$k]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$categoriesLabels['external_links'] = $this->l10nFactory->get('external')->t('External sites');
|
|
||||||
|
|
||||||
$items['other'] = [
|
|
||||||
'name' => '',
|
|
||||||
'apps' => [],
|
|
||||||
];
|
|
||||||
|
|
||||||
foreach ($apps as $app) {
|
foreach ($apps as $app) {
|
||||||
if (in_array($app['id'], $topMenuApps)) {
|
if (in_array($app['id'], $topMenuApps)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array($app['id'], $hiddenApps)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$categories = (array) $app['category'];
|
$categories = (array) $app['category'];
|
||||||
$appsCategories[$app['id']] = [];
|
$appsCategories[$app['id']] = [];
|
||||||
|
|
||||||
@@ -153,6 +126,7 @@ class NavController extends Controller
|
|||||||
if (!isset($items[$category])) {
|
if (!isset($items[$category])) {
|
||||||
$items[$category] = [
|
$items[$category] = [
|
||||||
'name' => $categoriesLabels[$category] ?? $category,
|
'name' => $categoriesLabels[$category] ?? $category,
|
||||||
|
'categoryId' => $category,
|
||||||
'apps' => [],
|
'apps' => [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -211,8 +185,17 @@ class NavController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
usort($items, function ($a, $b) {
|
usort($items, function ($a, $b) use ($categoriesLabels) {
|
||||||
return ($a['name'] < $b['name']) ? -1 : 1;
|
foreach ($categoriesLabels as $key => $value) {
|
||||||
|
if ($a['categoryId'] === $key) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if ($b['categoryId'] === $key) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
return new JSONResponse([
|
return new JSONResponse([
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
|
|
||||||
namespace OCA\SideMenu\Controller;
|
namespace OCA\SideMenu\Controller;
|
||||||
|
|
||||||
|
use OCA\SideMenu\AppInfo\Application;
|
||||||
|
use OCA\SideMenu\Service\ConfigProxy;
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\Controller;
|
||||||
use OCP\AppFramework\Http\Response;
|
use OCP\AppFramework\Http\Response;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use OCA\SideMenu\AppInfo\Application;
|
|
||||||
use OCA\SideMenu\Service\ConfigProxy;
|
|
||||||
|
|
||||||
class PersonalSettingController extends Controller
|
class PersonalSettingController extends Controller
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace OCA\SideMenu\Service;
|
namespace OCA\SideMenu\Service;
|
||||||
|
|
||||||
use OC_App;
|
|
||||||
use OCP\L10N\IFactory;
|
use OCP\L10N\IFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,7 +12,7 @@ use OCP\L10N\IFactory;
|
|||||||
class AppRepository
|
class AppRepository
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var OC_App
|
* @var \OC_App
|
||||||
*/
|
*/
|
||||||
protected $ocApp;
|
protected $ocApp;
|
||||||
|
|
||||||
@@ -22,7 +21,7 @@ class AppRepository
|
|||||||
*/
|
*/
|
||||||
protected $l10nFactory;
|
protected $l10nFactory;
|
||||||
|
|
||||||
public function __construct(OC_App $ocApp, IFactory $l10nFactory)
|
public function __construct(\OC_App $ocApp, IFactory $l10nFactory)
|
||||||
{
|
{
|
||||||
$this->ocApp = $ocApp;
|
$this->ocApp = $ocApp;
|
||||||
$this->l10nFactory = $l10nFactory;
|
$this->l10nFactory = $l10nFactory;
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace OCA\SideMenu\Service;
|
||||||
|
|
||||||
|
use OC\App\AppStore\Fetcher\CategoryFetcher;
|
||||||
|
use OCA\SideMenu\AppInfo\Application;
|
||||||
|
use OCP\IConfig;
|
||||||
|
use OCP\L10N\IFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class CategoryRepository.
|
||||||
|
*
|
||||||
|
* @author Simon Vieille <simon@deblan.fr>
|
||||||
|
*/
|
||||||
|
class CategoryRepository
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var CategoryFetcher
|
||||||
|
*/
|
||||||
|
protected $categoryFetcher;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var IFactory
|
||||||
|
*/
|
||||||
|
protected $l10nFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var ConfigProxy
|
||||||
|
*/
|
||||||
|
protected $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var IConfig
|
||||||
|
*/
|
||||||
|
protected $iConfig;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
CategoryFetcher $categoryFetcher,
|
||||||
|
ConfigProxy $config,
|
||||||
|
IConfig $iConfig,
|
||||||
|
IFactory $l10nFactory
|
||||||
|
) {
|
||||||
|
$this->categoryFetcher = $categoryFetcher;
|
||||||
|
$this->l10nFactory = $l10nFactory;
|
||||||
|
$this->config = $config;
|
||||||
|
$this->iConfig = $iConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves categories.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getOrderedCategories()
|
||||||
|
{
|
||||||
|
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
|
||||||
|
$type = $this->config->getAppValue('categories-order-type', 'default');
|
||||||
|
$order = $this->config->getAppValueArray('categories-order', '[]');
|
||||||
|
|
||||||
|
$categoriesLabels = $this->config->getAppValueArray('cache-categories', '[]');
|
||||||
|
|
||||||
|
if (empty($categoriesLabels)) {
|
||||||
|
$categoriesLabels = $this->categoryFetcher->get();
|
||||||
|
|
||||||
|
$this->iConfig->setAppValue(Application::APP_ID, 'cache-categories', json_encode($categoriesLabels));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($categoriesLabels as $k => $category) {
|
||||||
|
$categoriesLabels[$category['id']] = $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name'];
|
||||||
|
|
||||||
|
unset($categoriesLabels[$k]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$categoriesLabels['external_links'] = $this->l10nFactory->get('external')->t('External sites');
|
||||||
|
$categoriesLabels['other'] = '';
|
||||||
|
|
||||||
|
asort($categoriesLabels);
|
||||||
|
|
||||||
|
if ('custom' === $type) {
|
||||||
|
$ordered = [];
|
||||||
|
|
||||||
|
foreach ($order as $id) {
|
||||||
|
if (isset($categoriesLabels[$id])) {
|
||||||
|
$ordered[$id] = $categoriesLabels[$id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($categoriesLabels as $id => $value) {
|
||||||
|
if (!isset($ordered[$id])) {
|
||||||
|
$ordered[$id] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$categoriesLabels = $ordered;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $categoriesLabels;
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
-16
@@ -23,43 +23,47 @@ class ConfigProxy
|
|||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAppValue(string $name, string $default): string
|
public function getAppValue(string $name, string $default, $appId = null): string
|
||||||
{
|
{
|
||||||
return (string) $this->config->getAppValue(Application::APP_ID, $name, $default);
|
return (string) $this->config->getAppValue($appId ?? Application::APP_ID, $name, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserValue(User $user, string $name, string $default): string
|
public function getUserValue(User $user, string $name, string $default, $appId = null): string
|
||||||
{
|
{
|
||||||
return (string) $this->config->getUserValue($user->getUid(), Application::APP_ID, $name, $default);
|
return (string) $this->config->getUserValue($user->getUid(), $appId ?? Application::APP_ID, $name, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAppValueBool(string $name, string $default): bool
|
public function getAppValueBool(string $name, string $default, $appId = null): bool
|
||||||
{
|
{
|
||||||
return (bool) $this->getAppValue($name, $default);
|
return (bool) $this->getAppValue($name, $default, $appId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAppValueArray(string $name, string $default): array
|
public function getAppValueArray(string $name, string $default, $appId = null): array
|
||||||
{
|
{
|
||||||
return (array) json_decode($this->getAppValue($name, $default), true);
|
return (array) json_decode($this->getAppValue($name, $default, $appId), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAppValueInt(string $name, string $default): int
|
public function getAppValueInt(string $name, string $default, $appId = null): int
|
||||||
{
|
{
|
||||||
return (int) $this->getAppValue($name, $default);
|
return (int) $this->getAppValue($name, $default, $appId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserValueBool(User $user, string $name, string $default): bool
|
public function getUserValueBool(User $user, string $name, string $default, $appId = null): bool
|
||||||
{
|
{
|
||||||
return (bool) $this->getUserValue($user, $name, $default);
|
return (bool) str_replace(
|
||||||
|
['yes', 'no'],
|
||||||
|
['1', '0'],
|
||||||
|
$this->getUserValue($user, $name, $default, $appId)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserValueArray(User $user, string $name, string $default): array
|
public function getUserValueArray(User $user, string $name, string $default, $appId = null): array
|
||||||
{
|
{
|
||||||
return (array) json_decode($this->getUserValue($user, $name, $default), true);
|
return (array) json_decode($this->getUserValue($user, $name, $default, $appId), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserValueInt(User $user, string $name, string $default): int
|
public function getUserValueInt(User $user, string $name, string $default, $appId = null): int
|
||||||
{
|
{
|
||||||
return (int) $this->getUserValue($user, $name, $default);
|
return (int) $this->getUserValue($user, $name, $default, $appId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+34
-4
@@ -20,6 +20,7 @@ namespace OCA\SideMenu\Settings;
|
|||||||
|
|
||||||
use OCA\SideMenu\AppInfo\Application;
|
use OCA\SideMenu\AppInfo\Application;
|
||||||
use OCA\SideMenu\Service\AppRepository;
|
use OCA\SideMenu\Service\AppRepository;
|
||||||
|
use OCA\SideMenu\Service\CategoryRepository;
|
||||||
use OCA\SideMenu\Service\ConfigProxy;
|
use OCA\SideMenu\Service\ConfigProxy;
|
||||||
use OCP\AppFramework\Http\TemplateResponse;
|
use OCP\AppFramework\Http\TemplateResponse;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
@@ -48,12 +49,23 @@ class Admin implements ISettings
|
|||||||
*/
|
*/
|
||||||
private $appRepository;
|
private $appRepository;
|
||||||
|
|
||||||
public function __construct(IL10N $l, ILogger $logger, ConfigProxy $config, AppRepository $appRepository)
|
/**
|
||||||
{
|
* @var CategoryRepository
|
||||||
|
*/
|
||||||
|
private $categoryRepository;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
IL10N $l,
|
||||||
|
ILogger $logger,
|
||||||
|
ConfigProxy $config,
|
||||||
|
AppRepository $appRepository,
|
||||||
|
CategoryRepository $categoryRepository
|
||||||
|
) {
|
||||||
$this->l = $l;
|
$this->l = $l;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->appRepository = $appRepository;
|
$this->appRepository = $appRepository;
|
||||||
|
$this->categoryRepository = $categoryRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,6 +76,9 @@ class Admin implements ISettings
|
|||||||
$backgroundColor = $this->config->getAppValue('background-color', '#333333');
|
$backgroundColor = $this->config->getAppValue('background-color', '#333333');
|
||||||
$backgroundColorTo = $this->config->getAppValue('background-color-to', $backgroundColor);
|
$backgroundColorTo = $this->config->getAppValue('background-color-to', $backgroundColor);
|
||||||
|
|
||||||
|
$darkModeBackgroundColor = $this->config->getAppValue('dark-mode-background-color', '#333333');
|
||||||
|
$darkModeBackgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $darkModeBackgroundColor);
|
||||||
|
|
||||||
$parameters = [
|
$parameters = [
|
||||||
'background-color' => $backgroundColor,
|
'background-color' => $backgroundColor,
|
||||||
'background-color-to' => $backgroundColorTo,
|
'background-color-to' => $backgroundColorTo,
|
||||||
@@ -71,24 +86,39 @@ class Admin implements ISettings
|
|||||||
'loader-color' => $this->config->getAppValue('loader-color', '#0e75ac'),
|
'loader-color' => $this->config->getAppValue('loader-color', '#0e75ac'),
|
||||||
'icon-invert-filter' => $this->config->getAppValueInt('icon-invert-filter', '0'),
|
'icon-invert-filter' => $this->config->getAppValueInt('icon-invert-filter', '0'),
|
||||||
'icon-opacity' => $this->config->getAppValueInt('icon-opacity', '100'),
|
'icon-opacity' => $this->config->getAppValueInt('icon-opacity', '100'),
|
||||||
'loader-enabled' => $this->config->getAppValue('loader-enabled', '1'),
|
|
||||||
'text-color' => $this->config->getAppValue('text-color', '#FFFFFF'),
|
'text-color' => $this->config->getAppValue('text-color', '#FFFFFF'),
|
||||||
'cache' => $this->config->getAppValue('cache', '0'),
|
'dark-mode-background-color' => $darkModeBackgroundColor,
|
||||||
|
'dark-mode-background-color-to' => $darkModeBackgroundColorTo,
|
||||||
|
'dark-mode-current-app-background-color' => $this->config->getAppValue('dark-mode-current-app-background-color', '#444444'),
|
||||||
|
'dark-mode-loader-color' => $this->config->getAppValue('dark-mode-loader-color', '#cccccc'),
|
||||||
|
'dark-mode-icon-invert-filter' => $this->config->getAppValueInt('dark-mode-icon-invert-filter', '0'),
|
||||||
|
'dark-mode-icon-opacity' => $this->config->getAppValueInt('dark-mode-icon-opacity', '100'),
|
||||||
|
'dark-mode-text-color' => $this->config->getAppValue('dark-mode-text-color', '#FFFFFF'),
|
||||||
|
'dark-mode-opener' => $this->config->getAppValue('dark-mode-opener', 'side-menu-opener'),
|
||||||
'opener' => $this->config->getAppValue('opener', 'side-menu-opener'),
|
'opener' => $this->config->getAppValue('opener', 'side-menu-opener'),
|
||||||
|
'loader-enabled' => $this->config->getAppValue('loader-enabled', '1'),
|
||||||
|
'cache' => $this->config->getAppValue('cache', '0'),
|
||||||
'always-displayed' => $this->config->getAppValue('always-displayed', '0'),
|
'always-displayed' => $this->config->getAppValue('always-displayed', '0'),
|
||||||
'big-menu' => $this->config->getAppValue('big-menu', '0'),
|
'big-menu' => $this->config->getAppValue('big-menu', '0'),
|
||||||
|
'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'),
|
||||||
'display-logo' => $this->config->getAppValue('display-logo', '1'),
|
'display-logo' => $this->config->getAppValue('display-logo', '1'),
|
||||||
|
'add-logo-link' => $this->config->getAppValue('add-logo-link', '1'),
|
||||||
'use-avatar' => $this->config->getAppValue('use-avatar', '0'),
|
'use-avatar' => $this->config->getAppValue('use-avatar', '0'),
|
||||||
'opener-position' => $this->config->getAppValue('opener-position', 'before'),
|
'opener-position' => $this->config->getAppValue('opener-position', 'before'),
|
||||||
'opener-hover' => $this->config->getAppValue('opener-hover', '0'),
|
'opener-hover' => $this->config->getAppValue('opener-hover', '0'),
|
||||||
'opener-only' => $this->config->getAppValue('opener-only', '0'),
|
'opener-only' => $this->config->getAppValue('opener-only', '0'),
|
||||||
|
'show-settings' => $this->config->getAppValue('show-settings', '0'),
|
||||||
'hide-when-no-apps' => $this->config->getAppValue('hide-when-no-apps', '0'),
|
'hide-when-no-apps' => $this->config->getAppValue('hide-when-no-apps', '0'),
|
||||||
'size-icon' => $this->config->getAppValue('size-icon', 'normal'),
|
'size-icon' => $this->config->getAppValue('size-icon', 'normal'),
|
||||||
'size-text' => $this->config->getAppValue('size-text', 'normal'),
|
'size-text' => $this->config->getAppValue('size-text', 'normal'),
|
||||||
'force' => $this->config->getAppValue('force', '0'),
|
'force' => $this->config->getAppValue('force', '0'),
|
||||||
'target-blank-apps' => $this->config->getAppValueArray('target-blank-apps', '[]'),
|
'target-blank-apps' => $this->config->getAppValueArray('target-blank-apps', '[]'),
|
||||||
'top-menu-apps' => $this->config->getAppValueArray('top-menu-apps', '[]'),
|
'top-menu-apps' => $this->config->getAppValueArray('top-menu-apps', '[]'),
|
||||||
|
'default-enabled' => $this->config->getAppValue('default-enabled', '1'),
|
||||||
|
'categories-order-type' => $this->config->getAppValue('categories-order-type', 'default'),
|
||||||
|
'categories-order' => $this->config->getAppValueArray('categories-order', '[]'),
|
||||||
'apps' => $this->appRepository->getVisibleApps(),
|
'apps' => $this->appRepository->getVisibleApps(),
|
||||||
|
'categories' => $this->categoryRepository->getOrderedCategories(),
|
||||||
];
|
];
|
||||||
|
|
||||||
return new TemplateResponse(Application::APP_ID, 'settings/admin-form', $parameters, '');
|
return new TemplateResponse(Application::APP_ID, 'settings/admin-form', $parameters, '');
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
namespace OCA\SideMenu\Settings;
|
namespace OCA\SideMenu\Settings;
|
||||||
|
|
||||||
|
use OCA\SideMenu\AppInfo\Application;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
use OCP\IURLGenerator;
|
use OCP\IURLGenerator;
|
||||||
use OCP\Settings\IIconSection;
|
use OCP\Settings\IIconSection;
|
||||||
use OCA\SideMenu\AppInfo\Application;
|
|
||||||
|
|
||||||
class AdminSection implements IIconSection
|
class AdminSection implements IIconSection
|
||||||
{
|
{
|
||||||
@@ -35,10 +35,6 @@ class AdminSection implements IIconSection
|
|||||||
*/
|
*/
|
||||||
private $url;
|
private $url;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param IURLGenerator $url
|
|
||||||
* @param IL10N $l
|
|
||||||
*/
|
|
||||||
public function __construct(IURLGenerator $url, IL10N $l)
|
public function __construct(IURLGenerator $url, IL10N $l)
|
||||||
{
|
{
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
@@ -47,7 +43,7 @@ class AdminSection implements IIconSection
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the ID of the section. It is supposed to be a lower case string,
|
* returns the ID of the section. It is supposed to be a lower case string,
|
||||||
* e.g. 'ldap'
|
* e.g. 'ldap'.
|
||||||
*
|
*
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
@@ -69,8 +65,8 @@ class AdminSection implements IIconSection
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int whether the form should be rather on the top or bottom of
|
* @return int whether the form should be rather on the top or bottom of
|
||||||
* the settings navigation. The sections are arranged in ascending order of
|
* the settings navigation. The sections are arranged in ascending order of
|
||||||
* the priority values. It is required to return a value between 0 and 99.
|
* the priority values. It is required to return a value between 0 and 99.
|
||||||
*
|
*
|
||||||
* E.g.: 70
|
* E.g.: 70
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -72,7 +72,11 @@ class Personal implements ISettings
|
|||||||
|
|
||||||
$parameters = [
|
$parameters = [
|
||||||
'force' => $this->config->getAppValueBool('force', '0'),
|
'force' => $this->config->getAppValueBool('force', '0'),
|
||||||
'enabled' => $this->config->getUserValue($user, 'enabled', '1'),
|
'enabled' => $this->config->getUserValue(
|
||||||
|
$user,
|
||||||
|
'enabled',
|
||||||
|
$this->config->getAppValue('default-enabled', '1')
|
||||||
|
),
|
||||||
'top-menu-apps' => $this->config->getUserValueArray($user, 'top-menu-apps', '[]'),
|
'top-menu-apps' => $this->config->getUserValueArray($user, 'top-menu-apps', '[]'),
|
||||||
'target-blank-mode' => $this->config->getUserValue($user, 'target-blank-mode', '1'),
|
'target-blank-mode' => $this->config->getUserValue($user, 'target-blank-mode', '1'),
|
||||||
'target-blank-apps' => $this->config->getUserValueArray($user, 'target-blank-apps', '[]'),
|
'target-blank-apps' => $this->config->getUserValueArray($user, 'target-blank-apps', '[]'),
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
namespace OCA\SideMenu\Settings;
|
namespace OCA\SideMenu\Settings;
|
||||||
|
|
||||||
|
use OCA\SideMenu\AppInfo\Application;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
use OCP\IURLGenerator;
|
use OCP\IURLGenerator;
|
||||||
use OCP\Settings\IIconSection;
|
use OCP\Settings\IIconSection;
|
||||||
use OCA\SideMenu\AppInfo\Application;
|
|
||||||
|
|
||||||
class PersonalSection implements IIconSection
|
class PersonalSection implements IIconSection
|
||||||
{
|
{
|
||||||
@@ -35,10 +35,6 @@ class PersonalSection implements IIconSection
|
|||||||
*/
|
*/
|
||||||
private $url;
|
private $url;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param IURLGenerator $url
|
|
||||||
* @param IL10N $l
|
|
||||||
*/
|
|
||||||
public function __construct(IURLGenerator $url, IL10N $l)
|
public function __construct(IURLGenerator $url, IL10N $l)
|
||||||
{
|
{
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
@@ -47,7 +43,7 @@ class PersonalSection implements IIconSection
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the ID of the section. It is supposed to be a lower case string,
|
* returns the ID of the section. It is supposed to be a lower case string,
|
||||||
* e.g. 'ldap'
|
* e.g. 'ldap'.
|
||||||
*
|
*
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
@@ -69,8 +65,8 @@ class PersonalSection implements IIconSection
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int whether the form should be rather on the top or bottom of
|
* @return int whether the form should be rather on the top or bottom of
|
||||||
* the settings navigation. The sections are arranged in ascending order of
|
* the settings navigation. The sections are arranged in ascending order of
|
||||||
* the priority values. It is required to return a value between 0 and 99.
|
* the priority values. It is required to return a value between 0 and 99.
|
||||||
*
|
*
|
||||||
* E.g.: 70
|
* E.g.: 70
|
||||||
*/
|
*/
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 195 KiB |
@@ -0,0 +1,25 @@
|
|||||||
|
<!--
|
||||||
|
@license GNU AGPL version 3 or any later version
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<button class="side-menu-opener side-menu-closer"></button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'CloserButton',
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<!--
|
||||||
|
@license GNU AGPL version 3 or any later version
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="side-menu-loader">
|
||||||
|
<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g fill="none" fill-rule="evenodd">
|
||||||
|
<g transform="translate(1 1)" stroke-width="2">
|
||||||
|
<circle stroke-opacity=".5" cx="18" cy="18" r="18"/>
|
||||||
|
<path d="M36 18c0-9.94-8.06-18-18-18">
|
||||||
|
<animateTransform
|
||||||
|
attributeName="transform"
|
||||||
|
type="rotate"
|
||||||
|
from="0 18 18"
|
||||||
|
to="360 18 18"
|
||||||
|
dur="1s"
|
||||||
|
repeatCount="indefinite"/>
|
||||||
|
</path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Loader',
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<!--
|
||||||
|
@license GNU AGPL version 3 or any later version
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div v-bind:class="classes">
|
||||||
|
<a v-if="link !== null" v-bind:href="link">
|
||||||
|
<img v-bind:src="image">
|
||||||
|
</a>
|
||||||
|
<img v-else v-bind:src="image">
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Logo',
|
||||||
|
props: {
|
||||||
|
image: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
link: {
|
||||||
|
type: String,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
classes: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<!--
|
||||||
|
@license GNU AGPL version 3 or any later version
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<button class="side-menu-opener"></button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'OpenerButton',
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<!--
|
||||||
|
@license GNU AGPL version 3 or any later version
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="side-menu-settings">
|
||||||
|
<a v-bind:href="href">
|
||||||
|
{{ label }}
|
||||||
|
|
||||||
|
<span class="avatardiv avatardiv-shown">
|
||||||
|
<img v-bind:src="avatar" v-bind:alt="name" v-bind:title="name">
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'SettingsButton',
|
||||||
|
props: {
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
href: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
avatar: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
+40
-13
@@ -17,23 +17,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<template>
|
<template>
|
||||||
<div id="side-menu">
|
<div id="side-menu">
|
||||||
<div class="side-menu-header">
|
<div class="side-menu-header">
|
||||||
<button class="side-menu-opener"></button>
|
<SettingsButton
|
||||||
|
v-if="settings"
|
||||||
|
v-bind:href="settings.href"
|
||||||
|
v-bind:label="settings.name"
|
||||||
|
v-bind:avatar="settings.avatar" />
|
||||||
|
|
||||||
<div v-if="!avatar && logo" v-bind:class="{'side-menu-logo': true, 'avatardiv': false}">
|
<OpenerButton />
|
||||||
<img v-bind:src="logo">
|
|
||||||
</div>
|
<Logo
|
||||||
<div v-if="avatar" v-bind:class="{'side-menu-logo': true, 'avatardiv': true}">
|
v-if="!avatar && logo" v-bind:classes="{'side-menu-logo': true, 'avatardiv': false}"
|
||||||
<img v-bind:src="avatar">
|
v-bind:image="logo"
|
||||||
</div>
|
v-bind:link="logoLink"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Logo
|
||||||
|
v-if="avatar" v-bind:classes="{'side-menu-logo': true, 'avatardiv': true}"
|
||||||
|
v-bind:image="avatar"
|
||||||
|
v-bind:link="logoLink"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="side-menu-apps-list">
|
<ul class="side-menu-apps-list">
|
||||||
<li v-for="app in apps" v-bind:class="{'side-menu-app': true, 'active': app.active}">
|
<SideMenuApp
|
||||||
<a v-bind:href="app.href" :target="targetBlankApps.indexOf(app.id) !== -1 ? '_blank' : undefined" v-bind:title="app.name">
|
v-for="app in apps"
|
||||||
<span class="side-menu-app-icon" v-html="app.icon"></span>
|
v-bind:classes="{'side-menu-app': true, 'active': app.active}"
|
||||||
<span class="side-menu-app-text" v-html="app.name"></span>
|
v-bind:icon="app.icon"
|
||||||
</a>
|
v-bind:label="app.name"
|
||||||
</li>
|
v-bind:href="app.href"
|
||||||
|
v-bind:target="targetBlankApps.indexOf(app.id) !== -1 ? '_blank' : undefined"
|
||||||
|
/>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -41,16 +54,28 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<script>
|
<script>
|
||||||
import trim from 'trim'
|
import trim from 'trim'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import OpenerButton from './OpenerButton'
|
||||||
|
import SettingsButton from './SettingsButton'
|
||||||
|
import SideMenuApp from './SideMenuApp'
|
||||||
|
import Logo from './Logo'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SideMenu',
|
name: 'SideMenu',
|
||||||
|
components: {
|
||||||
|
SettingsButton,
|
||||||
|
OpenerButton,
|
||||||
|
SideMenuApp,
|
||||||
|
Logo,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
apps: [],
|
apps: [],
|
||||||
logo: null,
|
logo: null,
|
||||||
|
logoLink: null,
|
||||||
avatar: null,
|
avatar: null,
|
||||||
forceLightIcon: false,
|
forceLightIcon: false,
|
||||||
targetBlankApps: [],
|
targetBlankApps: [],
|
||||||
|
settings: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -120,6 +145,8 @@ export default {
|
|||||||
that.forceLightIcon = config['force-light-icon']
|
that.forceLightIcon = config['force-light-icon']
|
||||||
that.avatar = config['avatar']
|
that.avatar = config['avatar']
|
||||||
that.logo = config['logo']
|
that.logo = config['logo']
|
||||||
|
that.logoLink = config['logo-link']
|
||||||
|
that.settings = config['settings']
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<!--
|
||||||
|
@license GNU AGPL version 3 or any later version
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<li v-bind:class="classes">
|
||||||
|
<a v-bind:href="href" :target="target" v-bind:title="label">
|
||||||
|
<span class="side-menu-app-icon" v-html="icon"></span>
|
||||||
|
<span class="side-menu-app-text" v-html="label"></span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'SideMenuApp',
|
||||||
|
props: {
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
href: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
classes: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
target: {
|
||||||
|
type: String,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
+33
-26
@@ -17,41 +17,34 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<template>
|
<template>
|
||||||
<div id="side-menu" class="side-menu-big">
|
<div id="side-menu" class="side-menu-big">
|
||||||
<div class="side-menu-header">
|
<div class="side-menu-header">
|
||||||
<button class="side-menu-opener side-menu-closer"></button>
|
<CloserButton />
|
||||||
<button class="side-menu-opener"></button>
|
|
||||||
|
<SettingsButton
|
||||||
|
v-if="settings"
|
||||||
|
v-bind:href="settings.href"
|
||||||
|
v-bind:label="settings.name"
|
||||||
|
v-bind:avatar="settings.avatar"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<OpenerButton />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="side-menu-categories-wrapper">
|
<div class="side-menu-categories-wrapper">
|
||||||
<div class="side-menu-categories">
|
<div class="side-menu-categories">
|
||||||
<div v-if="!items.length" class="side-menu-loader">
|
<Loader v-if="!items.length" />
|
||||||
<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<g fill="none" fill-rule="evenodd">
|
|
||||||
<g transform="translate(1 1)" stroke-width="2">
|
|
||||||
<circle stroke-opacity=".5" cx="18" cy="18" r="18"/>
|
|
||||||
<path d="M36 18c0-9.94-8.06-18-18-18">
|
|
||||||
<animateTransform
|
|
||||||
attributeName="transform"
|
|
||||||
type="rotate"
|
|
||||||
from="0 18 18"
|
|
||||||
to="360 18 18"
|
|
||||||
dur="1s"
|
|
||||||
repeatCount="indefinite"/>
|
|
||||||
</path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="side-menu-category" v-for="category in items">
|
<div class="side-menu-category" v-for="category in items">
|
||||||
<h2 class="side-menu-category-title" v-if="category.name != ''" v-html="category.name"></h2>
|
<h2 class="side-menu-category-title" v-if="category.name != ''" v-html="category.name"></h2>
|
||||||
|
|
||||||
<ul class="side-menu-apps-list">
|
<ul class="side-menu-apps-list">
|
||||||
<li v-bind:class="{'side-menu-app': true, 'active': activeApp === appId}" v-for="(app, appId) in category.apps">
|
<SideMenuBigApp
|
||||||
<a v-bind:href="app.href" :target="targetBlankApps.indexOf(appId) !== -1 ? '_blank' : undefined" v-bind:title="app.name">
|
v-for="(app, appId) in category.apps"
|
||||||
<img class="side-menu-app-icon" v-bind:src="app.icon"></span>
|
v-bind:classes="{'side-menu-app': true, 'active': activeApp === appId}"
|
||||||
<span class="side-menu-app-text" v-html="app.name"></span>
|
v-bind:icon="app.icon"
|
||||||
</a>
|
v-bind:label="app.name"
|
||||||
</li>
|
v-bind:href="app.href"
|
||||||
|
v-bind:target="targetBlankApps.indexOf(appId) !== -1 ? '_blank' : undefined"
|
||||||
|
/>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -62,15 +55,28 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<script>
|
<script>
|
||||||
import trim from 'trim'
|
import trim from 'trim'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import OpenerButton from './OpenerButton'
|
||||||
|
import CloserButton from './CloserButton'
|
||||||
|
import SettingsButton from './SettingsButton'
|
||||||
|
import Loader from './Loader'
|
||||||
|
import SideMenuBigApp from './SideMenuBigApp'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SideMenuBig',
|
name: 'SideMenuBig',
|
||||||
|
components: {
|
||||||
|
SettingsButton,
|
||||||
|
OpenerButton,
|
||||||
|
CloserButton,
|
||||||
|
Loader,
|
||||||
|
SideMenuBigApp,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
items: [],
|
items: [],
|
||||||
activeApp: null,
|
activeApp: null,
|
||||||
targetBlank: false,
|
targetBlank: false,
|
||||||
targetBlankApps: [],
|
targetBlankApps: [],
|
||||||
|
settings: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -109,6 +115,7 @@ export default {
|
|||||||
const config = response.data
|
const config = response.data
|
||||||
|
|
||||||
that.targetBlankApps = config['target-blank-apps']
|
that.targetBlankApps = config['target-blank-apps']
|
||||||
|
that.settings = config['settings']
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<!--
|
||||||
|
@license GNU AGPL version 3 or any later version
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation, either version 3 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<li v-bind:class="classes">
|
||||||
|
<a v-bind:href="href" :target="target" v-bind:title="label">
|
||||||
|
<img class="side-menu-app-icon" v-bind:src="icon"></span>
|
||||||
|
<span class="side-menu-app-text" v-html="label"></span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'SideMenuBigApp',
|
||||||
|
props: {
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
href: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
classes: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
target: {
|
||||||
|
type: String,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -129,4 +129,20 @@ jQuery(document).ready(() => {
|
|||||||
|
|
||||||
elementToggler(element)
|
elementToggler(element)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
jQuery("#categories-list .side-menu-setting-list").sortable({
|
||||||
|
forcePlaceholderSize: true,
|
||||||
|
placeholder: 'placeholder',
|
||||||
|
stop: function (event, ui) {
|
||||||
|
let value = []
|
||||||
|
|
||||||
|
jQuery('#categories-list .side-menu-setting-list-item').each(function() {
|
||||||
|
value.push(jQuery(this).attr('data-id'))
|
||||||
|
});
|
||||||
|
|
||||||
|
value = JSON.stringify(value)
|
||||||
|
|
||||||
|
jQuery('input[name="categories-order"]').val(value)
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -59,3 +59,19 @@
|
|||||||
"Use the avatar instead of the logo": "Verwenden Sie den Avatar anstelle des Logos"
|
"Use the avatar instead of the logo": "Verwenden Sie den Avatar anstelle des Logos"
|
||||||
"You do not have permission to change the settings.": "Sie haben keine Berechtigung zum Ändern der Einstellungen."
|
"You do not have permission to change the settings.": "Sie haben keine Berechtigung zum Ändern der Einstellungen."
|
||||||
"Force this configuration to users": "Erzwingen Sie diese Konfiguration für Benutzer"
|
"Force this configuration to users": "Erzwingen Sie diese Konfiguration für Benutzer"
|
||||||
|
"Export the configuration": "Exportieren Sie die Konfiguration"
|
||||||
|
"Purge the cache": "Leeren Sie den Cache"
|
||||||
|
"Show the link to settings": "Zeigen Sie den Link zu den Einstellungen an"
|
||||||
|
"The menu is enabled by default for users": "Das Menü ist standardmäßig für Benutzer aktiviert"
|
||||||
|
"Except when the configuration is forced.": "Außer wenn die Konfiguration erzwungen wird."
|
||||||
|
"Apps that should not be displayed in the menu": "Apps, die nicht im Menü angezeigt werden sollen"
|
||||||
|
"This feature is only compatible with the <code>big menu</code> display.": "Kompatibel mit der Anzeige <code> Großes Menü </ code>."
|
||||||
|
"The logo is a link to the default app": "Das Logo ist ein Link zur Standard-App"
|
||||||
|
"Others": "Andere"
|
||||||
|
"Categories": "Kategorien"
|
||||||
|
"Customize sorting": "Sortierung anpassen"
|
||||||
|
"Order by": "Sortieren nach"
|
||||||
|
"Name": "Name"
|
||||||
|
"Customed": "Kundenspezifisch"
|
||||||
|
"Show and hide the list of categories": "Liste der Kategorien ein- und ausblenden"
|
||||||
|
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Diese Parameter werden verwendet, wenn Dark Theme oder Breeze Dark Theme aktiviert sind."
|
||||||
|
|||||||
@@ -59,3 +59,19 @@
|
|||||||
"Use the avatar instead of the logo": "Utiliser l'avatar à la place du logo"
|
"Use the avatar instead of the logo": "Utiliser l'avatar à la place du logo"
|
||||||
"You do not have permission to change the settings.": "Vous n'avez pas la permission de changer les paramètres."
|
"You do not have permission to change the settings.": "Vous n'avez pas la permission de changer les paramètres."
|
||||||
"Force this configuration to users": "Forcer cette configuration aux utilisateurs"
|
"Force this configuration to users": "Forcer cette configuration aux utilisateurs"
|
||||||
|
"Export the configuration": "Exporter la configuration"
|
||||||
|
"Purge the cache": "Purger le cache"
|
||||||
|
"Show the link to settings": "Afficher le lien vers les paramètres"
|
||||||
|
"The menu is enabled by default for users": "Le menu est activé par défaut pour les utilisateurs"
|
||||||
|
"Except when the configuration is forced.": "Sauf lorsque la configuration est forcée."
|
||||||
|
"Apps that should not be displayed in the menu": "Applications qui ne doivent pas être affichées dans le menu"
|
||||||
|
"This feature is only compatible with the <code>big menu</code> display.": "Compatible avec l'affichage <code>Menu large</code>."
|
||||||
|
"The logo is a link to the default app": "Le logo est un lien vers l'application par défaut"
|
||||||
|
"Others": "Autres"
|
||||||
|
"Categories": "Catégories"
|
||||||
|
"Customize sorting": "Personnaliser le tri"
|
||||||
|
"Order by": "Trier par"
|
||||||
|
"Name": "Nom"
|
||||||
|
"Customed": "Personnalisé"
|
||||||
|
"Show and hide the list of categories": "Afficher et masquer la liste des catégories"
|
||||||
|
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Ces paramètres sont utilisés lorsque le thème sombre ou le thème Breeze Dark sont activés."
|
||||||
|
|||||||
@@ -34,10 +34,14 @@ var alwaysDisplayed = function() {
|
|||||||
|
|
||||||
for (var i in fixedElements) {
|
for (var i in fixedElements) {
|
||||||
var element = fixedElements[i]
|
var element = fixedElements[i]
|
||||||
var value = window.getComputedStyle(element, null).getPropertyValue('left')
|
var computedStyle = window.getComputedStyle(element, null)
|
||||||
var intValue = parseInt(value.replace('px', ''))
|
var left = computedStyle.getPropertyValue('left')
|
||||||
|
var right = computedStyle.getPropertyValue('right')
|
||||||
|
|
||||||
element.style.setProperty('transform', 'translateX(' + (intValue + 50) + 'px)')
|
if (right !== '0px') {
|
||||||
|
var intValue = parseInt(left.replace('px', ''))
|
||||||
|
element.style.setProperty('transform', 'translateX(' + (intValue + 50) + 'px)')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,14 +49,17 @@ let content = document.getElementById('content')
|
|||||||
|
|
||||||
if (content && content.classList.contains('app-settings')) {
|
if (content && content.classList.contains('app-settings')) {
|
||||||
let loaded = false
|
let loaded = false
|
||||||
const config = {attributes: false, childList: true, subtree: true}
|
const config = {
|
||||||
|
attributes: false,
|
||||||
|
childList: true,
|
||||||
|
subtree: true
|
||||||
|
}
|
||||||
const observer = new MutationObserver(() => {
|
const observer = new MutationObserver(() => {
|
||||||
if (loaded) {
|
if (loaded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const element = content.querySelector('#app-category-your-apps')
|
const element = content.querySelector('#app-category-your-apps') || content.querySelector('#app-navigation ul')
|
||||||
|| content.querySelector('#app-navigation ul')
|
|
||||||
|
|
||||||
if (element) {
|
if (element) {
|
||||||
loaded = true
|
loaded = true
|
||||||
@@ -65,4 +72,3 @@ if (content && content.classList.contains('app-settings')) {
|
|||||||
} else {
|
} else {
|
||||||
window.setTimeout(alwaysDisplayed, 200)
|
window.setTimeout(alwaysDisplayed, 200)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+646
-323
File diff suppressed because it is too large
Load Diff
+47
-47
@@ -3,51 +3,51 @@ const { VueLoaderPlugin } = require('vue-loader')
|
|||||||
const StyleLintPlugin = require('stylelint-webpack-plugin')
|
const StyleLintPlugin = require('stylelint-webpack-plugin')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
'admin': path.join(__dirname, 'src', 'admin.js'),
|
'admin': path.join(__dirname, 'src', 'admin.js'),
|
||||||
'sideMenu': path.join(__dirname, 'src', 'SideMenu.js'),
|
'sideMenu': path.join(__dirname, 'src', 'SideMenu.js'),
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, './js'),
|
path: path.resolve(__dirname, './js'),
|
||||||
publicPath: '/js',
|
publicPath: '/js',
|
||||||
filename: '[name].js?v=[hash]',
|
filename: '[name].js?v=[hash]',
|
||||||
chunkFilename: 'chunks/[name]-[hash].js',
|
chunkFilename: 'chunks/[name]-[hash].js',
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
use: ['vue-style-loader', 'css-loader'],
|
use: ['vue-style-loader', 'css-loader'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.scss$/,
|
test: /\.scss$/,
|
||||||
use: ['vue-style-loader', 'css-loader', 'sass-loader'],
|
use: ['vue-style-loader', 'css-loader', 'sass-loader'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
loader: 'vue-loader',
|
loader: 'vue-loader',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(png|jpg|gif|svg)$/,
|
test: /\.(png|jpg|gif|svg)$/,
|
||||||
loader: 'url-loader',
|
loader: 'url-loader',
|
||||||
options: {
|
options: {
|
||||||
name: '[name].[ext]?[hash]',
|
name: '[name].[ext]?[hash]',
|
||||||
limit: 8192,
|
limit: 8192,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new VueLoaderPlugin(),
|
new VueLoaderPlugin(),
|
||||||
new StyleLintPlugin(),
|
new StyleLintPlugin(),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['*', '.js', '.vue'],
|
extensions: ['*', '.js', '.vue'],
|
||||||
symlinks: false,
|
symlinks: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user