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/admin/Integrations.php |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/inc/admin/Integrations.php b/inc/admin/Integrations.php
index e190ac2..4c59c50 100644
--- a/inc/admin/Integrations.php
+++ b/inc/admin/Integrations.php
@@ -1,6 +1,8 @@
 <?php
 namespace JVBase\admin;
 
+use JVBase\base\Site;
+use JVBase\integrations\ServiceMap;
 use JVBase\managers\IconsManager;
 use JVBase\registrar\Registrar;
 
@@ -10,6 +12,8 @@
 
 class Integrations
 {
+	use ServiceMap;
+
 	public function __construct()
 	{
 		// Hook into WordPress admin
@@ -34,17 +38,15 @@
 		);
 
 		// Add submenu pages for configured integrations
-		$integrations = JVB()->getAvailableServices(false);
-
-		foreach($integrations as $service => $integration) {
-//			if ($integration->isSetUp() && !empty($integration->enabledContentTypes())) {
-			if (!empty($integration->enabledContentTypes())) {
+		foreach ($this->getAvailableServices() as $service) {
+			$integration = $this->getService($service);
+			if ($integration->isSetUp() && method_exists($integration, 'getAllowedContent') && !empty($integration->getAllowedContent())) {
 				add_submenu_page(
 					'jvb-integrations',
 					$integration->getTitle() . ' Defaults',
 					$integration->getTitle(),
 					'manage_options',
-					'jvb-integration-'.$service,
+					'jvb-integration-'.$integration->getServiceName(),
 					[$integration, 'renderDefaults']
 				);
 			}
@@ -121,11 +123,13 @@
 
 				<div class="item-grid integrations">
 					<?php
-					$integrations = JVB()->getAvailableServices(false);
+					foreach ($this->getAvailableServices() as $service) {
+						$integration = $this->getService($service);
+						if ($integration->isSetUp() && method_exists($integration, 'renderConnection')) {
+							$integration->renderConnection();
+						}
+					}
 
-					foreach ($integrations as $service => $integration):
-						$integration->renderConnection();
-					endforeach;
 					?>
 				</div>
 			</div>

--
Gitblit v1.10.0