From f4be611c51473359e6d41780f0313c446079e9d3 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 09 Jun 2026 15:19:24 +0000
Subject: [PATCH] =Switched the /base/options.php to the same pattern as Site.php: a class based approached rather than a filter. Updated Meta.php to play along with the defined fields from there in Meta::forOptions. Had to change openingHoursSpecificationsTrait.php to not use the translater functions __('text','textdomain') for now, as we load before init.
---
checks.php | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/checks.php b/checks.php
index d968100..79cc829 100644
--- a/checks.php
+++ b/checks.php
@@ -1,5 +1,6 @@
<?php
+use JVBase\base\Options;
use JVBase\base\Site;
use JVBase\managers\Cache;
use JVBase\registrar\Registrar;
@@ -18,22 +19,21 @@
}
-//function jvbIsOpen():bool
-//{
-//
-// if (!jvbCheck('limit_hours', JVB_SITE)) {
-// return true;
-// }
-// if (get_option(BASE.'open_to_public') !== '1') {
-// return false;
-// }
-// //Check if today_hours is set
-// if (get_option(BASE.'today_hours')) {
-// return jvbIsTimeBetween();
-// }
-// //Default to the stored settings
-// return jvbIsCurrentlyOpen();
-//}
+
+function jvbIsOpen():bool
+{
+ if (!Site::has('limit_hours')) {
+ return true;
+ }
+ if (Options::get('open_to_public') !== 1) {
+ error_log('Not open to public');
+ return false;
+ }
+ if (Options::get('today_hours')) {
+ return jvbIsTimeBetween();
+ }
+ return jvbIsCurrentlyOpen();
+}
function jvbTermHasPosts(int $termID, string $taxonomy):bool
--
Gitblit v1.10.0