Jake Vanderwerf
2026-05-01 48721c85ebcfa973ee81719d2467ca80e4253dc9
inc/ui/CRUDSkeleton.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\ui;
use JVBase\base\Site;
use JVBase\managers\UserTermsManager;
use JVBase\meta\Form;
use JVBase\registrar\Registrar;
@@ -217,13 +218,16 @@
   public function addTaxonomyFilter(array $taxonomies, ?string $limit = null): self {
      foreach($taxonomies as $taxonomy) {
         $registrar = Registrar::getInstance($taxonomy);
         $this->taxonomies[$taxonomy] = [
            'type'   => 'taxonomy',
            'taxonomy'=> $taxonomy,
            'limit'  => $limit,
            'label'  => $registrar->getPlural(),
            'icon'   => $registrar->getIcon()
         ];
         if ($registrar) {
            $this->taxonomies[$taxonomy] = [
               'type'   => 'taxonomy',
               'taxonomy'=> $taxonomy,
               'limit'  => $limit,
               'label'  => $registrar->getPlural(),
               'icon'   => $registrar->getIcon()
            ];
         }
      }
      return $this;
@@ -231,7 +235,7 @@
   protected function taxConfig(string $taxonomy, string $label = ''):array
   {
      $isVerified = jvbUserIsVerified();
      $isVerified = $this->userIsVerified();
      $label = ($label === '') ? Registrar::getInstance($taxonomy)->getPlural() : $label;
      return [
         'type'      => 'taxonomy',
@@ -243,6 +247,13 @@
      ];
   }
   protected function userIsVerified():bool
   {
      $membership = Site::membership();
      return !($membership && $membership->has('member_verified')) || current_user_can('skip_moderation');
   }
   public function addSearch():self
   {
      $this->hasSearch = true;
@@ -898,7 +909,7 @@
      if ($limit) {
         if ($limit === 'user') {
            $manager = new UserTermsManager();
            return $manager->getUserTerms($this->user_id, $taxonomy);
            return $manager->fetchUserTerms($this->user_id, $taxonomy);
         } else {
            $limit = (int)$limit;
         }
@@ -977,7 +988,8 @@
               <option value="<?=$control?>"<?=$disabled?>><?=$label?></option>
               <?php
            }
            foreach ($this->taxonomies as $taxonomy) {
            foreach ($this->taxonomies as $taxonomy =>$config) {
               $registrar = Registrar::getInstance($taxonomy);
               if (!$registrar) continue;
               ?>
@@ -1550,7 +1562,10 @@
         <input type="hidden" name="content" value="<?=$this->dataType?>" />
         <div class="fields">
            <?php
            echo Form::render('post_status', '', $this->getStatusFieldConfig('edit-'));
            if (!empty($this->statuses)) {
               echo Form::render('post_status', '', $this->getStatusFieldConfig('edit-'));
            }
            if (!empty($this->sections)) {
@@ -1624,7 +1639,6 @@
                  $section = (array_key_exists('section', $config)) ? $config['section'] : 'basic';
                  $tabs[$section]['content'] .= Form::render($n, '', $config);
               } else {
                  jvbDump($config, $n);
                  echo Form::render($n, '', $config);
               }
            }