Compare commits

..

61 Commits

Author SHA1 Message Date
Simon Vieille 4ea6c5b191 Merge pull request 'develop' (#106) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/106
2022-07-05 14:51:05 +02:00
Simon Vieille 2a1e9f5010 release v2.4.1 2022-07-05 14:49:06 +02:00
Simon Vieille 05b1b16cb1 fix user setting save 2022-07-05 14:49:00 +02:00
Simon Vieille 0176ef22d4 update readme 2022-05-31 21:39:55 +02:00
Simon Vieille 1d914458d0 Merge pull request 'release v2.4.0' (#104) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/104
2022-05-31 21:28:36 +02:00
Simon Vieille a8ecf3ea46 release v2.4.0 2022-05-31 21:24:08 +02:00
Simon Vieille 8d1842f622 update changelog 2022-05-31 21:23:53 +02:00
Simon Vieille a0be3757e9 update screenshots 2022-05-31 21:21:30 +02:00
Simon Vieille 7b2f64c5cd add translations 2022-05-31 21:11:11 +02:00
Simon Vieille 6b1a995d5d add tooltips 2022-05-31 16:43:49 +02:00
Simon Vieille 814567635d update changelog 2022-05-31 16:29:29 +02:00
Simon Vieille 32322a0ab2 add button to set default colors 2022-05-31 16:28:43 +02:00
Simon Vieille 95230e9e4a add menu hover effect 2022-05-31 15:48:17 +02:00
Simon Vieille e2430866e5 add button to set default colors 2022-05-31 15:48:02 +02:00
Simon Vieille 9f9f8f90c8 remove focus on opener after click 2022-05-30 19:49:59 +02:00
Simon Vieille 28fc33ee79 change saving progression 2022-05-30 19:49:36 +02:00
Simon Vieille f116b8463a fix menu with categories header 2022-05-30 13:22:03 +02:00
Simon Vieille d8edbae848 fix minor issues 2022-05-30 12:58:49 +02:00
Simon Vieille 4e0c7be2c6 remove deprecated app.php file 2022-05-30 12:04:15 +02:00
Simon Vieille 2cb8c22be0 fix avatar size (nextcloud 24) 2022-05-04 21:05:38 +02:00
Simon Vieille 3e3e6ae943 Merge pull request 'release v2.3.5' (#100) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/100
2022-04-11 19:15:24 +02:00
Simon Vieille 389da47cab release v2.3.5 2022-04-11 19:11:41 +02:00
Simon Vieille a6a84ee784 update opener active style (fix #99) 2022-04-10 18:56:50 +02:00
Simon Vieille 52bbd49d9a update readme 2022-03-15 11:44:11 +01:00
Simon Vieille 92e1857ae8 Merge pull request 'fix issue #96' (#97) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/97
2022-03-15 11:14:40 +01:00
Simon Vieille c0b1701744 release v2.3.4 2022-03-15 10:56:05 +01:00
Simon Vieille ee98a49366 fix blank line when settings are open 2022-03-15 10:51:40 +01:00
Simon Vieille b4951b6cf1 Merge pull request 'develop' (#94) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/94
2022-02-07 14:35:05 +01:00
Simon Vieille a67688e779 release v2.3.3 2022-02-07 14:30:08 +01:00
Simon Vieille 9afde0dc9d update changelog 2022-02-07 14:29:51 +01:00
Simon Vieille 0f73ad42c4 fix SQL Exception InvalidFieldNameException (#93) 2022-02-07 14:28:34 +01:00
Simon Vieille 007ac2bb8e hide the scrollbar when mouse is out (menu always displayed) 2022-02-07 14:21:29 +01:00
Simon Vieille 4e21020600 Merge pull request 'develop' (#92) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/92
2022-01-14 17:03:28 +01:00
Simon Vieille 8c5b0e9834 update ci/cd conf 2022-01-14 16:52:36 +01:00
Simon Vieille 59e3b6b85e update ci/cd conf 2022-01-14 16:50:15 +01:00
Simon Vieille a913bd5ba2 update ci/cd conf 2022-01-14 16:49:14 +01:00
Simon Vieille 2d32e542cb update ci/cd conf 2022-01-14 16:46:47 +01:00
Simon Vieille 5d03fbaa49 update ci/cd conf 2022-01-14 16:44:54 +01:00
Simon Vieille 22011cb681 Merge pull request 'update the ci/cd config and screenshots' (#91) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/91
2022-01-13 00:47:43 +01:00
Simon Vieille 015493fc08 update ci/cd conf 2022-01-13 00:16:56 +01:00
Simon Vieille 992e54ac30 update ci/cd conf 2022-01-13 00:15:20 +01:00
Simon Vieille 67dfb7e833 update screenshots 2022-01-12 14:54:41 +01:00
Simon Vieille 1e68d6877d Merge pull request 'Quick fix' (#90) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/90
2022-01-12 14:13:08 +01:00
Simon Vieille 2ae08f7b77 release v2.3.2 2022-01-12 14:12:17 +01:00
Simon Vieille 489321081a fix hidden menu 2022-01-12 14:11:38 +01:00
Simon Vieille 68123ed45c Merge pull request 'Quick fix (#88)' (#89) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/89
2022-01-12 13:32:29 +01:00
Simon Vieille 66a1528341 release v2.3.1 2022-01-12 13:30:43 +01:00
Simon Vieille 64b7f3f534 fix #88 2022-01-12 13:29:44 +01:00
Simon Vieille fef936bef0 Merge pull request 'Issues #82 #83' (#87) from develop into master
Reviewed-on: https://gitnet.fr/deblan/side_menu/pulls/87
2022-01-12 12:53:54 +01:00
Simon Vieille 715dae6ab4 release v2.3.0 2022-01-12 12:51:29 +01:00
Simon Vieille e2a9fecac9 fix typo 2022-01-12 12:48:50 +01:00
Simon Vieille e2d17022f9 fix incorrect html label 2022-01-12 12:46:41 +01:00
Simon Vieille 29d79ad589 update changelog 2022-01-12 12:43:11 +01:00
Simon Vieille 5a4294fad4 Merge branch 'feature/issue82' into develop 2022-01-12 12:41:29 +01:00
Simon Vieille d34b41ba94 add option to keep an app in the top and side menu 2022-01-12 12:40:17 +01:00
Simon Vieille a6016552c9 update changelog and readme 2022-01-12 11:44:45 +01:00
Simon Vieille 50c65811a6 add auto-reload when settings are saved 2022-01-11 22:23:13 +01:00
Simon Vieille f64436f0a3 Merge branch 'feature/issue83' into develop 2022-01-11 20:20:51 +01:00
Simon Vieille 34b1c2809b fix issue with custom categories and add experimental notice 2022-01-11 20:20:44 +01:00
Simon Vieille 5d9dc804f8 add bigger select 2022-01-11 20:02:02 +01:00
Simon Vieille 30072500bc add a way to create custom categories and manage application categories 2022-01-11 19:59:51 +01:00
32 changed files with 907 additions and 209 deletions
+15 -3
View File
@@ -15,8 +15,14 @@ steps:
- make npm-build - make npm-build
when: when:
branch: branch:
- develop exclude:
- feature/* - master
include:
- develop
- feature/*
event:
- push
- pull_request
- name: release - name: release
image: deblan/devenv image: deblan/devenv
@@ -34,7 +40,13 @@ steps:
- make release - make release
when: when:
branch: branch:
- master exclude:
- develop
- feature/*
include:
- master
event:
- push
volumes: volumes:
- name: artifacts - name: artifacts
-7
View File
@@ -1,7 +0,0 @@
version: '1'
image: deblan/devenv
jobs:
build:
script:
- npm install
- make npm-build
+49 -1
View File
@@ -1,12 +1,60 @@
## [Unreleased] ## [Unreleased]
## 2.4.1
### Fixed
* fix user setting save
## 2.4.0
### Added
* remove focus on opener after click
* add button to set default colors
* add menu hover effect
* add translations
### Fixed
* fix deprecated app.php file
* fix menu with categories header
* fix minor issues
### Changed
* change saving progression
### Removed
* Nextcloud 19 is not supported anymore
* PHP 7.3 is not supported anymore
## 2.3.5
### Fixed
* fix white square (#99)
## 2.3.4
### Fixed
* fix blank line when settings are open (#96)
## 2.3.3
### Added
* hide the scrollbar when mouse is out (menu always displayed)
### Fixed
* fix SQL Exception InvalidFieldNameException (#93)
## 2.3.2
### Fixed
- fix hidden menu
## 2.3.1
### Fixed
- fix #88: does not work with default menu
## 2.3.0
### Added
- fix #82: add an option to keep visible an app in both menus
- fix #83: add custom categories
- add auto-reload when settings are saved
## 2.2.0 ## 2.2.0
### Added ### Added
- fix #84: update icons - fix #84: update icons
- fix #85: use Nextcloud colors by default - fix #85: use Nextcloud colors by default
### Fixed ### Fixed
- Fix categories order in large menu - fix categories order in large menu
## 2.1.0 ## 2.1.0
### Added ### Added
+4 -2
View File
@@ -2,7 +2,7 @@
=============================== ===============================
Allows you to modify the position of the main menu by creating a panel on the left of the interface or with a big menu on the top. Allows you to modify the position of the main menu by creating a panel on the left of the interface or with a big menu on the top.
You can also define apps that must be displayed in the top menu. Fully customisable. You can also add and sort custom categories, define apps that must be displayed in the top menu, etc. Fully customisable.
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.
@@ -15,10 +15,12 @@ You can customize colors depending of the theme (Dark theme and Breeze Dark). Co
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) 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)
[![Build Status](https://ci2.gitnet.fr/api/badges/deblan/side_menu/status.svg)](https://ci2.gitnet.fr/deblan/side_menu)
Requirements Requirements
------------ ------------
* PHP >= 7.3 * PHP >= 7.4
* App `theming` enabled * App `theming` enabled
Installation and upgrade Installation and upgrade
-10
View File
@@ -1,10 +0,0 @@
<?php
use OCA\SideMenu\AppInfo\Application;
$app = new Application();
if ($app->isEnabled()) {
$app->registerAssets();
$app->registerServices();
}
+3 -3
View File
@@ -26,7 +26,7 @@ If you like this application and if you want to support the development:
* [Donate with liberapay](https://liberapay.com/deblan) * [Donate with liberapay](https://liberapay.com/deblan)
* [Leave a comment](https://apps.nextcloud.com/apps/side_menu#comments) * [Leave a comment](https://apps.nextcloud.com/apps/side_menu#comments)
]]></description> ]]></description>
<version>2.2.0</version> <version>2.4.1</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>
<namespace>SideMenu</namespace> <namespace>SideMenu</namespace>
@@ -46,8 +46,8 @@ If you like this application and if you want to support the development:
<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>
<dependencies> <dependencies>
<nextcloud min-version="19" max-version="23"/> <nextcloud min-version="20" max-version="24"/>
<php min-version="7.3"/> <php min-version="7.4"/>
</dependencies> </dependencies>
<settings> <settings>
<admin>OCA\SideMenu\Settings\Admin</admin> <admin>OCA\SideMenu\Settings\Admin</admin>
+20 -1
View File
@@ -97,6 +97,10 @@
margin-top: -1px; margin-top: -1px;
} }
#apps-categories-custom-list select {
width: 100%;
}
.side-menu-setting-table { .side-menu-setting-table {
display: table; display: table;
@@ -115,7 +119,7 @@
.side-menu-setting-form { .side-menu-setting-form {
display: table-cell; display: table-cell;
width: 300px; min-width: 300px;
} }
.side-menu-setting-label-short { .side-menu-setting-label-short {
@@ -125,3 +129,18 @@
.side-menu-setting-form-long { .side-menu-setting-form-long {
width: 400px; width: 400px;
} }
#side-menu-save-progress {
display: inline-block;
width: 0;
height: 15px;
background: #fff;
}
.btn-reset {
display: inline-block;
cursor: pointer;
position: absolute;
margin-top: 17px;
margin-left: 5px;
}
+21 -2
View File
@@ -29,6 +29,10 @@
display: none; display: none;
} }
#side-menu a {
transition: 0.2s;
}
#side-menu.open { #side-menu.open {
display: block; display: block;
} }
@@ -59,6 +63,8 @@
.side-menu-settings img { .side-menu-settings img {
vertical-align: bottom; vertical-align: bottom;
margin-left: 3px; margin-left: 3px;
width: 32px;
height: 32px;
} }
#side-menu.open .side-menu-settings { #side-menu.open .side-menu-settings {
@@ -78,8 +84,8 @@
margin-left: 3px !important; margin-left: 3px !important;
} }
.side-menu-opener:active { .side-menu-opener:active, .side-menu-opener:focus {
background-color: var(--color-background-dark) !important; background-color: var(--side-menu-current-app-background-color, #444) !important;
} }
.side-menu-closer { .side-menu-closer {
@@ -151,6 +157,10 @@
top: 0; top: 0;
} }
#side-menu.side-menu-with-categories .side-menu-header {
max-width: 295px;
}
#side-menu.hide-opener .side-menu-logo { #side-menu.hide-opener .side-menu-logo {
margin-top: 20px; margin-top: 20px;
} }
@@ -247,6 +257,11 @@
.side-menu-always-displayed .side-menu-apps-list { .side-menu-always-displayed .side-menu-apps-list {
height: calc(100vh - 49px); height: calc(100vh - 49px);
top: 49px; top: 49px;
overflow: hidden;
}
.side-menu-always-displayed .side-menu-apps-list:hover {
overflow: auto;
} }
.side-menu-always-displayed #side-menu, .side-menu-always-displayed #side-menu,
@@ -293,6 +308,10 @@
padding: 10px 0; padding: 10px 0;
} }
.side-menu-always-displayed #body-settings, #body-settings.body-settings-side-menu {
overflow-x: visible;
}
@media screen and (max-width: 1024px) { @media screen and (max-width: 1024px) {
#side-menu.side-menu-big { #side-menu.side-menu-big {
max-width: 290px; max-width: 290px;
+59 -62
View File
@@ -9,6 +9,9 @@ use OCA\SideMenu\Service\AppRepository;
use OCA\SideMenu\Service\CategoryRepository; 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\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\IUserSession; use OCP\IUserSession;
use OCP\Util; use OCP\Util;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
@@ -18,7 +21,7 @@ use Psr\Container\ContainerInterface;
* *
* @author Simon Vieille <simon@deblan.fr> * @author Simon Vieille <simon@deblan.fr>
*/ */
class Application extends App class Application extends App implements IBootstrap
{ {
public const APP_ID = 'side_menu'; public const APP_ID = 'side_menu';
@@ -44,16 +47,9 @@ class Application extends App
public function __construct(array $urlParams = []) public function __construct(array $urlParams = [])
{ {
parent::__construct(self::APP_ID, $urlParams); parent::__construct(self::APP_ID, $urlParams);
$this->config = OC::$server->getConfig();
$this->cspnm = OC::$server->getContentSecurityPolicyNonceManager();
$this->user = OC::$server[IUserSession::class]->getUser();
} }
/** protected function isEnabled(): bool
* Checks if this app is enabled.
*/
public function isEnabled(): bool
{ {
$enabled = true; $enabled = true;
$isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0'); $isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0');
@@ -74,64 +70,65 @@ class Application extends App
return $enabled; return $enabled;
} }
/** protected function addAssets()
* Registes services.
*/
public function registerServices()
{
$container = $this->getContainer();
$container->registerService('AppRepository', function (ContainerInterface $c) {
return new AppRepository();
});
$container->registerService('CategoryRepository', function (ContainerInterface $c) {
return new CategoryRepository();
});
$container->registerService('ConfigProxy', function (ContainerInterface $c) {
return new ConfigProxy();
});
}
/**
* Registers assets.
*/
public function registerAssets()
{ {
Util::addScript(self::APP_ID, 'sideMenu'); Util::addScript(self::APP_ID, 'sideMenu');
Util::addStyle(self::APP_ID, 'sideMenu'); Util::addStyle(self::APP_ID, 'sideMenu');
$stylesheet = OC::$server->getURLGenerator()->linkToRoute( $assets = [
'side_menu.Css.stylesheet', 'stylesheet' => [
[ 'route' => 'side_menu.Css.stylesheet',
'v' => $this->config->getAppValue(self::APP_ID, 'cache', '0'), 'type' => 'link',
] 'route_attr' => 'href',
); 'attr' => [
'rel' => 'stylesheet',
$script = OC::$server->getURLGenerator()->linkToRoute( ],
'side_menu.Js.script',
[
'v' => $this->config->getAppValue(self::APP_ID, 'cache', '0'),
]
);
Util::addHeader(
'link',
[
'href' => $stylesheet,
'rel' => 'stylesheet',
], ],
'' 'script' => [
); 'route' => 'side_menu.Js.script',
'type' => 'script',
Util::addHeader( 'route_attr' => 'src',
'script', 'attr' => [
[ 'nonce' => $this->cspnm->getNonce(),
'src' => $script, ],
'nonce' => $this->cspnm->getNonce(),
], ],
'' ];
);
$cache = $this->config->getAppValue(self::APP_ID, 'cache', '0');
foreach ($assets as $key => $value) {
$route = OC::$server->getURLGenerator()->linkToRoute($value['route'], ['v' => $cache]);
$value['attr'][$value['route_attr']] = $route;
Util::addHeader($value['type'], $value['attr'], '');
}
}
public function register(IRegistrationContext $context): void
{
$context->registerService('AppRepository', function (ContainerInterface $c) {
return new AppRepository();
});
$context->registerService('CategoryRepository', function (ContainerInterface $c) {
return new CategoryRepository();
});
$context->registerService('ConfigProxy', function (ContainerInterface $c) {
return new ConfigProxy();
});
}
public function boot(IBootContext $context): void
{
$this->config = OC::$server->getConfig();
$this->cspnm = OC::$server->getContentSecurityPolicyNonceManager();
$this->user = OC::$server[IUserSession::class]->getUser();
if (!$this->isEnabled()) {
return;
}
$this->addAssets();
} }
} }
+7
View File
@@ -87,6 +87,7 @@ class CssController extends Controller
{ {
$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', '[]');
$topSideMenuApps = $this->config->getAppValueArray('top-side-menu-apps', '[]');
$isAccessibilityAppEnabled = $this->config->getAppValueBool('enabled', '0', 'accessibility'); $isAccessibilityAppEnabled = $this->config->getAppValueBool('enabled', '0', 'accessibility');
$isBreezeDarkAppEnabled = $this->config->getAppValueBool('enabled', '0', 'breezedark'); $isBreezeDarkAppEnabled = $this->config->getAppValueBool('enabled', '0', 'breezedark');
@@ -94,11 +95,16 @@ class CssController extends Controller
if ($this->user) { if ($this->user) {
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]'); $userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
$userTopSideMenuApps = $this->config->getUserValueArray($this->user, 'top-side-menu-apps', '[]');
if (!empty($userTopMenuApps) && !$isForced) { if (!empty($userTopMenuApps) && !$isForced) {
$topMenuApps = $userTopMenuApps; $topMenuApps = $userTopMenuApps;
} }
if (!empty($userTopSideMenuApps) && !$isForced) {
$topSideMenuApps = $userTopSideMenuApps;
}
$isDarkThemeUserEnabled = $this->config->getUserValue($this->user, 'theme', '', 'accessibility') === 'dark'; $isDarkThemeUserEnabled = $this->config->getUserValue($this->user, 'theme', '', 'accessibility') === 'dark';
$isBreezeDarkUserEnabled = $this->config->getUserValue($this->user, 'theme_enabled', '', 'breezedark'); $isBreezeDarkUserEnabled = $this->config->getUserValue($this->user, 'theme_enabled', '', 'breezedark');
@@ -162,6 +168,7 @@ class CssController extends Controller
'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'),
'top-menu-apps' => $topMenuApps, 'top-menu-apps' => $topMenuApps,
'top-side-menu-apps' => $topSideMenuApps,
]; ];
} }
} }
+7
View File
@@ -94,6 +94,7 @@ class JsController extends Controller
protected function getConfig(): array protected function getConfig(): array
{ {
$topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]'); $topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]');
$topSideMenuApps = $this->config->getAppValueArray('top-side-menu-apps', '[]');
$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');
@@ -103,11 +104,16 @@ class JsController extends Controller
if ($this->user) { if ($this->user) {
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]'); $userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
$userTopSideMenuApps = $this->config->getUserValueArray($this->user, 'top-side-menu-apps', '[]');
if (!empty($userTopMenuApps) && !$isForced) { if (!empty($userTopMenuApps) && !$isForced) {
$topMenuApps = $userTopMenuApps; $topMenuApps = $userTopMenuApps;
} }
if (!empty($userTopSideMenuApps) && !$isForced) {
$topSideMenuApps = $userTopSideMenuApps;
}
$userTargetBlankMode = $this->config->getUserValueInt($this->user, 'target-blank-mode', '1'); $userTargetBlankMode = $this->config->getUserValueInt($this->user, 'target-blank-mode', '1');
$userTargetBlankApps = $this->config->getUserValueArray($this->user, 'target-blank-apps', '[]'); $userTargetBlankApps = $this->config->getUserValueArray($this->user, 'target-blank-apps', '[]');
@@ -157,6 +163,7 @@ class JsController extends Controller
'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'), 'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'),
'avatar' => $avatar, 'avatar' => $avatar,
'top-menu-apps' => $topMenuApps, 'top-menu-apps' => $topMenuApps,
'top-side-menu-apps' => $topSideMenuApps,
'target-blank-apps' => $targetBlankApps, 'target-blank-apps' => $targetBlankApps,
'settings' => $settings, 'settings' => $settings,
'logo' => $this->themingDefaults->getLogo(), 'logo' => $this->themingDefaults->getLogo(),
+1 -1
View File
@@ -97,7 +97,7 @@ class PersonalSettingController extends Controller
} }
} }
if ('top-menu-apps' === $name) { if (in_array($name, ['top-menu-apps', 'top-side-menu-apps'])) {
$doSave = true; $doSave = true;
$data = json_decode($value, true); $data = json_decode($value, true);
+27 -1
View File
@@ -21,10 +21,27 @@ class AppRepository
*/ */
protected $l10nFactory; protected $l10nFactory;
public function __construct(\OC_App $ocApp, IFactory $l10nFactory) /**
* @var ConfigProxy
*/
protected $config;
/**
* @var CategoryRepository
*/
protected $categoryRepository;
public function __construct(
\OC_App $ocApp,
IFactory $l10nFactory,
ConfigProxy $config,
CategoryRepository $categoryRepository
)
{ {
$this->ocApp = $ocApp; $this->ocApp = $ocApp;
$this->l10nFactory = $l10nFactory; $this->l10nFactory = $l10nFactory;
$this->config = $config;
$this->categoryRepository = $categoryRepository;
} }
/** /**
@@ -35,6 +52,9 @@ class AppRepository
public function getVisibleApps() public function getVisibleApps()
{ {
$navigation = $this->ocApp->getNavigation(); $navigation = $this->ocApp->getNavigation();
$appCategoriesCustom = $this->config->getAppValueArray('apps-categories-custom', '[]');
$categoriesCustom = $this->config->getAppValueArray('categories-custom', '[]');
$categories = $this->categoryRepository->getOrderedCategories();
$apps = $this->ocApp->listAllApps(); $apps = $this->ocApp->listAllApps();
$visibleApps = []; $visibleApps = [];
@@ -74,6 +94,12 @@ class AppRepository
} }
} }
foreach ($visibleApps as $id => $app) {
if (isset($appCategoriesCustom[$id], $categories[$appCategoriesCustom[$id]])) {
$visibleApps[$id]['category'] = [$appCategoriesCustom[$id]];
}
}
usort($visibleApps, function ($a, $b) { usort($visibleApps, function ($a, $b) {
return ($a['name'] < $b['name']) ? -1 : 1; return ($a['name'] < $b['name']) ? -1 : 1;
}); });
+22 -2
View File
@@ -5,6 +5,7 @@ namespace OCA\SideMenu\Service;
use OC\App\AppStore\Fetcher\CategoryFetcher; use OC\App\AppStore\Fetcher\CategoryFetcher;
use OCA\SideMenu\AppInfo\Application; use OCA\SideMenu\AppInfo\Application;
use OCP\IConfig; use OCP\IConfig;
use OCP\IUserSession;
use OCP\L10N\IFactory; use OCP\L10N\IFactory;
/** /**
@@ -34,16 +35,23 @@ class CategoryRepository
*/ */
protected $iConfig; protected $iConfig;
/**
* @var IUserSession
*/
protected $userSession;
public function __construct( public function __construct(
CategoryFetcher $categoryFetcher, CategoryFetcher $categoryFetcher,
ConfigProxy $config, ConfigProxy $config,
IConfig $iConfig, IConfig $iConfig,
IFactory $l10nFactory IFactory $l10nFactory,
IUserSession $userSession
) { ) {
$this->categoryFetcher = $categoryFetcher; $this->categoryFetcher = $categoryFetcher;
$this->l10nFactory = $l10nFactory; $this->l10nFactory = $l10nFactory;
$this->config = $config; $this->config = $config;
$this->iConfig = $iConfig; $this->iConfig = $iConfig;
$this->userSession = $userSession;
} }
/** /**
@@ -56,8 +64,8 @@ class CategoryRepository
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2); $currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
$type = $this->config->getAppValue('categories-order-type', 'default'); $type = $this->config->getAppValue('categories-order-type', 'default');
$order = $this->config->getAppValueArray('categories-order', '[]'); $order = $this->config->getAppValueArray('categories-order', '[]');
$categoriesLabels = $this->config->getAppValueArray('cache-categories', '[]'); $categoriesLabels = $this->config->getAppValueArray('cache-categories', '[]');
$customCategories = $this->config->getAppValueArray('categories-custom', '[]');
if (empty($categoriesLabels)) { if (empty($categoriesLabels)) {
$categoriesLabels = $this->categoryFetcher->get(); $categoriesLabels = $this->categoryFetcher->get();
@@ -74,6 +82,18 @@ class CategoryRepository
$categoriesLabels['external_links'] = $this->l10nFactory->get('external')->t('External sites'); $categoriesLabels['external_links'] = $this->l10nFactory->get('external')->t('External sites');
$categoriesLabels['other'] = ''; $categoriesLabels['other'] = '';
$user = $this->userSession->getUser();
if ($user) {
$lang = $this->iConfig->getUserValue($user->getUid(), 'core', 'lang');
} else {
$lang = 'en';
}
foreach ($customCategories as $category) {
$categoriesLabels[$category['id']] = $category[$lang] ?? $category['en'];
}
asort($categoriesLabels); asort($categoriesLabels);
if ('custom' === $type) { if ('custom' === $type) {
+48
View File
@@ -0,0 +1,48 @@
<?php
namespace OCA\SideMenu\Service;
use OCP\IDBConnection;
/**
* class LangRepository.
*
* @author Simon Vieille <simon@deblan.fr>
*/
class LangRepository
{
/**
* @var IDBConnection
*/
protected $db;
public function __construct(IDBConnection $db)
{
$this->db = $db;
}
public function getUsedLangs(): array
{
$qb = $this->db->getQueryBuilder();
$qb->select($qb->createFunction('DISTINCT configvalue'))
->where('configkey=:configkey and appid=:appid and configvalue<>:configvalue')
->setParameters([
'configkey' => 'lang',
'appid' => 'core',
'configvalue' => 'en',
])
->from('preferences')
;
$stmt = $qb->execute();
$langs = ['en'];
foreach ($stmt->fetchAll() as $result) {
$langs[] = $result['configvalue'];
}
return $langs;
}
}
+26 -2
View File
@@ -28,6 +28,7 @@ use OCP\ILogger;
use OCP\Settings\ISettings; use OCP\Settings\ISettings;
use OCA\Theming\ThemingDefaults; use OCA\Theming\ThemingDefaults;
use OCA\SideMenu\Service\Color; use OCA\SideMenu\Service\Color;
use OCA\SideMenu\Service\LangRepository;
class Admin implements ISettings class Admin implements ISettings
{ {
@@ -66,6 +67,11 @@ class Admin implements ISettings
*/ */
protected $color; protected $color;
/**
* @var LangRepository
*/
protected $langRepository;
public function __construct( public function __construct(
IL10N $l, IL10N $l,
ILogger $logger, ILogger $logger,
@@ -73,7 +79,8 @@ class Admin implements ISettings
AppRepository $appRepository, AppRepository $appRepository,
CategoryRepository $categoryRepository, CategoryRepository $categoryRepository,
ThemingDefaults $theming, ThemingDefaults $theming,
Color $color Color $color,
LangRepository $langRepository
) { ) {
$this->l = $l; $this->l = $l;
$this->logger = $logger; $this->logger = $logger;
@@ -82,6 +89,7 @@ class Admin implements ISettings
$this->categoryRepository = $categoryRepository; $this->categoryRepository = $categoryRepository;
$this->theming = $theming; $this->theming = $theming;
$this->color = $color; $this->color = $color;
$this->langRepository = $langRepository;
} }
/** /**
@@ -102,6 +110,18 @@ class Admin implements ISettings
$darkModeBackgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $darkenPrimaryColor); $darkModeBackgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $darkenPrimaryColor);
$parameters = [ $parameters = [
'defaults' => [
'background-color' => $darkenPrimaryColor,
'background-color-to' => $darkenPrimaryColor,
'current-app-background-color' => $darkenPrimaryColor2,
'text-color' => $textColor,
'loader-color' => $lightenPrimaryColor,
'dark-mode-background-color' => $darkenPrimaryColor,
'dark-mode-background-color-to' => $darkenPrimaryColor,
'dark-mode-current-app-background-color' => $darkenPrimaryColor2,
'dark-mode-text-color' => $textColor,
'dark-mode-loader-color' => $textColor,
],
'background-color' => $backgroundColor, 'background-color' => $backgroundColor,
'background-color-to' => $backgroundColorTo, 'background-color-to' => $backgroundColorTo,
'background-color-opacity' => $this->config->getAppValueInt('background-color-opacity', '100'), 'background-color-opacity' => $this->config->getAppValueInt('background-color-opacity', '100'),
@@ -139,11 +159,15 @@ class Admin implements ISettings
'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', '[]'),
'top-side-menu-apps' => $this->config->getAppValueArray('top-side-menu-apps', '[]'),
'default-enabled' => $this->config->getAppValue('default-enabled', '1'), 'default-enabled' => $this->config->getAppValue('default-enabled', '1'),
'apps' => $this->appRepository->getVisibleApps(),
'apps-categories-custom' => $this->config->getAppValueArray('apps-categories-custom', '[]'),
'categories-order-type' => $this->config->getAppValue('categories-order-type', 'default'), 'categories-order-type' => $this->config->getAppValue('categories-order-type', 'default'),
'categories-order' => $this->config->getAppValueArray('categories-order', '[]'), 'categories-order' => $this->config->getAppValueArray('categories-order', '[]'),
'apps' => $this->appRepository->getVisibleApps(), 'categories-custom' => $this->config->getAppValueArray('categories-custom', '[]'),
'categories' => $this->categoryRepository->getOrderedCategories(), 'categories' => $this->categoryRepository->getOrderedCategories(),
'langs' => $this->langRepository->getUsedLangs(),
]; ];
return new TemplateResponse(Application::APP_ID, 'settings/admin-form', $parameters, ''); return new TemplateResponse(Application::APP_ID, 'settings/admin-form', $parameters, '');
+1
View File
@@ -78,6 +78,7 @@ class Personal implements ISettings
$this->config->getAppValue('default-enabled', '1') $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', '[]'),
'top-side-menu-apps' => $this->config->getUserValueArray($user, 'top-side-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', '[]'),
'apps' => $this->appRepository->getVisibleApps(), 'apps' => $this->appRepository->getVisibleApps(),
+3 -3
View File
@@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@nextcloud/axios": "^1.8.0", "@nextcloud/axios": "^1.8.0",
"@nextcloud/vue": "^1.4.0", "@nextcloud/vue": "^1.5.0",
"axios": "^0.24.0", "axios": "^0.24.0",
"trim": "0.0.1", "trim": "0.0.1",
"vue": "^2.6.11" "vue": "^2.6.11"
@@ -21,7 +21,7 @@
"extends @nextcloud/browserslist-config" "extends @nextcloud/browserslist-config"
], ],
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=16.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.9.0", "@babel/core": "^7.9.0",
@@ -43,9 +43,9 @@
"eslint-plugin-standard": "^4.0.1", "eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^5.2.3", "eslint-plugin-vue": "^5.2.3",
"file-loader": "^6.0.0", "file-loader": "^6.0.0",
"node-sass": "^4.13.1",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"stylelint": "^8.4.0", "stylelint": "^8.4.0",
"sass": "^1.49.9",
"stylelint-config-recommended-scss": "^3.3.0", "stylelint-config-recommended-scss": "^3.3.0",
"stylelint-scss": "^3.16.0", "stylelint-scss": "^3.16.0",
"stylelint-webpack-plugin": "^0.10.5", "stylelint-webpack-plugin": "^0.10.5",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

+182
View File
@@ -0,0 +1,182 @@
<!--
@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>
<ul class="side-menu-setting-list">
<li v-for="item in values" class="side-menu-setting-list-item" v-on:click="showEditForm(item)">
<span v-html="item.en"></span>
</li>
</ul>
<Actions>
<ActionButton @click="showAddForm" icon="icon-add"></ActionButton>
</Actions>
<Modal v-if="addForm" @close="hideAddForm">
<div class="modal__content">
<div v-for="lang in langs">
<span class="lang" v-html="lang"></span>
<input type="text" v-model="newValue[lang]" required>
</div>
<Actions>
<ActionButton @click="saveAdd" icon="icon-checkmark"></ActionButton>
</Actions>
</div>
</Modal>
<Modal v-if="editForm" @close="hideEditForm">
<div class="modal__content">
<div v-for="lang in langs">
<span class="lang" v-html="lang"></span>
<input type="text" v-model="editValue[lang]" required>
</div>
<div class="pull-right">
<Actions>
<ActionButton @click="removeEdit" icon="icon-delete"></ActionButton>
</Actions>
</div>
<Actions>
<ActionButton @click="saveEdit" icon="icon-checkmark"></ActionButton>
</Actions>
</div>
</Modal>
</div>
</template>
<style scoped>
.modal__content {
width: 200px;
padding: 10px;
}
.modal__content .lang {
width: 60px;
display: inline-block;
padding: 4px;
box-sizing: border-box;
}
.modal__content input[type=text] {
width: calc(100% - 85px);
display: inline-block;
margin: 0;
}
.pull-right {
float: right;
}
</style>
<script>
import Modal from '@nextcloud/vue/dist/Components/Modal'
import Actions from '@nextcloud/vue/dist/Components/Actions'
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
export default {
name: 'AdminCategoriesCustom',
components: {
Modal,
Actions,
ActionButton,
},
data() {
return {
input: null,
values: [],
langs: [],
addForm: false,
editForm: false,
newValue: {},
editValue: {},
}
},
methods: {
init() {
this.values = JSON.parse(this.input.value)
this.langs = JSON.parse(this.input.getAttribute('data-langs'))
},
update() {
this.input.value = JSON.stringify(this.values)
},
showAddForm() {
this.newValue = {id: 'cat' + Math.random().toString().replace('0.', '')}
this.addForm = true
},
showEditForm(value) {
this.editValue = {id: value.id}
for (let i of this.langs) {
this.editValue[i] = typeof value[i] !== 'undefined' ? value[i] : ''
}
this.editForm = true
},
saveAdd() {
for (let i of this.langs) {
if (!this.newValue[i] || /^\s*$/.test(this.newValue[i])) {
return
}
}
this.values.push(this.newValue)
this.update()
this.hideAddForm()
this.newValue = {}
},
saveEdit() {
for (let i of this.langs) {
if (!this.editValue[i] || /^\s*$/.test(this.editValue[i])) {
return
}
}
for (let i in this.values) {
if (this.values[i].id === this.editValue.id) {
this.values[i] = this.editValue
}
}
this.update()
this.hideEditForm()
},
removeEdit() {
for (let i in this.values) {
if (this.values[i].id === this.editValue.id) {
this.values.splice(i, 1);
}
}
this.update()
this.hideEditForm()
},
hideAddForm() {
this.addForm = false
},
hideEditForm() {
this.editForm = false
},
},
mounted() {
this.input = document.querySelector('input[name="categories-custom"]')
this.init()
}
}
</script>
+1 -1
View File
@@ -100,7 +100,7 @@ export default {
var dataId = parent.getAttribute('data-id') var dataId = parent.getAttribute('data-id')
dataId = dataId !== null ? dataId : '' dataId = dataId !== null ? dataId : ''
if (!parent.classList.contains('app-hidden') && !menuIsHidden) { if (!parent.classList.contains('app-top-side-menu') && !parent.classList.contains('app-hidden') && !menuIsHidden) {
continue continue
} }
+60 -6
View File
@@ -15,6 +15,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import AdminCategoriesCustom from './AdminCategoriesCustom.vue'
import Vue from 'vue'
Vue.prototype.OC = window.OC
Vue.prototype.OCA = window.OCA
let elements = [] let elements = []
const selector = '#side-menu-message' const selector = '#side-menu-message'
@@ -73,17 +79,21 @@ const saveSettings = (key) => {
++value ++value
} }
const progress = document.querySelector('#side-menu-save-progress')
progress.style.width = '40px';
progress.style.marginLeft = '5px';
const callbacks = { const callbacks = {
success: () => { success: () => {
OC.msg.finishedSuccess( const percent = parseInt((key + 1) * 100 / size);
selector,
t('side_menu', (key + 1) + '/' + size)
)
if (key < size) { progress.setAttribute('value', percent)
if (key < size - 1) {
saveSettings(key + 1) saveSettings(key + 1)
} else { } else {
OC.msg.finishedSuccess(selector, t('side_menu', 'Saved')) location.reload()
} }
}, },
error: () => { error: () => {
@@ -108,7 +118,31 @@ const elementToggler = (element) => {
element.style.display = display element.style.display = display
} }
const updateAppsCategoriesCustom = () => {
let values = {}
for (let item of document.querySelectorAll('.apps-categories-custom')) {
let app = item.getAttribute('data-app')
let value = item.value
if (value) {
values[app] = value
}
}
document.querySelector('#apps-categories-custom').value = JSON.stringify(values)
}
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
$('*[data-toggle="tooltip"]').tooltip();
if (document.querySelector('#side-menu-categories-custom')) {
const View = Vue.extend(AdminCategoriesCustom)
const adminCategoriesCustom = new View({})
adminCategoriesCustom.$mount('#side-menu-categories-custom')
}
elements = document.querySelectorAll('.side-menu-setting') elements = document.querySelectorAll('.side-menu-setting')
document.querySelector('#side-menu-save').addEventListener('click', (event) => { document.querySelector('#side-menu-save').addEventListener('click', (event) => {
@@ -118,6 +152,19 @@ document.addEventListener('DOMContentLoaded', () => {
saveSettings(0) saveSettings(0)
}) })
const resets = document.querySelectorAll('.btn-reset')
for (let btn of resets) {
btn.addEventListener('click', (event) => {
const target = event.target
const values = JSON.parse(target.getAttribute('data-reset'))
for (let i in values) {
document.querySelector(`#${i}`).value = values[i]
}
})
}
const displays = document.querySelectorAll('.side-menu-display') const displays = document.querySelectorAll('.side-menu-display')
for (let display of displays) { for (let display of displays) {
@@ -134,6 +181,12 @@ document.addEventListener('DOMContentLoaded', () => {
}) })
} }
for (let item of document.querySelectorAll('.apps-categories-custom')) {
item.addEventListener('change', (event) => {
updateAppsCategoriesCustom()
})
}
for (let item of document.querySelectorAll('.side-menu-setting-live')) { for (let item of document.querySelectorAll('.side-menu-setting-live')) {
item.addEventListener('change', (event) => { item.addEventListener('change', (event) => {
const target = event.target const target = event.target
@@ -196,6 +249,7 @@ document.addEventListener('DOMContentLoaded', () => {
let value = [] let value = []
for (let item of document.querySelectorAll('#categories-list .side-menu-setting-list-item')) { for (let item of document.querySelectorAll('#categories-list .side-menu-setting-list-item')) {
console.log(item.getAttribute('data-id'))
value.push(item.getAttribute('data-id')) value.push(item.getAttribute('data-id'))
} }
+14
View File
@@ -77,3 +77,17 @@
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Tyto parametry jsou použity v případě, že je zapnutý (Breeze) tmavý motiv vzhledu." "This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Tyto parametry jsou použity v případě, že je zapnutý (Breeze) tmavý motiv vzhledu."
"Dark mode colors": "Barvy tmavého režimu" "Dark mode colors": "Barvy tmavého režimu"
"With categories": "S kategoriemi" "With categories": "S kategoriemi"
"Custom categories": "Vlastní kategorie"
"Customize application categories": "Personnaliser les catégories des applications"
"Customize application categories": "Přizpůsobte kategorie aplikací"
"Apps only visible in the top menu": "Aplikace jsou viditelné pouze v horní nabídce "
"Apps visible in the top and side menus": "Aplikace viditelné v horní a boční nabídce"
"Reset to default": "Vrátit zpět na výchozí hodnoty"
"Hidden icon": "Skrytá ikona"
"Small icon": "Malá ikona"
"Normal icon": "Normální ikona"
"Big icon": "Velká ikona"
"Hidden text": "Skrytý text"
"Small text": "Malý text"
"Normal text": "Normální text"
"Big text": "Velký text"
+13
View File
@@ -77,3 +77,16 @@
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Diese Optionen werden auf <code>Dark Theme</code> oder <code>Breeze Dark Theme</code> angewendet." "This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Diese Optionen werden auf <code>Dark Theme</code> oder <code>Breeze Dark Theme</code> angewendet."
"Dark mode colors": "Farben für den dunklen Modus" "Dark mode colors": "Farben für den dunklen Modus"
"With categories": "Mit Kategorien" "With categories": "Mit Kategorien"
"Custom categories": "Benutzerdefinierte Kategorien"
"Customize application categories": "Anwendungskategorien anpassen"
"Apps only visible in the top menu": "Apps nur im oberen Menü sichtbar "
"Apps visible in the top and side menus": "Apps im oberen und seitlichen Menü sichtbar"
"Reset to default": "Auf Standard zurücksetzen"
"Hidden icon": "Verstecktes Symbol"
"Small icon": "Kleines Symbol"
"Normal icon": "Normales Symbol"
"Big icon": "Große Ikone"
"Hidden text": "Versteckter Text"
"Small text": "Kleiner Text"
"Normal text": "Normaler Text"
"Big text": "Großer Text"
+13
View File
@@ -15,6 +15,14 @@
"Small": "Petit" "Small": "Petit"
"Normal": "Normal" "Normal": "Normal"
"Big": "Gros" "Big": "Gros"
"Hidden icon": "Icône masqué"
"Small icon": "Petit icône"
"Normal icon": "Icône normal"
"Big icon": "Gros icône"
"Hidden text": "Text masqué"
"Small text": "Texte petit"
"Normal text": "Texte normal"
"Big text": "Gros texte"
"Colors": "Couleurs" "Colors": "Couleurs"
"Background color": "Couleur de fond" "Background color": "Couleur de fond"
"Background color of current app": "Couleur de fond de l'application en cours" "Background color of current app": "Couleur de fond de l'application en cours"
@@ -77,3 +85,8 @@
"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." "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."
"Dark mode colors": "Couleurs du mode sombre" "Dark mode colors": "Couleurs du mode sombre"
"With categories": "Avec les catégories" "With categories": "Avec les catégories"
"Custom categories": "Catégories personnalisées"
"Customize application categories": "Personnaliser les catégories des applications"
"Apps only visible in the top menu": "Applications visibles uniquement dans le menu supérieur"
"Apps visible in the top and side menus": "Applications visibles dans le menus supérieur et latéral"
"Reset to default": "Restaurer les valeurs par défaut"
+13
View File
@@ -77,3 +77,16 @@
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "此参数将应用于暗黑主题激活时。" "This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "此参数将应用于暗黑主题激活时。"
"Dark mode colors": "暗黑模式颜色" "Dark mode colors": "暗黑模式颜色"
"With categories": "有类别" "With categories": "有类别"
"Custom categories": "自定义类别"
"Customize application categories": "自定义应用程序类别"
"Apps only visible in the top menu": "应用程序仅在顶部菜单中可见"
"Apps visible in the top and side menus": "顶部和侧边菜单中可见的应用程序"
"Reset to default": "重置为默认设置"
"Hidden icon": "隐藏图标"
"Small icon": "小图标"
"Normal icon": "正常图标"
"Big icon": "大图标"
"Hidden text": "隐藏文字"
"Small text": "小文本"
"Normal text": "普通文本"
"Big text": "大文本"
+1 -1
View File
@@ -8,7 +8,7 @@
<?php endforeach; ?> <?php endforeach; ?>
} }
<?php if (empty($_['top-menu-apps'])): ?> <?php if (empty($_['top-menu-apps']) && empty($_['top-side-menu-apps'])): ?>
#appmenu { #appmenu {
display: none; display: none;
} }
+6 -3
View File
@@ -52,13 +52,17 @@ const updateTopMenu = function() {
continue continue
} }
if (topMenuApps.indexOf(dataId) === -1) { if (topMenuApps.indexOf(dataId) === -1 && topSideMenuApps.indexOf(dataId) === -1) {
app.classList.add('hidden') app.classList.add('hidden')
app.classList.add('app-hidden') app.classList.add('app-hidden')
} else { } else {
app.classList.remove('hidden') app.classList.remove('hidden')
app.classList.add('app-external-site') app.classList.add('app-external-site')
if (topSideMenuApps.indexOf(dataId) !== -1) {
app.classList.add('app-top-side-menu')
}
appShown.push(app) appShown.push(app)
navigationAppsHtml = navigationAppsHtml + app.outerHTML navigationAppsHtml = navigationAppsHtml + app.outerHTML
@@ -67,7 +71,6 @@ const updateTopMenu = function() {
if (targetBlankApps.indexOf(dataId) !== -1) { if (targetBlankApps.indexOf(dataId) !== -1) {
querySelector('a', app).setAttribute('target', '_blank') querySelector('a', app).setAttribute('target', '_blank')
} }
} }
navigationApps.innerHTML = navigationAppsHtml navigationApps.innerHTML = navigationAppsHtml
@@ -198,7 +201,7 @@ const updateTopMenu = function() {
menuCache = menu.innerHTML + menu.nextSibling.innerHTML menuCache = menu.innerHTML + menu.nextSibling.innerHTML
} }
for (let i = 0; i < 3000; i+= 100) { for (let i = 0; i < 4000; i+= 100) {
setTimeout(updateTopMenu, i) setTimeout(updateTopMenu, i)
} }
+20 -2
View File
@@ -149,6 +149,8 @@ if ($_['always-displayed']) {
if (a !== null) { if (a !== null) {
a.focus() a.focus()
} }
headerMenuOpener.blur()
}) })
for (let opener of sideMenuOpener) { for (let opener of sideMenuOpener) {
@@ -171,6 +173,21 @@ if ($_['always-displayed']) {
sideMenuFocus() sideMenuFocus()
} }
}) })
const sideMenuObserver = new MutationObserver((e) => {
if (body.getAttribute('id') !== 'body-settings') {
return
}
body.classList.toggle('body-settings-side-menu', sideMenu.classList.contains('open'))
})
sideMenuObserver.observe(sideMenu, {
attributes: true,
attributeFilter: ['class'],
childList: false,
characterData: false
})
}) })
body.appendChild(sideMenuContainer) body.appendChild(sideMenuContainer)
@@ -186,8 +203,9 @@ if ($_['always-displayed']) {
nextcloud.parentNode.insertBefore(sideMenuOpener, nextcloud.nextSibling) nextcloud.parentNode.insertBefore(sideMenuOpener, nextcloud.nextSibling)
<?php endif; ?> <?php endif; ?>
<?php if (!empty($_['top-menu-apps'])): ?> <?php if (!empty($_['top-menu-apps']) || !empty($_['top-side-menu-apps'])): ?>
const topMenuApps = <?php echo json_encode($_['top-menu-apps']); ?> const topMenuApps = <?php echo json_encode($_['top-menu-apps']), "\n"; ?>
const topSideMenuApps = <?php echo json_encode($_['top-side-menu-apps']); ?>
<?php require_once __DIR__.'/_topMenuApps.js'; ?> <?php require_once __DIR__.'/_topMenuApps.js'; ?>
<?php endif; ?> <?php endif; ?>
+129 -6
View File
@@ -67,6 +67,10 @@ $choicesSizes = [
class="side-menu-setting side-menu-setting-live" class="side-menu-setting side-menu-setting-live"
value="<?php print_unescaped($_['background-color-to']); ?>"> value="<?php print_unescaped($_['background-color-to']); ?>">
<div class="theme-undo icon icon-history btn-reset" data-toggle="tooltip" data-original-title="<?php echo p($l->t('Reset to default')); ?>" data-reset="<?php echo htmlentities(json_encode([
'side-menu-background-color' => $_['defaults']['background-color'],
'side-menu-background-color-to' => $_['defaults']['background-color-to'],
])) ?>"></div>
<div> <div>
<em> <em>
<?php p($l->t('Transparent')); ?> <?php p($l->t('Transparent')); ?>
@@ -102,6 +106,10 @@ $choicesSizes = [
type="color" type="color"
class="side-menu-setting side-menu-setting-live" class="side-menu-setting side-menu-setting-live"
value="<?php print_unescaped($_['current-app-background-color']); ?>"> value="<?php print_unescaped($_['current-app-background-color']); ?>">
<div class="theme-undo icon icon-history btn-reset" data-toggle="tooltip" data-original-title="<?php echo p($l->t('Reset to default')); ?>" data-reset="<?php echo htmlentities(json_encode([
'side-menu-current-app-background-color' => $_['defaults']['current-app-background-color'],
])) ?>"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -118,6 +126,10 @@ $choicesSizes = [
type="color" type="color"
class="side-menu-setting side-menu-setting-live" class="side-menu-setting side-menu-setting-live"
value="<?php print_unescaped($_['text-color']); ?>"> value="<?php print_unescaped($_['text-color']); ?>">
<div class="theme-undo icon icon-history btn-reset" data-toggle="tooltip" data-original-title="<?php echo p($l->t('Reset to default')); ?>" data-reset="<?php echo htmlentities(json_encode([
'side-menu-text-color' => $_['defaults']['text-color'],
])) ?>"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -134,6 +146,10 @@ $choicesSizes = [
type="color" type="color"
class="side-menu-setting" class="side-menu-setting"
value="<?php print_unescaped($_['loader-color']); ?>"> value="<?php print_unescaped($_['loader-color']); ?>">
<div class="theme-undo icon icon-history btn-reset" data-toggle="tooltip" data-original-title="<?php echo p($l->t('Reset to default')); ?>" data-reset="<?php echo htmlentities(json_encode([
'side-menu-loader-color' => $_['defaults']['loader-color'],
])) ?>"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -227,16 +243,23 @@ $choicesSizes = [
</div> </div>
<div class="side-menu-setting-form side-menu-setting-form-long"> <div class="side-menu-setting-form side-menu-setting-form-long">
<input <input
id="side-menu-dark-mode-background-color"
name="dark-mode-background-color" name="dark-mode-background-color"
type="color" type="color"
class="side-menu-setting" class="side-menu-setting"
value="<?php print_unescaped($_['dark-mode-background-color']); ?>"> value="<?php print_unescaped($_['dark-mode-background-color']); ?>">
<input <input
id="side-menu-dark-mode-background-color-to"
name="dark-mode-background-color-to" name="dark-mode-background-color-to"
type="color" type="color"
class="side-menu-setting" class="side-menu-setting"
value="<?php print_unescaped($_['dark-mode-background-color-to']); ?>"> value="<?php print_unescaped($_['dark-mode-background-color-to']); ?>">
<div class="theme-undo icon icon-history btn-reset" data-toggle="tooltip" data-original-title="<?php echo p($l->t('Reset to default')); ?>" data-reset="<?php echo htmlentities(json_encode([
'side-menu-dark-mode-background-color' => $_['defaults']['dark-mode-background-color'],
'side-menu-dark-mode-background-color-to' => $_['defaults']['dark-mode-background-color-to'],
])) ?>"></div>
<div> <div>
<em> <em>
<?php p($l->t('Transparent')); ?> <?php p($l->t('Transparent')); ?>
@@ -266,10 +289,15 @@ $choicesSizes = [
</div> </div>
<div class="side-menu-setting-form side-menu-setting-form-long"> <div class="side-menu-setting-form side-menu-setting-form-long">
<input <input
id="side-menu-dark-mode-current-app-background-color"
name="dark-mode-current-app-background-color" name="dark-mode-current-app-background-color"
type="color" type="color"
class="side-menu-setting" class="side-menu-setting"
value="<?php print_unescaped($_['dark-mode-current-app-background-color']); ?>"> value="<?php print_unescaped($_['dark-mode-current-app-background-color']); ?>">
<div class="theme-undo icon icon-history btn-reset" data-toggle="tooltip" data-original-title="<?php echo p($l->t('Reset to default')); ?>" data-reset="<?php echo htmlentities(json_encode([
'side-menu-dark-mode-current-app-background-color' => $_['defaults']['dark-mode-current-app-background-color'],
])) ?>"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -281,10 +309,15 @@ $choicesSizes = [
</div> </div>
<div class="side-menu-setting-form side-menu-setting-form-long"> <div class="side-menu-setting-form side-menu-setting-form-long">
<input <input
id="side-menu-dark-mode-text-color"
name="dark-mode-text-color" name="dark-mode-text-color"
type="color" type="color"
class="side-menu-setting" class="side-menu-setting"
value="<?php print_unescaped($_['dark-mode-text-color']); ?>"> value="<?php print_unescaped($_['dark-mode-text-color']); ?>">
<div class="theme-undo icon icon-history btn-reset" data-toggle="tooltip" data-original-title="<?php echo p($l->t('Reset to default')); ?>" data-reset="<?php echo htmlentities(json_encode([
'side-menu-dark-mode-text-color' => $_['defaults']['dark-mode-text-color'],
])) ?>"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -296,10 +329,15 @@ $choicesSizes = [
</div> </div>
<div class="side-menu-setting-form side-menu-setting-form-long"> <div class="side-menu-setting-form side-menu-setting-form-long">
<input <input
id="side-menu-dark-mode-loader-color"
name="dark-mode-loader-color" name="dark-mode-loader-color"
type="color" type="color"
class="side-menu-setting" class="side-menu-setting"
value="<?php print_unescaped($_['dark-mode-loader-color']); ?>"> value="<?php print_unescaped($_['dark-mode-loader-color']); ?>">
<div class="theme-undo icon icon-history btn-reset" data-toggle="tooltip" data-original-title="<?php echo p($l->t('Reset to default')); ?>" data-reset="<?php echo htmlentities(json_encode([
'side-menu-dark-mode-loader-color' => $_['defaults']['dark-mode-loader-color'],
])) ?>"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -497,7 +535,6 @@ $choicesSizes = [
<div> <div>
<label for="side-menu-opener"> <label for="side-menu-opener">
<?php p($l->t('Always displayed')); ?> <?php p($l->t('Always displayed')); ?>
<small><span class="warning"><?php p($l->t('Experimental')); ?></span></small>
</label> </label>
</div> </div>
<p><em><?php p($l->t('Not compatible with touch screens.')); ?></em></p> <p><em><?php p($l->t('Not compatible with touch screens.')); ?></em></p>
@@ -660,7 +697,7 @@ $choicesSizes = [
<select id="side-menu-size-icon" name="size-icon" class="side-menu-setting"> <select id="side-menu-size-icon" name="size-icon" class="side-menu-setting">
<?php foreach ($choicesSizes as $label => $value): ?> <?php foreach ($choicesSizes as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['size-icon']): ?>selected<?php endif; ?>> <option value="<?php echo $value ?>" <?php if ($value === $_['size-icon']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?> icon <?php echo $l->t($label.' icon'); ?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
@@ -668,7 +705,7 @@ $choicesSizes = [
<select id="side-menu-size-text" name="size-text" class="side-menu-setting"> <select id="side-menu-size-text" name="size-text" class="side-menu-setting">
<?php foreach ($choicesSizes as $label => $value): ?> <?php foreach ($choicesSizes as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['size-text']): ?>selected<?php endif; ?>> <option value="<?php echo $value ?>" <?php if ($value === $_['size-text']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?> text <?php echo $l->t($label.' text'); ?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
@@ -731,7 +768,7 @@ $choicesSizes = [
<div class="side-menu-setting-table"> <div class="side-menu-setting-table">
<div class="side-menu-setting-row"> <div class="side-menu-setting-row">
<div class="side-menu-setting-label"> <div class="side-menu-setting-label">
<?php p($l->t('Apps that not must be moved in the side menu')); ?> <?php p($l->t('Apps only visible in the top menu')); ?>
</div> </div>
<div class="side-menu-setting-form"> <div class="side-menu-setting-form">
<a class="side-menu-toggler" data-target="#top-menu-apps" href="#_"> <a class="side-menu-toggler" data-target="#top-menu-apps" href="#_">
@@ -760,6 +797,39 @@ $choicesSizes = [
</div> </div>
</div> </div>
</div> </div>
<div class="side-menu-setting-table">
<div class="side-menu-setting-row">
<div class="side-menu-setting-label">
<?php p($l->t('Apps visible in the top and side menus')); ?>
</div>
<div class="side-menu-setting-form">
<a class="side-menu-toggler" data-target="#top-side-menu-apps" href="#_">
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
</a>
<div class="side-menu-setting" data-name="top-side-menu-apps" id="top-side-menu-apps" data-checkbox style="display: none">
<ul class="side-menu-setting-list">
<?php foreach ($_['apps'] as $app): ?>
<li class="side-menu-setting-list-item">
<input
type="checkbox"
name="top-side-menu-apps[]"
value="<?php echo $app['id'] ?>"
id="top-side-menu-app-<?php echo $app['id'] ?>"
<?php if (in_array($app['id'], $_['top-side-menu-apps'])): ?>checked<?php endif; ?>
/>
<label for="top-side-menu-app-<?php echo $app['id'] ?>">
<?php echo p($l->t($app['name'])); ?>
</label>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
</div> </div>
@@ -790,6 +860,60 @@ $choicesSizes = [
</div> </div>
</div> </div>
<div class="side-menu-setting-row">
<div class="side-menu-setting-label">
<?php p($l->t('Custom categories')); ?>
</div>
<div class="side-menu-setting-form">
<input type="hidden" name="categories-custom" class="side-menu-setting" data-langs="<?php echo htmlentities(json_encode($langs)) ?>" value="<?php echo htmlentities(json_encode($_['categories-custom'])) ?>">
<div id="side-menu-categories-custom">
</div>
</div>
</div>
<div class="side-menu-setting-row">
<div class="side-menu-setting-label">
<?php p($l->t('Customize application categories')); ?>
</div>
<div class="side-menu-setting-form">
<a class="side-menu-toggler" data-target="#apps-categories-custom-list" href="#_">
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
</a>
-to
<div id="apps-categories-custom-list" style="display: none">
<ul class="side-menu-setting-list">
<?php foreach ($_['apps'] as $app): ?>
<li class="side-menu-setting-list-item">
<label for="apps-categories-custom-<?php echo $app['id'] ?>">
<?php echo p($l->t($app['name'])); ?>
</label>
<br>
<select data-app="<?php echo $app['id'] ?>" class="apps-categories-custom">
<option value=""></option>
<?php foreach ($_['categories'] as $id => $category): ?>
<?php if ($category): ?>
<option
value="<?php echo $id ?>"
<?php if (($_['apps-categories-custom'][$app['id']] ?? '') === $id): ?>
selected
<?php endif; ?>
><?php echo $category ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</li>
<?php endforeach; ?>
</ul>
</div>
<input type="hidden" class="side-menu-setting" id="apps-categories-custom" name="apps-categories-custom" value="<?php echo htmlentities(json_encode($_['apps-categories-custom'])) ?>">
</div>
</div>
<div class="side-menu-setting-row"> <div class="side-menu-setting-row">
<div class="side-menu-setting-label"> <div class="side-menu-setting-label">
<?php p($l->t('Customize sorting')); ?> <?php p($l->t('Customize sorting')); ?>
@@ -870,10 +994,9 @@ $choicesSizes = [
<div class="section" id="more"> <div class="section" id="more">
<button id="side-menu-save" class="btn btn-info"> <button id="side-menu-save" class="btn btn-info">
<?php p($l->t('Save')); ?> <?php p($l->t('Save')); ?>
<progress max="100" value="0" id="side-menu-save-progress"></progress>
</button> </button>
<span id="side-menu-message" class="msg"></span>
<a href="<?php echo $urlGenerator->linkToRoute('side_menu.AdminSetting.exportConfiguration') ?>" target="_blank"> <a href="<?php echo $urlGenerator->linkToRoute('side_menu.AdminSetting.exportConfiguration') ?>" target="_blank">
<button class="btn btn-primary" > <button class="btn btn-primary" >
<?php p($l->t('Export the configuration')); ?> <?php p($l->t('Export the configuration')); ?>
+142 -90
View File
@@ -43,69 +43,73 @@ $choicesYesNo = [
<?php p($l->t('Menu')); ?> <?php p($l->t('Menu')); ?>
</h2> </h2>
<div>
<label for="side-menu-enabled">
<?php p($l->t('Enable the custom menu')); ?>
</label>
</div>
<p> <p>
<em><?php echo $l->t('Use the shortcut <span class="keyboard-key">Ctrl</span>+<span class="keyboard-key">o</span> to open and to hide the side menu. Use <span class="keyboard-key">tab</span> to navigate.'); ?></em> <em><?php echo $l->t('Use the shortcut <span class="keyboard-key">Ctrl</span>+<span class="keyboard-key">o</span> to open and to hide the side menu. Use <span class="keyboard-key">tab</span> to navigate.'); ?></em>
</p> </p>
<div> <div class="side-menu-setting-table">
<select id="side-menu-enabled" name="enabled" class="side-menu-setting" data-personal> <div class="side-menu-setting-row">
<?php foreach ($choicesYesNo as $label => $value): ?> <div class="side-menu-setting-label">
<option value="<?php echo $value ?>" <?php if ($value === $_['enabled']): ?>selected<?php endif; ?>> <?php p($l->t('Enable the custom menu')); ?>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-target-blank">
<?php p($l->t('Open apps in new tab')); ?>
</label>
</div>
<div>
<?php $choices = [
'Use the global setting' => '1',
'Use my selection' => '2',
]; ?>
<select id="side-menu-loader-enabled" name="target-blank-mode" class="side-menu-setting" data-personal>
<?php foreach ($choices as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['target-blank-mode']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<p>
<a class="side-menu-toggler" data-target="#target-blank-apps" href="#_">
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
</a>
</p>
<div class="side-menu-setting" data-name="target-blank-apps" id="target-blank-apps" data-personal data-checkbox style="display: none">
<?php foreach ($_['apps'] as $app): ?>
<div>
<input
type="checkbox"
name="target-blank-apps[]"
value="<?php echo $app['id'] ?>"
id="target-blank-app-<?php echo $app['id'] ?>"
<?php if (in_array($app['id'], $_['target-blank-apps'])): ?>checked<?php endif; ?>
/>
<label for="target-blank-app-<?php echo $app['id'] ?>">
<?php echo p($l->t($app['name'])); ?>
</label>
</div> </div>
<?php endforeach; ?> <div class="side-menu-setting-form">
<select id="side-menu-enabled" name="enabled" class="side-menu-setting" data-personal>
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['enabled']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<div class="side-menu-setting-table">
<div class="side-menu-setting-row">
<div class="side-menu-setting-label">
<?php p($l->t('Open apps in new tab')); ?>
</div>
<div class="side-menu-setting-form">
<?php $choices = [
'Use the global setting' => '1',
'Use my selection' => '2',
]; ?>
<select id="side-menu-loader-enabled" name="target-blank-mode" class="side-menu-setting" data-personal>
<?php foreach ($choices as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['target-blank-mode']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
<p>
<a class="side-menu-toggler" data-target="#target-blank-apps" href="#_">
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
</a>
</p>
<div class="side-menu-setting" data-name="target-blank-apps" id="target-blank-apps" data-personal data-checkbox style="display: none">
<ul class="side-menu-setting-list">
<?php foreach ($_['apps'] as $app): ?>
<li class="side-menu-setting-list-item">
<input
type="checkbox"
name="target-blank-apps[]"
value="<?php echo $app['id'] ?>"
id="target-blank-app-<?php echo $app['id'] ?>"
<?php if (in_array($app['id'], $_['target-blank-apps'])): ?>checked<?php endif; ?>
/>
<label for="target-blank-app-<?php echo $app['id'] ?>">
<?php echo p($l->t($app['name'])); ?>
</label>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div> </div>
</div> </div>
@@ -113,47 +117,95 @@ $choicesYesNo = [
<h2> <h2>
<?php p($l->t('Top menu')); ?> <?php p($l->t('Top menu')); ?>
</h2> </h2>
<div>
<label for="side-menu-top-menu-apps"> <div class="side-menu-setting-table">
<?php p($l->t('Apps that not must be moved in the side menu')); ?> <div class="side-menu-setting-row">
</label> <div class="side-menu-setting-label">
<?php p($l->t('Apps only visible in the top menu')); ?>
<p>
<em>
<?php p($l->t('If there is no selection then the global configuration is applied.')); ?>
</em>
</p>
</div>
<div class="side-menu-setting-form">
<p>
<a class="side-menu-toggler" data-target="#top-menu-apps" href="#_">
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
</a>
</p>
<div class="side-menu-setting" data-name="top-menu-apps" data-checkbox data-personal id="top-menu-apps" style="display: none">
<ul class="side-menu-setting-list">
<?php foreach ($_['apps'] as $app): ?>
<li class="side-menu-setting-list-item">
<input
type="checkbox"
name="top-menu-apps[]"
value="<?php echo $app['id'] ?>"
id="top-menu-app-<?php echo $app['id'] ?>"
<?php if (in_array($app['id'], $_['top-menu-apps'])): ?>checked<?php endif; ?>
/>
<label for="top-menu-app-<?php echo $app['id'] ?>">
<?php echo $app['name'] ?>
</label>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div> </div>
<p> <div class="side-menu-setting-table">
<em> <div class="side-menu-setting-row">
<?php p($l->t('If there is no selection then the global configuration is applied.')); ?> <div class="side-menu-setting-label">
</em> <?php p($l->t('Apps visible in the top and side menus')); ?>
</p> <p>
<em>
<p> <?php p($l->t('If there is no selection then the global configuration is applied.')); ?>
<a class="side-menu-toggler" data-target="#top-menu-apps" href="#_"> </em>
🖱️ <?php p($l->t('Show and hide the list of applications')); ?> </p>
</a>
</p>
<div class="side-menu-setting" data-name="top-menu-apps" data-checkbox data-personal id="top-menu-apps" style="display: none">
<?php foreach ($_['apps'] as $app): ?>
<div>
<input
type="checkbox"
name="top-menu-apps[]"
value="<?php echo $app['id'] ?>"
id="top-menu-app-<?php echo $app['id'] ?>"
<?php if (in_array($app['id'], $_['top-menu-apps'])): ?>checked<?php endif; ?>
/>
<label for="top-menu-app-<?php echo $app['id'] ?>">
<?php echo $app['name'] ?>
</label>
</div> </div>
<?php endforeach; ?> <div class="side-menu-setting-form">
<p>
<a class="side-menu-toggler" data-target="#top-side-menu-apps" href="#_">
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
</a>
</p>
<div class="side-menu-setting" data-name="top-side-menu-apps" data-checkbox data-personal id="top-side-menu-apps" style="display: none">
<ul class="side-menu-setting-list">
<?php foreach ($_['apps'] as $app): ?>
<li class="side-menu-setting-list-item">
<input
type="checkbox"
name="top-side-menu-apps[]"
value="<?php echo $app['id'] ?>"
id="top-side-menu-app-<?php echo $app['id'] ?>"
<?php if (in_array($app['id'], $_['top-side-menu-apps'])): ?>checked<?php endif; ?>
/>
<label for="top-side-menu-app-<?php echo $app['id'] ?>">
<?php echo $app['name'] ?>
</label>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div> </div>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="section"> <div class="section">
<?php if (!$_['force']): ?> <?php if (!$_['force']): ?>
<button id="side-menu-save" class="btn btn-primary"><?php p($l->t('Save')); ?></button> <button id="side-menu-save" class="btn btn-info">
<?php p($l->t('Save')); ?>
<progress max="100" value="0" id="side-menu-save-progress"></progress>
</button>
<span id="side-menu-message" class="msg"></span> <span id="side-menu-message" class="msg"></span>