| | |
| | | <?php |
| | | namespace JVBase\admin; |
| | | |
| | | use JVBase\base\Site; |
| | | use JVBase\integrations\ServiceMap; |
| | | use JVBase\managers\IconsManager; |
| | | use JVBase\registrar\Registrar; |
| | | |
| | |
| | | |
| | | class Integrations |
| | | { |
| | | use ServiceMap; |
| | | |
| | | public function __construct() |
| | | { |
| | | // Hook into WordPress admin |
| | |
| | | ); |
| | | |
| | | // Add submenu pages for configured integrations |
| | | $integrations = JVB()->getAvailableServices(false); |
| | | |
| | | foreach($integrations as $service => $integration) { |
| | | // if ($integration->isSetUp() && !empty($integration->enabledContentTypes())) { |
| | | if (!empty($integration->enabledContentTypes())) { |
| | | foreach ($this->getAvailableServices() as $service) { |
| | | $integration = $this->getService($service); |
| | | if ($integration->isSetUp() && method_exists($integration, 'getAllowedContent') && !empty($integration->getAllowedContent())) { |
| | | add_submenu_page( |
| | | 'jvb-integrations', |
| | | $integration->getTitle() . ' Defaults', |
| | | $integration->getTitle(), |
| | | 'manage_options', |
| | | 'jvb-integration-'.$service, |
| | | 'jvb-integration-'.$integration->getServiceName(), |
| | | [$integration, 'renderDefaults'] |
| | | ); |
| | | } |
| | |
| | | |
| | | <div class="item-grid integrations"> |
| | | <?php |
| | | $integrations = JVB()->getAvailableServices(false); |
| | | foreach ($this->getAvailableServices() as $service) { |
| | | $integration = $this->getService($service); |
| | | if ($integration->isSetUp() && method_exists($integration, 'renderConnection')) { |
| | | $integration->renderConnection(); |
| | | } |
| | | } |
| | | |
| | | foreach ($integrations as $service => $integration): |
| | | $integration->renderConnection(); |
| | | endforeach; |
| | | ?> |
| | | </div> |
| | | </div> |