| | |
| | | namespace JVBase\rest\routes; |
| | | |
| | | use JVBase\managers\CustomTable; |
| | | use JVBase\registrar\Registrar; |
| | | use JVBase\rest\PermissionHandler; |
| | | use JVBase\rest\Rest; |
| | | use JVBase\rest\Route; |
| | |
| | | |
| | | protected function initTypes():void |
| | | { |
| | | $approvals = jvbApprovalTypes(); |
| | | $this->userTypes = []; |
| | | $this->termTypes = []; |
| | | if ($this->hasMemberApproval) { |
| | | $this->userTypes = array_filter( |
| | | array_keys($approvals), |
| | | function ($item) { |
| | | return $item !== 'term'; |
| | | } |
| | | ); |
| | | $this->userTypes = Registrar::getFeatured('approve_new', 'user'); |
| | | $this->allTypes = $this->userTypes; |
| | | } |
| | | if (jvbSiteHasTermApproval()) { |
| | | $this->termTypes = $approvals['term']??[]; |
| | | if (Features::forSite()->has('term_approval')) { |
| | | $this->termTypes = Registrar::getFeatured('approve_new', 'term'); |
| | | $this->allTypes[] = 'term'; |
| | | } |
| | | } |