2020-04-09 09:55:45 +02:00
< ? 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' );
2020-04-20 19:51:54 +02:00
style ( 'side_menu' , 'support' );
2020-04-09 09:55:45 +02:00
2020-04-20 14:04:06 +02:00
$choicesYesNo = [
'No' => '0' ,
'Yes' => '1' ,
];
2020-04-25 14:25:51 +02:00
$choicesSizes = [
'Hidden' => 'hidden' ,
'Small' => 'small' ,
'Normal' => 'normal' ,
'Big' => 'big' ,
];
2020-04-09 09:55:45 +02:00
?>
2020-04-20 14:04:06 +02:00
< div id = " side-menu-section " >
< div class = " section " >
< h2 >
< ? php p ( $l -> t ( 'Colors' )); ?>
2020-09-04 16:43:27 +02:00
< small >< span class = " info " >< ? php p ( $l -> t ( 'Live preview' )); ?> </span></small>
2020-04-20 14:04:06 +02:00
</ h2 >
< div >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-background-color " >
2020-04-20 14:04:06 +02:00
< ? php p ( $l -> t ( 'Background color' )); ?>
</ label >
</ div >
< div >
< input
id = " side-menu-background-color "
name = " background-color "
type = " color "
2020-09-04 16:43:27 +02:00
class = " side-menu-setting side-menu-setting-live "
2020-04-20 14:04:06 +02:00
value = " <?php print_unescaped( $_['background-color'] ); ?> " >
2020-04-25 13:05:01 +02:00
< input
id = " side-menu-background-color-to "
name = " background-color-to "
type = " color "
2020-09-04 16:43:27 +02:00
class = " side-menu-setting side-menu-setting-live "
2020-04-25 13:05:01 +02:00
value = " <?php print_unescaped( $_['background-color-to'] ); ?> " >
2020-04-20 14:04:06 +02:00
</ div >
< div >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-current-app-background-color " >
2020-04-20 14:04:06 +02:00
< ? 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 "
2020-09-04 16:43:27 +02:00
class = " side-menu-setting side-menu-setting-live "
2020-04-20 14:04:06 +02:00
value = " <?php print_unescaped( $_['current-app-background-color'] ); ?> " >
</ div >
< div >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-text-color " >
2020-04-20 14:04:06 +02:00
< ? php p ( $l -> t ( 'Text color' )); ?>
</ label >
</ div >
< div >
< input
id = " side-menu-text-color "
name = " text-color "
type = " color "
2020-09-04 16:43:27 +02:00
class = " side-menu-setting side-menu-setting-live "
2020-04-20 14:04:06 +02:00
value = " <?php print_unescaped( $_['text-color'] ); ?> " >
</ div >
2020-05-09 14:30:24 +02:00
2020-08-13 22:24:41 +02:00
< div >
< label for = " side-menu-text-color " >
< ? 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 >
2020-05-09 14:30:24 +02:00
< div >
2020-08-13 21:22:10 +02:00
< label for = " side-menu-icon-invert-filter " >
2020-08-13 22:07:09 +02:00
< ? php p ( $l -> t ( 'Icon' )); ?>
2020-05-09 14:30:24 +02:00
</ label >
</ div >
< div >
2020-08-13 21:22:10 +02:00
< em >
< ? php p ( $l -> t ( 'Same color' )); ?>
</ em >
< input
type = " range "
min = " 0 " max = " 100 "
id = " side-menu-icon-invert-filter "
name = " icon-invert-filter "
2020-09-04 16:43:27 +02:00
class = " side-menu-setting side-menu-setting-live "
2020-08-13 21:22:10 +02:00
value = " <?php echo $_['icon-invert-filter'] ?> "
>
< em >
< ? php p ( $l -> t ( 'Opposite color' )); ?>
</ em >
2020-05-09 14:30:24 +02:00
</ div >
2020-05-19 15:17:54 +02:00
2020-08-13 22:07:09 +02:00
< div >
< em >
< ? php p ( $l -> t ( 'Transparent' )); ?>
</ em >
< input
type = " range "
min = " 0 " max = " 100 "
id = " side-menu-icon-opacity "
name = " icon-opacity "
2020-09-04 16:43:27 +02:00
class = " side-menu-setting side-menu-setting-live "
2020-08-13 22:07:09 +02:00
value = " <?php echo $_['icon-opacity'] ?> "
>
< em >
< ? php p ( $l -> t ( 'Opaque' )); ?>
</ em >
</ div >
2020-04-09 09:55:45 +02:00
</ div >
2020-04-20 19:51:54 +02:00
2020-04-20 14:04:06 +02:00
< div class = " section " >
< h2 >
< ? php p ( $l -> t ( 'Opener' )); ?>
</ h2 >
< ? php
$choices = [
'Default' => 'side-menu-opener' ,
2020-05-09 14:00:24 +02:00
'Default (dark)' => 'side-menu-opener-dark' ,
2020-04-20 14:04:06 +02:00
'Hamburger' => 'side-menu-opener-hamburger' ,
2020-05-09 14:00:24 +02:00
'Hamburger (dark)' => 'side-menu-opener-hamburger-dark' ,
2020-04-26 23:30:43 +02:00
'Hamburger 2' => 'side-menu-opener-hamburger-2' ,
2020-05-09 14:00:24 +02:00
'Hamburger 2 (dark)' => 'side-menu-opener-hamburger-2-dark' ,
2020-04-20 14:04:06 +02:00
];
?>
< div >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-opener " >
2020-04-20 14:04:06 +02:00
< ? php p ( $l -> t ( 'Icon' )); ?>
2020-09-04 16:43:27 +02:00
< small >< span class = " info " >< ? php p ( $l -> t ( 'Live preview' )); ?> </span></small>
2020-04-20 14:04:06 +02:00
</ label >
</ div >
< div >
2020-09-04 16:43:27 +02:00
< select id = " side-menu-opener " name = " opener " class = " side-menu-setting side-menu-setting-live " >
2020-04-20 14:04:06 +02:00
< ? 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 >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-opener-position " >
2020-04-20 14:04:06 +02:00
< ? php p ( $l -> t ( 'Position' )); ?>
</ label >
</ div >
< div >
2020-05-11 22:51:27 +02:00
< select id = " side-menu-opener-position " name = " opener-position " class = " side-menu-setting " >
2020-04-20 14:04:06 +02:00
< ? 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 >
2020-04-26 23:45:33 +02:00
< div >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-opener-only " >
2020-04-26 23:45:33 +02:00
< ? php p ( $l -> t ( 'Show only the opener (hidden logo)' )); ?>
</ label >
</ div >
< div >
2020-05-11 22:51:27 +02:00
< select id = " side-menu-opener-only " name = " opener-only " class = " side-menu-setting " >
2020-04-26 23:45:33 +02:00
< ? 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 >
2020-04-29 09:03:03 +02:00
< div >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-hide-when-no-apps " >
2020-04-29 09:03:03 +02:00
< ? php p ( $l -> t ( 'Do not display the side menu and the opener if there is no application (eg: public pages).' )); ?>
</ label >
</ div >
< div >
2020-05-11 22:51:27 +02:00
< select id = " side-menu-hide-when-no-apps " name = " hide-when-no-apps " class = " side-menu-setting " >
2020-04-29 09:03:03 +02:00
< ? 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 >
2020-04-09 09:55:45 +02:00
</ div >
2020-04-20 14:04:06 +02:00
< div class = " section " >
< h2 >
< ? php p ( $l -> t ( 'Panel' )); ?>
</ h2 >
< div >
2020-09-04 15:32:30 +02:00
< label >
< ? php p ( $l -> t ( 'Default' )); ?>
2020-04-20 14:04:06 +02:00
</ label >
</ div >
2020-09-04 15:32:30 +02:00
< ? php
$displays = [
'default' => ! $_ [ 'always-displayed' ] && ! $_ [ 'big-menu' ],
'always-displayed' => $_ [ 'always-displayed' ] && ! $_ [ 'big-menu' ],
'big-menu' => $_ [ 'big-menu' ],
];
?>
< p >
< img
class = " side-menu-display <?php echo $displays['default'] ? 'is-active' : '' ?> "
data - alwaysdiplayed = " 0 "
data - bigmenu = " 0 "
src = " <?php print_unescaped(image_path('side_menu', 'admin/layout-default.svg')); ?> " alt = " <?php p( $l->t ('Default')); ?> " >
</ p >
2020-08-06 15:00:59 +02:00
2020-04-20 14:04:06 +02:00
< div >
2020-09-04 15:32:30 +02:00
< label for = " side-menu-opener " >
< ? php p ( $l -> t ( 'Big menu' )); ?>
</ label >
2020-04-20 14:04:06 +02:00
</ div >
2020-09-04 15:32:30 +02:00
< p >< em >< ? php p ( $l -> t ( 'The big menu is not compatible with AppOrder.' )); ?> </em></p>
< p >
< img
class = " side-menu-display <?php echo $displays['big-menu'] ? 'is-active' : '' ?> "
data - alwaysdiplayed = " 0 "
data - bigmenu = " 1 "
src = " <?php print_unescaped(image_path('side_menu', 'admin/layout-big-menu.svg')); ?> " alt = " <?php p( $l->t ('Big menu')); ?> " >
</ p >
< br >
2020-09-03 09:46:36 +02:00
< div >
2020-09-04 15:32:30 +02:00
< label for = " side-menu-opener " >
2020-09-03 09:46:36 +02:00
< ? php p ( $l -> t ( 'Always displayed' )); ?>
< small >< span class = " warning " >< ? php p ( $l -> t ( 'Experimental' )); ?> </span></small>
</ label >
</ div >
< p >< em >< ? php p ( $l -> t ( 'Not compatible with touch screens.' )); ?> </em></p>
2020-09-04 15:32:30 +02:00
< p >
< img
class = " side-menu-display <?php echo $displays['always-displayed'] ? 'is-active' : '' ?> "
data - alwaysdiplayed = " 1 "
data - bigmenu = " 0 "
src = " <?php print_unescaped(image_path('side_menu', 'admin/layout-always-displayed.svg')); ?> " alt = " <?php p( $l->t ('Always displayed')); ?> " >
</ p >
< input type = " hidden " class = " side-menu-setting " name = " always-displayed " id = " side-menu-always-displayed " value = " <?php echo (int) $_['always-displayed'] ?> " >
< input type = " hidden " class = " side-menu-setting " name = " big-menu " id = " side-menu-big-menu " value = " <?php echo (int) $_['big-menu'] ?> " >
< br >
2020-09-03 09:46:36 +02:00
2020-08-06 15:00:59 +02:00
< div >
2020-09-04 15:32:30 +02:00
< label for = " side-menu-opener " >
< ? php p ( $l -> t ( 'Open the menu when the mouse is hover the opener (automatically disabled on touch screens)' )); ?>
2020-08-06 15:00:59 +02:00
</ label >
</ div >
2020-09-04 15:32:30 +02:00
< p >< em >< ? php p ( $l -> t ( 'This is the automatic behavior when the menu is always displayed.' )); ?> </em></p>
2020-08-06 15:00:59 +02:00
< div >
2020-09-04 15:32:30 +02:00
< select id = " side-menu-opener-hover " name = " opener-hover " class = " side-menu-setting " >
2020-08-06 15:00:59 +02:00
< ? php foreach ( $choicesYesNo as $label => $value ) : ?>
2020-09-04 15:32:30 +02:00
< option value = " <?php echo $value ?> " < ? php if ( $value === $_ [ 'opener-hover' ]) : ?> selected<?php endif; ?>>
2020-08-06 15:00:59 +02:00
< ? php echo $l -> t ( $label ); ?>
</ option >
< ? php endforeach ; ?>
</ select >
</ div >
2020-05-14 15:30:34 +02:00
2020-04-20 14:04:06 +02:00
< div >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-opener " >
2020-04-20 14:04:06 +02:00
< ? php p ( $l -> t ( 'Display the logo' )); ?>
</ label >
</ div >
2020-09-03 14:50:10 +02:00
< p >< em >< ? php echo $l -> t ( 'This feature is not compatible with the <code>big menu</code> display.' ); ?> </em></p>
2020-09-03 09:46:36 +02:00
< p >< em >< ? php p ( $l -> t ( 'The logo will be hidden when the menu is always displayed.' )); ?> </em></p>
2020-08-11 15:26:17 +02:00
2020-04-20 14:04:06 +02:00
< div >
2020-05-11 22:51:27 +02:00
< select id = " side-menu-display-logo " name = " display-logo " class = " side-menu-setting " >
2020-04-20 14:04:06 +02:00
< ? 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 >
2020-04-25 14:25:51 +02:00
< div >
2020-08-11 15:26:17 +02:00
< label >
2020-04-25 14:25:51 +02:00
< ? php p ( $l -> t ( 'Icons and texts' )); ?>
</ label >
</ div >
< div >
2020-05-11 22:51:27 +02:00
< select id = " side-menu-size-icon " name = " size-icon " class = " side-menu-setting " >
2020-04-25 14:25:51 +02:00
< ? 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 >
2020-05-11 22:51:27 +02:00
< select id = " side-menu-size-text " name = " size-text " class = " side-menu-setting " >
2020-04-25 14:25:51 +02:00
< ? 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 >
2020-05-19 15:17:54 +02:00
< ? php endforeach ; ?>
</ select >
</ div >
< div >
2020-08-11 15:26:17 +02:00
< label for = " side-menu-loader-enabled " >
2020-05-19 15:17:54 +02:00
< ? 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 >
2020-04-25 14:25:51 +02:00
< ? php endforeach ; ?>
</ select >
</ div >
2020-08-12 10:51:49 +02:00
</ div >
2020-05-09 15:53:25 +02:00
2020-08-12 10:51:49 +02:00
< div class = " section " >
< h2 >
< ? php p ( $l -> t ( 'Top menu' )); ?>
</ h2 >
2020-05-09 15:53:25 +02:00
< div >
2020-08-12 10:51:49 +02:00
< label for = " side-menu-top-menu-apps " >
< ? php p ( $l -> t ( 'Apps that not must be moved in the side menu' )); ?>
2020-05-09 15:53:25 +02:00
</ label >
</ div >
2020-08-12 10:51:49 +02:00
< 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'] ?> " >
2020-08-13 11:21:06 +02:00
< ? php echo p ( $l -> t ( $app [ 'name' ])); ?>
2020-08-12 10:51:49 +02:00
</ label >
</ div >
< ? php endforeach ; ?>
2020-05-09 15:53:25 +02:00
</ div >
2020-04-17 13:58:01 +02:00
</ div >
2020-05-14 15:30:34 +02:00
< div class = " section " >
< h2 >
< ? php p ( $l -> t ( 'Tips' )); ?>
</ h2 >
2020-08-28 16:45:02 +02:00
< 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>
</ p >
2020-05-14 15:30:34 +02:00
</ div >
2020-04-20 14:04:06 +02:00
< div class = " section " >
2020-05-11 22:51:27 +02:00
< input type = " hidden " id = " side-menu-cache " name = " cache " value = " <?php print_unescaped( $_['cache'] ); ?> " class = " side-menu-setting " >
2020-04-15 12:17:17 +02:00
2020-04-20 14:04:06 +02:00
< button id = " side-menu-save " class = " btn btn-primary " >< ? php p ( $l -> t ( 'Save' )); ?> </button>
2020-04-17 13:58:01 +02:00
2020-04-20 14:04:06 +02:00
< span id = " side-menu-message " class = " msg " ></ span >
2020-04-20 19:51:54 +02:00
< div style = " height: 30px " ></ div >
< div >
2020-08-11 15:26:17 +02:00
< span for = " side-menu-opener " >
2020-04-20 19:51:54 +02:00
< ? 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 >
2020-04-17 13:58:01 +02:00
</ div >
2020-04-09 09:55:45 +02:00
</ div >