forked from deblan/side_menu
Reviewed-on: deblan/side_menu#87
This commit is contained in:
commit
fef936bef0
|
@ -1,12 +1,18 @@
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
|
@ -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.
|
||||||
|
|
||||||
|
|
|
@ -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.3.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>
|
||||||
<namespace>SideMenu</namespace>
|
<namespace>SideMenu</namespace>
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
43
lib/Service/LangRepository.php
Normal file
43
lib/Service/LangRepository.php
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<?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="lang" and appid="core" and configvalue<>"en"')
|
||||||
|
->from('preferences')
|
||||||
|
;
|
||||||
|
|
||||||
|
$stmt = $qb->execute();
|
||||||
|
|
||||||
|
$langs = ['en'];
|
||||||
|
|
||||||
|
foreach ($stmt->fetchAll() as $result) {
|
||||||
|
$langs[] = $result['configvalue'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $langs;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -139,11 +147,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, '');
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
|
@ -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"
|
||||||
|
|
182
src/AdminCategoriesCustom.vue
Normal file
182
src/AdminCategoriesCustom.vue
Normal 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>
|
40
src/admin.js
40
src/admin.js
|
@ -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'
|
||||||
|
@ -80,10 +86,11 @@ const saveSettings = (key) => {
|
||||||
t('side_menu', (key + 1) + '/' + size)
|
t('side_menu', (key + 1) + '/' + size)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (key < size) {
|
if (key < size - 1) {
|
||||||
saveSettings(key + 1)
|
saveSettings(key + 1)
|
||||||
} else {
|
} else {
|
||||||
OC.msg.finishedSuccess(selector, t('side_menu', 'Saved'))
|
OC.msg.finishedSuccess(selector, t('side_menu', 'Saved! Page is reloading...'))
|
||||||
|
location.reload()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
|
@ -108,7 +115,29 @@ 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', () => {
|
||||||
|
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) => {
|
||||||
|
@ -134,6 +163,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 +231,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'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,3 +77,8 @@
|
||||||
"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"
|
||||||
|
|
|
@ -77,3 +77,7 @@
|
||||||
"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"
|
||||||
|
|
|
@ -77,3 +77,7 @@
|
||||||
"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"
|
||||||
|
|
|
@ -77,3 +77,7 @@
|
||||||
"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": "顶部和侧边菜单中可见的应用程序"
|
||||||
|
|
|
@ -52,7 +52,7 @@ 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 {
|
||||||
|
|
|
@ -186,8 +186,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; ?>
|
||||||
|
|
|
@ -497,7 +497,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>
|
||||||
|
@ -731,7 +730,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 +759,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 +822,61 @@ $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')); ?>
|
||||||
|
<small><span class="warning"><?php p($l->t('Experimental')); ?></span></small>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<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')); ?>
|
||||||
|
|
|
@ -43,17 +43,16 @@ $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">
|
||||||
|
<div class="side-menu-setting-row">
|
||||||
|
<div class="side-menu-setting-label">
|
||||||
|
<?php p($l->t('Enable the custom menu')); ?>
|
||||||
|
</div>
|
||||||
|
<div class="side-menu-setting-form">
|
||||||
<select id="side-menu-enabled" name="enabled" class="side-menu-setting" data-personal>
|
<select id="side-menu-enabled" name="enabled" class="side-menu-setting" data-personal>
|
||||||
<?php foreach ($choicesYesNo as $label => $value): ?>
|
<?php foreach ($choicesYesNo as $label => $value): ?>
|
||||||
<option value="<?php echo $value ?>" <?php if ($value === $_['enabled']): ?>selected<?php endif; ?>>
|
<option value="<?php echo $value ?>" <?php if ($value === $_['enabled']): ?>selected<?php endif; ?>>
|
||||||
|
@ -62,14 +61,15 @@ $choicesYesNo = [
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div>
|
|
||||||
<label for="side-menu-target-blank">
|
|
||||||
<?php p($l->t('Open apps in new tab')); ?>
|
|
||||||
</label>
|
|
||||||
</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 = [
|
<?php $choices = [
|
||||||
'Use the global setting' => '1',
|
'Use the global setting' => '1',
|
||||||
'Use my selection' => '2',
|
'Use my selection' => '2',
|
||||||
|
@ -82,7 +82,6 @@ $choicesYesNo = [
|
||||||
</option>
|
</option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a class="side-menu-toggler" data-target="#target-blank-apps" href="#_">
|
<a class="side-menu-toggler" data-target="#target-blank-apps" href="#_">
|
||||||
|
@ -91,8 +90,9 @@ $choicesYesNo = [
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="side-menu-setting" data-name="target-blank-apps" id="target-blank-apps" data-personal data-checkbox style="display: none">
|
<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): ?>
|
<?php foreach ($_['apps'] as $app): ?>
|
||||||
<div>
|
<li class="side-menu-setting-list-item">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name="target-blank-apps[]"
|
name="target-blank-apps[]"
|
||||||
|
@ -104,8 +104,12 @@ $choicesYesNo = [
|
||||||
<label for="target-blank-app-<?php echo $app['id'] ?>">
|
<label for="target-blank-app-<?php echo $app['id'] ?>">
|
||||||
<?php echo p($l->t($app['name'])); ?>
|
<?php echo p($l->t($app['name'])); ?>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -113,18 +117,18 @@ $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">
|
|
||||||
<?php p($l->t('Apps that not must be moved in the side menu')); ?>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="side-menu-setting-table">
|
||||||
|
<div class="side-menu-setting-row">
|
||||||
|
<div class="side-menu-setting-label">
|
||||||
|
<?php p($l->t('Apps only visible in the top menu')); ?>
|
||||||
<p>
|
<p>
|
||||||
<em>
|
<em>
|
||||||
<?php p($l->t('If there is no selection then the global configuration is applied.')); ?>
|
<?php p($l->t('If there is no selection then the global configuration is applied.')); ?>
|
||||||
</em>
|
</em>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="side-menu-setting-form">
|
||||||
<p>
|
<p>
|
||||||
<a class="side-menu-toggler" data-target="#top-menu-apps" href="#_">
|
<a class="side-menu-toggler" data-target="#top-menu-apps" href="#_">
|
||||||
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
|
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
|
||||||
|
@ -132,8 +136,9 @@ $choicesYesNo = [
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="side-menu-setting" data-name="top-menu-apps" data-checkbox data-personal id="top-menu-apps" style="display: none">
|
<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): ?>
|
<?php foreach ($_['apps'] as $app): ?>
|
||||||
<div>
|
<li class="side-menu-setting-list-item">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name="top-menu-apps[]"
|
name="top-menu-apps[]"
|
||||||
|
@ -145,8 +150,52 @@ $choicesYesNo = [
|
||||||
<label for="top-menu-app-<?php echo $app['id'] ?>">
|
<label for="top-menu-app-<?php echo $app['id'] ?>">
|
||||||
<?php echo $app['name'] ?>
|
<?php echo $app['name'] ?>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
</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')); ?>
|
||||||
|
<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-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 ?>
|
||||||
|
|
Loading…
Reference in a new issue