add options to select apps that must be displayed in the top menu (replace exteral sites option)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
sideMenuContainer.attr('data-externalsitesintopmenu', '1')
|
||||
|
||||
var menuCache = null
|
||||
|
||||
var updateTopMenu = function() {
|
||||
@@ -31,7 +29,7 @@ var updateTopMenu = function() {
|
||||
return
|
||||
}
|
||||
|
||||
if (dataId.indexOf('external_index') === -1) {
|
||||
if (topMenuApps.indexOf(dataId) === -1) {
|
||||
app.classList.add('hidden')
|
||||
app.classList.add('app-hidden')
|
||||
} else {
|
||||
@@ -104,7 +104,9 @@
|
||||
sideMenuOpener.insertAfter('#nextcloud')
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($_['external-sites-in-top-menu']): ?>
|
||||
<?php require_once __DIR__.'/_externalSitesInTopMenu.js'; ?>
|
||||
<?php if (!empty($_['top-menu-apps'])): ?>
|
||||
var topMenuApps = <?php echo json_encode($_['top-menu-apps']); ?>;
|
||||
|
||||
<?php require_once __DIR__.'/_topMenuApps.js'; ?>
|
||||
<?php endif; ?>
|
||||
})();
|
||||
|
||||
@@ -311,24 +311,37 @@ $choicesSizes = [
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>
|
||||
<?php p($l->t('Top menu')); ?>
|
||||
</h2>
|
||||
<div>
|
||||
<label for="side-menu-external-sites-in-top-menu">
|
||||
<?php p($l->t('Do not move external sites in the side menu')); ?>
|
||||
<label for="side-menu-top-menu-apps">
|
||||
<?php p($l->t('Apps that not must be moved in the side menu')); ?>
|
||||
<small><span class="warning">Experimental</span></small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<p><em>Should be enabled with the <code>big menu</code> display.</em></p>
|
||||
<p><em>Selected apps will be displayed in the <code>big menu</code> display and in the top menu.</em></p>
|
||||
|
||||
<div>
|
||||
<select id="side-menu-external-sites-in-top-menu" name="external-sites-in-top-menu" class="side-menu-setting">
|
||||
<?php foreach ($choicesYesNo as $label => $value): ?>
|
||||
<option value="<?php echo $value ?>" <?php if ($value === $_['external-sites-in-top-menu']): ?>selected<?php endif; ?>>
|
||||
<?php echo $l->t($label); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="side-menu-setting" data-name="top-menu-apps" data-checkbox>
|
||||
<?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>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user