File tree Expand file tree Collapse file tree 6 files changed +27
-16
lines changed
Expand file tree Collapse file tree 6 files changed +27
-16
lines changed Original file line number Diff line number Diff line change 44#
55# example: v-list-user-notifications admin
66#
7- # This function for getting the list notifications
7+ # This function for getting the notifications list
88
99# ----------------------------------------------------------#
1010# Variables & Functions #
Original file line number Diff line number Diff line change 22
33To view your notifications, click the <i class =" fas fa-lg fa-fw fa-bell " ><span class =" visually-hidden " >notification</span ></i > icon in the top right.
44
5- You can dismiss a notification by clicking the small red circle on its right.
5+ You can delete a notification by clicking the small red "X" on the top right.
Original file line number Diff line number Diff line change 22// Main include
33include $ _SERVER ["DOCUMENT_ROOT " ] . "/inc/main.php " ;
44
5+ function formatNotificationTimestamps (&$ note ) {
6+ $ dateTime = DateTime::createFromFormat ("Y-m-d H:i:s " , $ note ["DATE " ] . " " . $ note ["TIME " ]);
7+ $ note ["TIMESTAMP_TEXT " ] = $ dateTime ->format ("d M Y, H:i " );
8+ $ note ["TIMESTAMP_ISO " ] = $ dateTime ->format (DateTime::ATOM ); // ISO 8601 format
9+ $ note ["TIMESTAMP_TITLE " ] = $ dateTime ->format ("d F Y, H:i:s " );
10+ }
11+
512if ($ _REQUEST ["ajax " ] == 1 && $ _REQUEST ["token " ] == $ _SESSION ["token " ]) {
613 // Data
714 exec (HESTIA_CMD . "v-list-user-notifications $ user json " , $ output , $ return_var );
815 $ data = json_decode (implode ("" , $ output ), true );
916
10- function sort_priorty_id ($ element1 , $ element2 ) {
17+ foreach ($ data as $ key => &$ note ) {
18+ formatNotificationTimestamps ($ note );
19+ }
20+ unset($ note );
21+
22+ function sort_priority_id ($ element1 , $ element2 ) {
1123 return $ element2 ["PRIORITY " ] <=> $ element1 ["PRIORITY " ];
1224 }
1325 $ data = array_reverse ($ data , true );
14- usort ($ data , sort_priorty_id (...) );
26+ usort ($ data , " sort_priority_id " );
1527
1628 foreach ($ data as $ key => $ note ) {
1729 $ note ["ID " ] = $ key ;
Original file line number Diff line number Diff line change @@ -114,8 +114,9 @@ class="top-bar-notification-delete"
114114 <div class="top-bar-notification-content" x-html="notification.NOTICE"></div>
115115 <p class="top-bar-notification-timestamp">
116116 <time
117- :datetime="`${notification.DATE}T${notification.TIME}`"
118- x-text="`${notification.TIME} ${notification.DATE}`"
117+ :datetime="`${notification.TIMESTAMP_ISO}`"
118+ x-bind:title="`${notification.TIMESTAMP_TITLE}`"
119+ x-text="`${notification.TIMESTAMP_TEXT}`"
119120 ></time>
120121 </p>
121122 </li>
Original file line number Diff line number Diff line change 2525 <div class="u-side-by-side-tablet u-mb20">
2626 <h1><?= _ ("Add Cron Job " ) ?> </h1>
2727 <p>
28- <?= _ ('System time ' ) ?> : <span class="u-text-bold">
29- <time datetime="<?= date ("c " , $ current_timestamp ) ?> ">
30- <?= date ("d M Y, H:i " , $ current_timestamp ) ?>
31- </time>
32- </span>
28+ <?= _ ('System time ' ) ?> :
29+ <time datetime="<?= date ("c " , $ current_timestamp ) ?> " class="u-text-bold">
30+ <?= date ("d M Y, H:i " , $ current_timestamp ) ?>
31+ </time>
3332 </p>
3433 </div>
3534 <?php show_alert_message ($ _SESSION ); ?>
Original file line number Diff line number Diff line change 2525 <div class="u-side-by-side-tablet u-mb20">
2626 <h1><?= _ ("Edit Cron Job " ) ?> </h1>
2727 <p>
28- <?= _ ('System time ' ) ?> : <span class="u-text-bold">
29- <time datetime="<?= date ("c " , $ current_timestamp ) ?> ">
30- <?= date ("d M Y, H:i " , $ current_timestamp ) ?>
31- </time>
32- </span>
28+ <?= _ ('System time ' ) ?> :
29+ <time datetime="<?= date ("c " , $ current_timestamp ) ?> " class="u-text-bold">
30+ <?= date ("d M Y, H:i " , $ current_timestamp ) ?>
31+ </time>
3332 </p>
3433 </div>
3534 <?php show_alert_message ($ _SESSION ); ?>
You can’t perform that action at this time.
0 commit comments