From e729f920139f0c65902be2d6b2c32466b08375e8 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 20 Oct 2025 17:54:52 +0000
Subject: [PATCH] =Form updates
---
inc/utility/Features.php | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/inc/utility/Features.php b/inc/utility/Features.php
index c0ae652..9eaa314 100644
--- a/inc/utility/Features.php
+++ b/inc/utility/Features.php
@@ -92,6 +92,29 @@
}
return $feature->has($integration);
}
+
+ public static function hasAnyIntegration(string $type = 'site', ?string $subType = null):bool
+ {
+ $allowedTypes = ['site', 'content', 'taxonomy', 'user'];
+ if (!in_array($type, $allowedTypes)) {
+ return false;
+ }
+ if (in_array($type, ['content', 'taxonomy', 'user']) && !$subType) {
+ return false;
+ }
+ switch ($type) {
+ case 'site':
+ return (array_key_exists('integrations', JVB_SITE) && !empty(JVB_SITE['integrations']));
+ case 'content':
+ return (array_key_exists($subType, JVB_CONTENT) && array_key_exists('integrations', JVB_CONTENT[$subType]) && !empty(JVB_CONTENT[$subType]['integrations']));
+ case 'taxonomy':
+ return (array_key_exists($subType, JVB_TAXONOMY) && array_key_exists('integrations', JVB_TAXONOMY[$subType]) && !empty(JVB_TAXONOMY[$subType]['integrations']));
+ case 'user':
+ return (array_key_exists($subType, JVB_USER) && array_key_exists('integrations', JVB_USER[$subType]) && !empty(JVB_USER[$subType]['integrations']));
+ default:
+ return false;
+ }
+ }
/**
* Create from a specific taxonomy
*/
--
Gitblit v1.10.0