Fix notifications
This commit is contained in:
@@ -132,9 +132,12 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
$count = (int) $this->input->post('count');
|
||||
$offset = (int) $this->input->post('offset');
|
||||
|
||||
$returnData = ['status' => 'success', 'notifications' => []];
|
||||
|
||||
$notifications = $this->NotificationModel->getUserNotifications($_SESSION['user']['ID']);
|
||||
$notifications = $this->NotificationModel->getUserNotifications($_SESSION['user']['ID'], $count, $count * $offset);
|
||||
$returnData['notifications'] = $notifications;
|
||||
|
||||
echo json_encode($returnData);
|
||||
|
@@ -62,7 +62,6 @@
|
||||
}
|
||||
|
||||
return $result;
|
||||
// Mark as read
|
||||
}
|
||||
|
||||
private function add(Notification $notification) {
|
||||
@@ -115,6 +114,9 @@
|
||||
case 'admin.feedback':
|
||||
$items[] = new \Notification\Admin\NewFeedbackNotification($item);
|
||||
break;
|
||||
case 'admin.reportedPost':
|
||||
$items[] = new \Notification\Users\PostReportNotification($item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$groups[] = new NotificationGroup($items, $group['count']);
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
public function __get($attribute)
|
||||
{
|
||||
return $this->notifications[0]->{$attribute};
|
||||
return !empty($this->notifications) ? $this->notifications[0]->{$attribute} : null;
|
||||
}
|
||||
|
||||
public function __call($name, $arguments)
|
||||
|
@@ -90,7 +90,9 @@
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="notificationMenuButton" id="notificationMenu">
|
||||
<div class="list-group list-group-flush">
|
||||
|
||||
<div class="text-center">
|
||||
<i class="fa fa-cog fa-spin fa-4x my-4"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user