side_menu/templates/settings/admin-form.php

356 lines
13 KiB
PHP

<?php
/**
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
script('side_menu', 'admin');
style('side_menu', 'admin');
style('side_menu', 'support');
$choicesYesNo = [
'No' => '0',
'Yes' => '1',
];
$choicesSizes = [
'Hidden' => 'hidden',
'Small' => 'small',
'Normal' => 'normal',
'Big' => 'big',
];
?>
<div id="side-menu-section">
<div class="section">
<h2>
<?php p($l->t('Colors')); ?>
</h2>
<div>
<label for="side-menu-background-color" class="settings-hint">
<?php p($l->t('Background color')); ?>
</label>
</div>
<div>
<input
id="side-menu-background-color"
name="background-color"
type="color"
class="side-menu-setting"
value="<?php print_unescaped($_['background-color']); ?>">
<input
id="side-menu-background-color-to"
name="background-color-to"
type="color"
class="side-menu-setting"
value="<?php print_unescaped($_['background-color-to']); ?>">
</div>
<div>
<label for="side-menu-current-app-background-color" class="settings-hint">
<?php p($l->t('Background color of current app')); ?>
</label>
</div>
<div>
<input
id="side-menu-current-app-background-color"
name="current-app-background-color"
type="color"
class="side-menu-setting"
value="<?php print_unescaped($_['current-app-background-color']); ?>">
</div>
<div>
<label for="side-menu-text-color" class="settings-hint">
<?php p($l->t('Text color')); ?>
</label>
</div>
<div>
<input
id="side-menu-text-color"
name="text-color"
type="color"
class="side-menu-setting"
value="<?php print_unescaped($_['text-color']); ?>">
</div>
<div>
<label for="side-menu-opener-only" class="settings-hint">
<?php p($l->t('Force light icons')); ?>
</label>
</div>
<div>
<select id="side-menu-force-light-icon" name="force-light-icon" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['force-light-icon']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-text-color" class="settings-hint">
<?php p($l->t('Loader')); ?>
</label>
</div>
<div>
<input
id="side-menu-loader-color"
name="loader-color"
type="color"
class="side-menu-setting"
value="<?php print_unescaped($_['loader-color']); ?>">
</div>
</div>
<div class="section">
<h2>
<?php p($l->t('Opener')); ?>
</h2>
<?php
$choices = [
'Default' => 'side-menu-opener',
'Default (dark)' => 'side-menu-opener-dark',
'Hamburger' => 'side-menu-opener-hamburger',
'Hamburger (dark)' => 'side-menu-opener-hamburger-dark',
'Hamburger 2' => 'side-menu-opener-hamburger-2',
'Hamburger 2 (dark)' => 'side-menu-opener-hamburger-2-dark',
];
?>
<div>
<label for="side-menu-opener" class="settings-hint">
<?php p($l->t('Icon')); ?>
</label>
</div>
<div>
<select id="side-menu-opener" name="opener" class="side-menu-setting">
<?php foreach ($choices as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['opener']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<?php
$choices = [
'Before the logo' => 'before',
'After the logo' => 'after',
];
?>
<div>
<label for="side-menu-opener-position" class="settings-hint">
<?php p($l->t('Position')); ?>
</label>
</div>
<div>
<select id="side-menu-opener-position" name="opener-position" class="side-menu-setting">
<?php foreach ($choices as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['opener-position']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-opener-only" class="settings-hint">
<?php p($l->t('Show only the opener (hidden logo)')); ?>
</label>
</div>
<div>
<select id="side-menu-opener-only" name="opener-only" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['opener-only']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-hide-when-no-apps" class="settings-hint">
<?php p($l->t('Do not display the side menu and the opener if there is no application (eg: public pages).')); ?>
</label>
</div>
<div>
<select id="side-menu-hide-when-no-apps" name="hide-when-no-apps" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['hide-when-no-apps']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="section">
<h2>
<?php p($l->t('Panel')); ?>
</h2>
<div>
<label for="side-menu-opener" class="settings-hint">
<?php p($l->t('Open the menu when the mouse is hover the opener (automatically disabled on touch screens)')); ?>
</label>
</div>
<p>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.</p>
<div>
<select id="side-menu-opener-hover" name="opener-hover" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['opener-hover']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-big-menu" class="settings-hint">
<?php p($l->t('Display the big menu')); ?>
</label>
</div>
<p>The big menu is not compatible with AppOrder.</p>
<div>
<select id="side-menu-big-menu" name="big-menu" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['big-menu']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-opener" class="settings-hint">
<?php p($l->t('Display the logo')); ?>
</label>
</div>
<div>
<select id="side-menu-display-logo" name="display-logo" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['display-logo']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label class="settings-hint">
<?php p($l->t('Icons and texts')); ?>
</label>
</div>
<div>
<select id="side-menu-size-icon" name="size-icon" class="side-menu-setting">
<?php foreach ($choicesSizes as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['size-icon']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?> icon
</option>
<?php endforeach; ?>
</select>
<select id="side-menu-size-text" name="size-text" class="side-menu-setting">
<?php foreach ($choicesSizes as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['size-text']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?> text
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-loader-enabled" class="settings-hint">
<?php p($l->t('Loader enabled')); ?>
</label>
</div>
<div>
<select id="side-menu-loader-enabled" name="loader-enabled" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['loader-enabled']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-external-sites-in-top-menu" class="settings-hint">
<?php p($l->t('Do not move external sites in the side menu')); ?>
<small><span class="warning">Experimental</span></small>
</label>
</div>
<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>
</div>
<div class="section">
<h2>
<?php p($l->t('Tips')); ?>
</h2>
<p class="settings-hint">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.</p>
</div>
<div class="section">
<input type="hidden" id="side-menu-cache" name="cache" value="<?php print_unescaped($_['cache']); ?>" class="side-menu-setting">
<button id="side-menu-save" class="btn btn-primary"><?php p($l->t('Save')); ?></button>
<span id="side-menu-message" class="msg"></span>
<div style="height: 30px"></div>
<div>
<span for="side-menu-opener" class="settings-hint">
<?php p($l->t('You like this app and you want to support me?')); ?>
<a style="margin-left: 10px" target="_blank" href="https://www.buymeacoffee.com/deblan">
<button>
<?php p($l->t('Buy me a coffe ☕')); ?>
</button>
</a>
</span>
</div>
</div>
</div>