From 235ce5716edc2f7cbe80fdccf26eac7269587839 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 08 Jun 2026 04:38:18 +0000
Subject: [PATCH] =FavouritesManager.php and FavouritesRoutes.php fixes. Moving all logic to FavouritesManager.php. Still some left to do
---
base/Site.php | 83 ++++++++++++++++++++++++-----------------
1 files changed, 49 insertions(+), 34 deletions(-)
diff --git a/base/Site.php b/base/Site.php
index dfdff4d..43d194a 100644
--- a/base/Site.php
+++ b/base/Site.php
@@ -1,8 +1,6 @@
<?php
namespace JVBase\base;
-use JVBase\base\Login;
-
if (!defined('ABSPATH')) {
exit;
}
@@ -14,11 +12,21 @@
protected static Membership $membershipConfig;
protected static Site $instance;
protected static string $icons = 'regular';
+ /**
+ * @var array Dashboard config
+ */
+ protected static string $dashboardTitle;
/**
* @var bool $is_directory Whether this is a membership directory
*/
protected static bool $is_directory = false;
+ protected static string $directory_singular;
+ protected static string $directory_plural;
+ /**
+ * @var bool Whether to add a help menu to the header
+ */
+ protected static bool $help_menu = false;
/**
* @var bool $has_membership Whether this site has membership
*/
@@ -31,6 +39,7 @@
* @var bool $referrals Whether to implement a referral system, with rewards
*/
protected static bool $referrals = false;
+ protected static string $defaultReferralRole = BASE.'client';
/**
* @var bool $magic_link Whether users can login without a password
*/
@@ -81,7 +90,7 @@
public static function getInstance():Site {
if (!isset(self::$instance)) {
self::$instance = new self();
- do_action('jvbLoadDefinitions');
+ do_action('jvb_define_site');
}
return self::$instance;
}
@@ -200,35 +209,41 @@
}
return self::$membershipConfig;
}
+
+ public function setDashboardTitle(string $title):void
+ {
+ self::$dashboardTitle = $title;
+ }
+
+ public static function dashboardTitle():bool|string
+ {
+ return self::$dashboardTitle ?? false;
+ }
+
+ public function setDirectorySingular(string $title):void
+ {
+ self::$directory_singular = $title;
+ }
+ public static function getDirectorySingular():bool|string
+ {
+ return self::$directory_singular ?? false;
+ }
+
+ public function setDirectoryPlural(string $title):void
+ {
+ self::$directory_plural = $title;
+ }
+ public static function getDirectoryPlural():bool|string
+ {
+ return self::$directory_plural ?? false;
+ }
+
+ public static function setDefaultReferralRole(string $role):void
+ {
+ self::$defaultReferralRole = $role;
+ }
+ public static function getDefaultReferralRole():string
+ {
+ return self::$defaultReferralRole;
+ }
}
-
-
-$defaults = [
- 'icons' => 'light',
- 'directory' => false, //as in, a membership directory
- 'membership' => false,
- 'has_map' => false, //TODO: migrate to integrations['gmb']
- 'dashboard' => false,
- 'support' => false,
- 'feed_block' => false,
- 'email_notifications' => false,
- 'integrations' => [
- 'bluesky' => false,
- 'cloudflare' => false,
- 'facebook' => false,
- 'maps' => false,
- 'gmb' => false,
- 'helcim' => false,
- 'instagram' => false,
- 'square' => false,
- 'umami' => false,
- ],
- 'is_restaurant' => false,
- 'limit_hours' => false,
- 'enthusiast' => false,
- 'favourites' => false, //optional flag to allow enthusiasts, but not favourites
-];
-
-$jvb_site = array_merge($defaults, apply_filters('jvb_site', []));
-
-define('JVB_SITE', $jvb_site);
--
Gitblit v1.10.0