| | |
| | | |
| | | use JVBase\blocks\CustomBlocks; |
| | | use JVBase\integrations\BlueSky; |
| | | use JVBase\managers\cache\Cache; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\managers\EmailManager; |
| | | use JVBase\managers\ErrorHandler; |
| | | use JVBase\managers\InvitationsManager; |
| | | use JVBase\managers\LoginManager; |
| | | use JVBase\managers\MagicLinkManager; |
| | | use JVBase\managers\queue\Queue; |
| | |
| | | use JVBase\rest\routes\ContentRoutes; |
| | | use JVBase\rest\routes\TermRoutes; |
| | | use JVBase\rest\routes\UploadRoutes; |
| | | use JVBase\rest\routes\BioRoutes; |
| | | //use JVBase\rest\routes\BioRoutes; |
| | | use JVBase\rest\routes\SettingsRoutes; |
| | | use JVBase\rest\routes\ShopRoutes; |
| | | //use JVBase\rest\routes\ShopRoutes; |
| | | use JVBase\rest\routes\SEORoutes; |
| | | use JVBase\rest\routes\QueueRoutes; |
| | | use JVBase\rest\routes\ErrorRoutes; |
| | |
| | | use JVBase\rest\routes\LoginRoutes; |
| | | use JVBase\rest\routes\NewsRoutes; |
| | | use JVBase\rest\routes\ReferralRoutes; |
| | | use JVBase\rest\routes\MagicLinkRoutes; |
| | | //use JVBase\rest\routes\MagicLinkRoutes; |
| | | use JVBase\rest\routes\ResponseRoutes; |
| | | use JVBase\rest\routes\OptionsRoutes; |
| | | use JVBase\rest\routes\VoteRoutes; |
| | | use JVBase\rest\routes\Invitations; |
| | | use JVBase\rest\routes\ApprovalRoutes; |
| | | use JVBase\rest\routes\AdminRoutes; |
| | | //use JVBase\rest\routes\AdminRoutes; |
| | | use JVBase\rest\routes\IntegrationsRoutes; |
| | | use JVBase\utility\Features; |
| | | |
| | |
| | | ]; |
| | | |
| | | if (Features::forSite()->has('magicLink')) { |
| | | $this->routes['magicLink'] = new MagicLinkRoutes(); |
| | | // $this->routes['magicLink'] = new MagicLinkRoutes(); |
| | | $this->managers['magicLink'] = new MagicLinkManager(); |
| | | } |
| | | if (Features::forSite()->has('referrals')) { |
| | |
| | | |
| | | if (jvbSiteHasDashboard()) { |
| | | $this->routes['error'] = new ErrorRoutes(); |
| | | $this->routes['admin'] = new AdminRoutes(); |
| | | // $this->routes['admin'] = new AdminRoutes(); |
| | | $this->routes['content']= new ContentRoutes(); |
| | | $this->routes['bio'] = new BioRoutes(); |
| | | $this->routes['shop'] = new ShopRoutes(); |
| | | // $this->routes['bio'] = new BioRoutes(); |
| | | // $this->routes['shop'] = new ShopRoutes(); |
| | | $this->routes['options']= new OptionsRoutes(); |
| | | } |
| | | |
| | |
| | | if (Features::forMembership()->has('forum')) { |
| | | $this->routes['news'] = new NewsRoutes(); |
| | | } |
| | | if (Features::forMembership()->has('invitable')) { |
| | | $this->managers['invitations'] = new InvitationsManager(); |
| | | } |
| | | if (Features::anyContentHas('response') || Features::anyTaxonomyHas('response') || Features::anyUserHas('response')) { |
| | | $this->routes['comments'] = new ResponseRoutes(); |
| | | } |
| | |
| | | { |
| | | return array_merge(array_keys($this->content), array_keys($this->taxonomies)); |
| | | } |
| | | |
| | | public function dashboard():DashboardManager|false |
| | | { |
| | | return $this->managers['dash']??false; |
| | | } |
| | | |
| | | public function directories():DirectoryManager|false |
| | | { |
| | | return $this->managers['directory']??false; |
| | | } |
| | | |
| | | public function error():ErrorHandler |
| | | { |
| | | return $this->managers['errors']; |
| | | } |
| | | |
| | | public function file() |
| | | { |
| | | return $this->managers['file']; |
| | |
| | | { |
| | | return $this->managers['notifications']??false; |
| | | } |
| | | |
| | | public function routes($route):mixed |
| | | { |
| | | if (array_key_exists($route, $this->routes)) { |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public function roles():RoleManager |
| | | { |
| | | return $this->managers['roles']; |
| | | } |
| | | |
| | | public function admin() |
| | | { |
| | | return $this->managers['admin']; |
| | | } |
| | | |
| | | public function seoAdmin() |
| | | { |
| | | return $this->managers['seoAdmin']; |
| | |
| | | $content = JVB_CONTENT[$type]??JVB_TAXONOMY[$type]??JVB_USER[$type]??[]; |
| | | return $content['fields']??[]; |
| | | } |
| | | |
| | | public function getContent($type):mixed |
| | | { |
| | | return $this->content[$type]??$this->taxonomies[$type]??$this->blocks[$type]??null; |
| | |
| | | } |
| | | return (array_key_exists($service, $this->integrations)) ? $this->integrations[$service] : null; |
| | | } |
| | | |
| | | public function userCanConnect(string $service, int $userID):bool |
| | | { |
| | | $allowed = JVB_USER[jvbUserRole($userID)]['integrations'] ?? []; |
| | | return user_can($userID, 'manage_options') || in_array($service, $allowed); |
| | | } |
| | | public function getAvailableServices(bool $keys = true):array { |
| | | |
| | | public function getAvailableServices(bool $keys = true): array |
| | | { |
| | | |
| | | return ($keys) ? array_keys($this->integrations) : $this->integrations; |
| | | } |
| | |
| | | return $this->managers['magicLink']??false; |
| | | } |
| | | |
| | | public function invitations(): InvitationsManager|false |
| | | { |
| | | return $this->managers['invitations'] ?? false; |
| | | } |
| | | |
| | | public function additionalActions():void |
| | | { |
| | | if (LoginManager::isLogin()) { |