diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index c26bed8762..1edcf76b77 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -16,6 +16,7 @@ require_once ("include/functions_messages.php"); require_once ('include/functions_servers.php'); +require_once ('include/functions_notifications.php'); // Check permissions @@ -65,6 +66,7 @@ config_check(); $table->style[8] = $table->style[9] = $table->style['qr'] = + $table->style['notifications'] = 'width: 22px; text-align:center; height: 22px; padding-right: 9px;padding-left: 9px;'; $table->style[7] = 'width: 20px; padding-right: 9px;'; $table->style['searchbar'] = 'width: 180px; min-width: 180px;'; @@ -360,7 +362,7 @@ config_check(); $table->data[0][9] .= ''; } - + $table->data[0]['notifications'] = notifications_print_ball(); html_print_table($table); diff --git a/pandora_console/include/functions_notifications.php b/pandora_console/include/functions_notifications.php index 3005e9a47c..5c9bb71885 100644 --- a/pandora_console/include/functions_notifications.php +++ b/pandora_console/include/functions_notifications.php @@ -147,3 +147,19 @@ function check_notification_readable(int $id_message) return (bool) db_get_value_sql($sql); } + +/** + * Print the notification ball to see unread messages + * + * @return string with HTML code of notification ball + */ +function notifications_print_ball() { + $num_notifications = messages_get_count(); + $class_status = $num_notifications == 0 + ? 'notification-ball-no-messages' + : 'notification-ball-new-messages'; + return + "