From a9b3b28d001941921aa70d37fdc87c758a163a44 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 05 Jun 2026 16:47:03 +0000
Subject: [PATCH] =Some hefty changes to FeedBlock. Transitioning to loading first page in php to save on extra requests. Got a bit to do yet, but I have to work on Northeh for a bit here.
---
inc/managers/Notifications/Notifications.php | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/inc/managers/Notifications/Notifications.php b/inc/managers/Notifications/Notifications.php
index af3fd15..4700c1d 100644
--- a/inc/managers/Notifications/Notifications.php
+++ b/inc/managers/Notifications/Notifications.php
@@ -4,7 +4,7 @@
use Exception;
use JVBase\managers\CustomTable;
use JVBase\registrar\Registrar;
-use JVBase\utility\Features;
+use JVBase\base\Site;
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
@@ -30,7 +30,7 @@
'icon' => 'info',
'digest'=> true
]];
- if (Features::forSite()->has('favourites')) {
+ if (Site::has('favourites')) {
$types = array_merge($types, [
'new_favourite' => [
'icon' => 'heart',
@@ -130,11 +130,16 @@
$this->types = $types;
}
+ public function getNotificationTypes(bool $all = false):array
+ {
+ return ($all) ? $this->types : array_keys($this->types);
+ }
+
private function defineTable():void
{
$table = CustomTable::for('notifications_main');
- $typeEnum = implode(',',array_map(function($type) { return '`'.$type.'`';}, array_keys($this->types)));
+ $typeEnum = implode(',',array_map(function($type) { return "'{$type}'";}, array_keys($this->types)));
$table->setColumns([
'id' => 'bigint(20) unsigned NOT NULL AUTO_INCREMENT',
@@ -159,7 +164,7 @@
'`user_status` (`for_user`, `status`)',
'`target_lookup` (`target_id`, `target_type`)',
'`unread_notifications` (`for_user`, `status`, `created_at`)',
- '`requires_action` (`for_user`, `requires_action`, `action_taken`)',
+ '`requires_action` (`for_user`, `action_taken`)',
'`from_user_lookup` (`for_user`, `from_user`, `target_id`, `target_type`, `type`)'
]);
--
Gitblit v1.10.0