From c4aa5cdb5e90ad4b420e22772797d16980232a2b Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 15 Apr 2026 18:38:55 +0000
Subject: [PATCH] =Updating custom tables to utilize CustomTable.php
---
JVBase.php | 68 +++++++++++++++++++++++-----------
1 files changed, 46 insertions(+), 22 deletions(-)
diff --git a/JVBase.php b/JVBase.php
index 6eba3a6..a4efe54 100644
--- a/JVBase.php
+++ b/JVBase.php
@@ -15,14 +15,18 @@
use JVBase\managers\ReferralManager;
use JVBase\managers\RoleManager;
//use JVBase\managers\SchemaManager;
+use JVBase\managers\SEO\render\SchemaOutput;
use JVBase\managers\SEO\SchemaOutputManager;
-use JVBase\managers\SEO\SEOAdminPage;
+use JVBase\admin\SEOAdmin;
use JVBase\managers\AdminPages;
use JVBase\managers\NotificationManager;
+use JVBase\managers\TaxonomyRelationships;
use JVBase\managers\UserTermsManager;
+use JVBase\registrar\Registrar;
use JVBase\rest\routes\FeedRoutes;
use JVBase\rest\routes\FavouritesRoutes;
use JVBase\rest\routes\IntegrationsSquareRoutes;
+use JVBase\rest\routes\IntegrationsHelcimRoutes;
use JVBase\rest\routes\NotificationsRoutes;
use JVBase\rest\routes\ContentRoutes;
use JVBase\rest\routes\TermRoutes;
@@ -44,9 +48,10 @@
use JVBase\rest\routes\VoteRoutes;
use JVBase\rest\routes\Invitations;
use JVBase\rest\routes\ApprovalRoutes;
-//use JVBase\rest\routes\AdminRoutes;
+use JVBase\rest\routes\AdminRoutes;
use JVBase\rest\routes\IntegrationsRoutes;
use JVBase\utility\Features;
+use JVBase\base\SchemaHelper;
if (!defined('ABSPATH')) {
exit;
@@ -89,17 +94,20 @@
{
$this->customBlocks = new CustomBlocks();
$this->managers = [
- 'errors' => new ErrorHandler(),
- 'queue' => new Queue(),
-// 'dash' => new DashboardManager(),
- 'roles' => new RoleManager(),
-// 'forms' => new FormManager(),
- 'schema' => new SchemaOutputManager(),
- 'admin' => new AdminPages(),
- 'seoAdmin' => new SEOAdminPage(),
-// 'uploads' => new UploadManager(),
+ 'errors' => new ErrorHandler(),
+ 'queue' => new Queue(),
+// 'dash' => new DashboardManager(),
+ 'roles' => new RoleManager(),
+// 'forms' => new FormManager(),
+// 'schema' => new SchemaOutputManager(),
+ 'admin' => new AdminPages(),
+ 'seoAdmin' => new SEOAdmin(),
+ 'seo' => new SchemaOutput(),
+ 'schemaHelper' => new SchemaHelper(),
+// 'uploads' => new UploadManager(),
'userTerms' => new UserTermsManager(),
- 'email' => new EmailManager(),
+ 'email' => new EmailManager(),
+ 'terms' => new TaxonomyRelationships(),
];
$this->routes = [
@@ -128,15 +136,18 @@
if (Features::hasIntegration('square')) {
$this->routes['square'] = new IntegrationsSquareRoutes();
}
+ if (Features::hasIntegration('helcim')) {
+ $this->routes['helcim'] = new IntegrationsHelcimRoutes();
+ }
if (Features::forSite()->has('feed_block')) {
$this->routes['feed'] = new FeedRoutes();
}
- if (jvbSiteHasNotifications()) {
+ if (Features::forMembership()->has('notifications')) {
$this->managers['notifications'] = new NotificationManager();
$this->routes['notifications'] = new NotificationsRoutes();
}
- if (Features::forSite()->has('feed_block') || jvbSiteHasDashboard()) {
+ if (Features::forSite()->has('feed_block') || Features::forSite()->has('dashboard')) {
$this->routes['term'] = new TermRoutes();
}
@@ -144,9 +155,9 @@
$this->managers['directory'] = new DirectoryManager();
}
- if (jvbSiteHasDashboard()) {
+ if (Features::forSite()->has('dashboard')) {
$this->routes['error'] = new ErrorRoutes();
-// $this->routes['admin'] = new AdminRoutes();
+ $this->routes['admin'] = new AdminRoutes();
$this->routes['content'] = new ContentRoutes();
// $this->routes['bio'] = new BioRoutes();
// $this->routes['shop'] = new ShopRoutes();
@@ -154,7 +165,7 @@
$this->routes['options'] = new OptionsRoutes();
}
- if (jvbSiteHasFavourites()) {
+ if (Features::forSite()->has('favourites')) {
$this->routes['favourites'] = new FavouritesRoutes();
}
@@ -164,13 +175,13 @@
if (Features::forMembership()->has('invitable')) {
$this->managers['invitations'] = new InvitationsManager();
}
- if (Features::anyContentHas('response') || Features::anyTaxonomyHas('response') || Features::anyUserHas('response')) {
+ if (!empty(Registrar::getFeatured('has_responses'))) {
$this->routes['comments'] = new ResponseRoutes();
}
- if (Features::anyContentHas('karma') || Features::anyTaxonomyHas('karma') || Features::anyUserHas('karma')) {
+ if (!empty(Registrar::getFeatured('karma'))) {
$this->routes['vote'] = new VoteRoutes();
}
- if (Features::anyContentHas('karma') || Features::anyTaxonomyHas('karma') || Features::anyUserHas('karma')
+ if (!empty(Registrar::getFeatured('karma'))
|| Features::forMembership()->has('member_verified') ||
Features::forMembership()->has('term_approval')) {
$this->routes['approvals'] = new ApprovalRoutes();
@@ -266,8 +277,7 @@
public function getFields($type): array
{
- $content = JVB_CONTENT[$type] ?? JVB_TAXONOMY[$type] ?? JVB_USER[$type] ?? [];
- return $content['fields'] ?? [];
+ return Registrar::getFieldsFor($type)??[];
}
public function getContent($type): mixed
@@ -366,8 +376,22 @@
}
}
+ public function seo():SchemaOutput
+ {
+ return $this->managers['seo'];
+ }
+
public function blocks():CustomBlocks|bool
{
return $this->customBlocks??false;
}
+ public function schemaHelper():SchemaHelper
+ {
+ return $this->managers['schemaHelper'];
+ }
+
+ public function termRelationships():TaxonomyRelationships
+ {
+ return $this->managers['terms'];
+ }
}
--
Gitblit v1.10.0