From 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 25 Aug 2026 22:57:22 +0000
Subject: [PATCH] =It's been a minute. I went through the Routes and associated Managers and ensured they played together well. Reworked the Cache.php, and I think I caught all the references. Moving away from JVBase() root class, to individuall classes that are Instanced. Double checked for the ABSPATH check in every file, and added index.php to every directory that didn't already have it. Also still working on the MenuBlock to work with WooCommerce for now for Northeh

---
 inc/managers/Approvals.php |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/inc/managers/ApprovalManager.php b/inc/managers/Approvals.php
similarity index 96%
rename from inc/managers/ApprovalManager.php
rename to inc/managers/Approvals.php
index 38a4f3a..58c412f 100644
--- a/inc/managers/ApprovalManager.php
+++ b/inc/managers/Approvals.php
@@ -4,19 +4,25 @@
 
 use DateTime;
 use JVBase\base\Site;
+use JVBase\Instance;
 use JVBase\registrar\Registrar;
+use JVBase\rest\Rest;
+use JVBase\rest\routes\ApprovalRoutes;
 
 if (!defined('ABSPATH')) {
 	exit;
 }
 
-class ApprovalManager {
+class Approvals {
+	use Instance;
 	protected array $tables =[];
 	protected int $expiresAt = 21; //days for request
 	protected int $requiredVotes = 3; //Number of votes before a term is approved
 	protected bool $hasApproval = false;
-	public function __construct()
+	protected Rest $route;
+	private function __construct()
 	{
+		$this->route = ApprovalRoutes::getInstance();
 		$this->defineTables();
 		if (empty($this->tables)) {
 			return;
@@ -370,7 +376,7 @@
 			]);
 
 
-		JVB()->notification()->notify($request['user_id'], $type.'approved', null, 'Your suggestion "'.$request['name'].'" was denied.');
+		NotificationManager::getInstance()->notify($request['user_id'], $type.'approved', null, 'Your suggestion "'.$request['name'].'" was denied.');
 	}
 	public function finalizeDenial(int $request_id, string $type):void
 	{
@@ -387,7 +393,7 @@
 				'request_id' => $request_id
 			]);
 
-		JVB()->notification()->notify($request['user_id'], $type.'denied', null, 'Your suggestion "'.$request['name'].'" was denied.');
+		NotificationManager::getInstance()->notify($request['user_id'], $type.'denied', null, 'Your suggestion "'.$request['name'].'" was denied.');
 	}
 
 	public function getApprovalRequests(int $userID, ?string $type = null):array

--
Gitblit v1.10.0