From 772462eeca3002a1d52508aeba485aab2b4742ad Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 03 Mar 2026 19:06:19 +0000
Subject: [PATCH] =MAJOR OVERHAUL. Likely should have made a new branch ages ago. Key changes: Registrar.php is the base for custom post types, taxonomies, and user roles. Replaces JVB_CONTENT, JVB_TAXONOMY, and JVB_USER constants, eliminates most of Features.php (except for JVB_SITE, JVB_MEMBERSHIP), and has built in sanitizing and validation via sub-classes. Also started a major overhaul of the Schema output. Created a shit ton of property traits and classes to help sanitize and ensure proper data for different schema types. Still a bunch to do, but better to be starting committing changes here on this other branch.
---
JVBase.php | 47 +++++++++++++++++++++++++++--------------------
1 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/JVBase.php b/JVBase.php
index 3de959a..c5f383f 100644
--- a/JVBase.php
+++ b/JVBase.php
@@ -15,11 +15,13 @@
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\UserTermsManager;
+use JVBase\registrar\Registrar;
use JVBase\rest\routes\FeedRoutes;
use JVBase\rest\routes\FavouritesRoutes;
use JVBase\rest\routes\IntegrationsSquareRoutes;
@@ -90,17 +92,18 @@
{
$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(),
+// 'uploads' => new UploadManager(),
'userTerms' => new UserTermsManager(),
- 'email' => new EmailManager(),
+ 'email' => new EmailManager(),
];
$this->routes = [
@@ -136,11 +139,11 @@
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();
}
@@ -148,7 +151,7 @@
$this->managers['directory'] = new DirectoryManager();
}
- if (jvbSiteHasDashboard()) {
+ if (Features::forSite()->has('dashboard')) {
$this->routes['error'] = new ErrorRoutes();
$this->routes['admin'] = new AdminRoutes();
$this->routes['content'] = new ContentRoutes();
@@ -158,7 +161,7 @@
$this->routes['options'] = new OptionsRoutes();
}
- if (jvbSiteHasFavourites()) {
+ if (Features::forSite()->has('favourites')) {
$this->routes['favourites'] = new FavouritesRoutes();
}
@@ -168,13 +171,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();
@@ -270,8 +273,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
@@ -370,6 +372,11 @@
}
}
+ public function seo():SchemaOutput
+ {
+ return $this->managers['seo'];
+ }
+
public function blocks():CustomBlocks|bool
{
return $this->customBlocks??false;
--
Gitblit v1.10.0