Browse Source

add option to hide apps (big menu display)

develop
Simon Vieille 3 weeks ago
parent
commit
02825cee67
Signed by: deblan GPG Key ID: 03383D15A1D31745
4 changed files with 41 additions and 2 deletions
  1. +1
    -0
      lib/Controller/JsController.php
  2. +5
    -0
      lib/Controller/NavController.php
  3. +1
    -0
      lib/Settings/Admin.php
  4. +34
    -2
      templates/settings/admin-form.php

+ 1
- 0
lib/Controller/JsController.php View File

@ -150,6 +150,7 @@ class JsController extends Controller
'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'),
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
'big-menu' => $this->config->getAppValueBool('big-menu', '0'),
'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'),
'avatar' => $avatar,
'top-menu-apps' => $topMenuApps,
'target-blank-apps' => $targetBlankApps,

+ 5
- 0
lib/Controller/NavController.php View File

@ -97,6 +97,7 @@ class NavController extends Controller
$apps = $this->appRepository->getVisibleApps();
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
$externalSitesInTopMenu = $this->config->getAppValueBool('external-sites-in-top-menu', '0');
$hiddenApps = $this->config->getAppValueArray('big-menu-hidden-apps', '[]');
$user = OC::$server[IUserSession::class]->getUser();
$isForced = $this->config->getAppValueBool('force', '0');
$appsCategories = [];
@ -142,6 +143,10 @@ class NavController extends Controller
continue;
}
if (in_array($app['id'], $hiddenApps)) {
continue;
}
$categories = (array) $app['category'];
$appsCategories[$app['id']] = [];

+ 1
- 0
lib/Settings/Admin.php View File

@ -77,6 +77,7 @@ class Admin implements ISettings
'opener' => $this->config->getAppValue('opener', 'side-menu-opener'),
'always-displayed' => $this->config->getAppValue('always-displayed', '0'),
'big-menu' => $this->config->getAppValue('big-menu', '0'),
'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'),
'display-logo' => $this->config->getAppValue('display-logo', '1'),
'use-avatar' => $this->config->getAppValue('use-avatar', '0'),
'opener-position' => $this->config->getAppValue('opener-position', 'before'),

+ 34
- 2
templates/settings/admin-form.php View File

@ -288,8 +288,6 @@ $choicesSizes = [
src="<?php print_unescaped(image_path('side_menu', 'admin/layout-big-menu.svg')); ?>" alt="<?php p($l->t('Big menu')); ?>">
</p>
<br>
<div>
<label for="side-menu-opener">
<?php p($l->t('Always displayed')); ?>
@ -361,6 +359,40 @@ $choicesSizes = [
</select>
</div>
<div>
<label for="side-menu-top-menu-apps">
<?php p($l->t('Apps that not must show in the menu')); ?>
</label>
</div>
<p><em><?php echo $l->t('This feature is only compatible with the <code>big menu</code> display.'); ?></em></p>
<p>
<a class="side-menu-toggler" data-target="#big-menu-hidden-apps" href="#_">
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
</a>
</p>
<div class="side-menu-setting" data-name="big-menu-hidden-apps" id="big-menu-hidden-apps" data-checkbox style="display: none">
<?php foreach ($_['apps'] as $app): ?>
<div>
<input
type="checkbox"
name="big-menu-hidden-apps[]"
value="<?php echo $app['id'] ?>"
id="big-menu-hidden-app-<?php echo $app['id'] ?>"
<?php if (in_array($app['id'], $_['big-menu-hidden-apps'])): ?>checked<?php endif; ?>
/>
<label for="big-menu-hidden-app-<?php echo $app['id'] ?>">
<?php echo p($l->t($app['name'])); ?>
</label>
</div>
<?php endforeach; ?>
</div>
<br>
<div>
<label for="side-menu-show-settings">
<?php p($l->t('Show the link to settings')); ?>

Loading…
Cancel
Save