Skip to content

Commit 2788426

Browse files
committed
delete old notifications
1 parent 5f4f053 commit 2788426

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

web/css/styles.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ input[type="checkbox"] {
813813
background-color: #c4da5e;
814814
}
815815
.l-profile__notifications.updates {
816-
background-position: -202px -157px;
816+
background-position: -202px -135px;
817817
}
818818

819819
.notification-container {

web/delete/notification/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
} else {
2222
$v_username = escapeshellarg($user);
2323
$v_id = escapeshellarg((int)$_GET['notification_id']);
24-
echo VESTA_CMD."v-acknowledge-user-notification ".$v_username." ".$v_id;
2524
exec (VESTA_CMD."v-acknowledge-user-notification ".$v_username." ".$v_id, $output, $return_var);
2625
check_return_code($return_var,$output);
2726
unset($output);

web/inc/main.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,21 @@ function top_panel($user, $TAB) {
105105
}
106106
$panel = json_decode(implode('', $output), true);
107107
unset($output);
108+
109+
110+
// getting notifications
111+
$command = VESTA_CMD."v-list-user-notifications '".$user."' 'json'";
112+
exec ($command, $output, $return_var);
113+
$notifications = json_decode(implode('', $output), true);
114+
foreach($notifications as $message){
115+
if($message['ACK'] == 'no'){
116+
$panel[$user]['NOTIFICATIONS'] = 'yes';
117+
break;
118+
}
119+
}
120+
unset($output);
121+
122+
108123
if ( $user == 'admin' ) {
109124
include(dirname(__FILE__).'/../templates/admin/panel.html');
110125
} else {

web/templates/admin/panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
<!-- /.l-menu -->
2525
<div class="l-profile noselect">
26-
<a class="l-profile__notifications <? if($panel[$user]['NOTIFICATIONS'] == 'yes') echo "updates"; ?>">&nbsp;</a>
26+
<a class="l-profile__notifications <? if($panel[$user]['NOTIFICATIONS'] == 'yes') echo " updates"; ?>">&nbsp;</a>
2727
<a class="l-profile__username" href="/edit/user/?user=<?php echo $user; ?>"><?=$user?></a>
2828
<a class="l-profile__logout" href="/logout/"> <?=__('Log out')?> </a>
2929
</div>

0 commit comments

Comments
 (0)