New notification option: auto-closure time

This commit is contained in:
bergware
2023-08-22 11:59:45 +02:00
parent 55406f2925
commit f5083b3e58
3 changed files with 10 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ $disabled = $notify['system'] ? '' : 'disabled';
?>
<style>
select.a{min-width:220px}
input.a{width:220px}
span.a{display:inline-block;width:220px;font-style:italic}
</style>
<script>
@@ -123,6 +124,9 @@ _(Notifications display)_:
:notifications_display_help:
_(Notifications auto-closure time)_ (_(seconds)_):
: <input type="number" name="closure" class="a" min="0" max="60" value="<?=$notify['closure']?>"> _(a value of zero means no auto-closure)_
_(Date format)_:
: <select name="date" class="a">
<?=mk_option($notify['date'], "d-m-Y", _("DD-MM-YYYY"))?>

View File

@@ -41,6 +41,7 @@ cron=""
write="NOCORRECT"
[notify]
display="0"
closure="3"
date="d-m-Y"
time="H:i"
position="top-right"

View File

@@ -559,7 +559,11 @@ $(function() {
$.jGrowl.defaults.theme = '';
$.jGrowl.defaults.themeState = '';
$.jGrowl.defaults.pool = 10;
$.jGrowl.defaults.life = 3000;
<?if ($notify['closure'] > 0):?>
$.jGrowl.defaults.life = <?=$notify['closure']*1000?>;
<?else:?>
$.jGrowl.defaults.sticky = true;
<?endif;?>
Shadowbox.setup('a.sb-enable', {modal:true});
// add any pre-existing reboot notices
$.post('/webGui/include/Report.php',{cmd:'notice'},function(notices){