This commit is contained in:
Joey Kimsey
2025-02-25 14:03:12 -05:00
parent c40b29e812
commit 46390c2447
21 changed files with 197 additions and 60 deletions

View File

@ -121,21 +121,21 @@ class Notification extends DatabaseModel {
return true;
}
public function filter( $messageArray, $filters = [] ) {
public function filter( $entities, $filters = [] ) {
$out = [];
foreach ( $messageArray as $message ) {
if ( !is_object( $message ) ) {
$message = $messageArray;
foreach ( $entities as $entity ) {
if ( !is_object( $entity ) ) {
$entity = $entities;
$end = true;
}
if ( $message->seenAt == 0 ) {
$message->unseenBadge = Views::simpleView( 'notifications.unseenBadge' );
$message->markReadLink = '<a href="{ROOT_URL}notifications/markRead/'.$message->ID.'" class="btn btn-sm btn-primary"><i class="fa-solid fa-fw fa-envelope-open"></i></a>';
if ( $entity->seenAt == 0 ) {
$entity->unseenBadge = Views::simpleView( 'notifications.unseenBadge' );
$entity->markReadLink = '<a href="{ROOT_URL}notifications/markRead/'.$entity->ID.'" class="btn btn-sm btn-primary"><i class="fa-solid fa-fw fa-envelope-open"></i></a>';
} else {
$message->unseenBadge = '';
$message->markReadLink = '';
$entity->unseenBadge = '';
$entity->markReadLink = '';
}
$out[] = (object) $message;
$out[] = (object) $entity;
if ( !empty( $end ) ) {
$out = $out[0];
break;