Jake Vanderwerf
2026-03-29 275c0d74cd68677622a5431505c5c870c473063d
JVBase.php
@@ -15,14 +15,17 @@
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;
use JVBase\rest\routes\IntegrationsHelcimRoutes;
use JVBase\rest\routes\NotificationsRoutes;
use JVBase\rest\routes\ContentRoutes;
use JVBase\rest\routes\TermRoutes;
@@ -30,6 +33,7 @@
//use JVBase\rest\routes\BioRoutes;
use JVBase\rest\routes\SettingsRoutes;
//use JVBase\rest\routes\ShopRoutes;
use JVBase\rest\routes\ContentTermsRoutes;
use JVBase\rest\routes\SEORoutes;
use JVBase\rest\routes\QueueRoutes;
use JVBase\rest\routes\ErrorRoutes;
@@ -43,9 +47,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;
@@ -88,17 +93,19 @@
   {
      $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(),
      ];
      $this->routes = [
@@ -127,15 +134,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();
      }
@@ -143,16 +153,17 @@
         $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();
         $this->routes['contentTax'] = new ContentTermsRoutes();
         $this->routes['options'] = new OptionsRoutes();
      }
      if (jvbSiteHasFavourites()) {
      if (Features::forSite()->has('favourites')) {
         $this->routes['favourites'] = new FavouritesRoutes();
      }
@@ -162,13 +173,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();
@@ -264,8 +275,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
@@ -364,8 +374,17 @@
      }
   }
   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'];
   }
}