Jake Vanderwerf
2025-10-20 e729f920139f0c65902be2d6b2c32466b08375e8
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
    */