/**
  * @param AdaptFormEvent $event
  */
 public function adaptForm(AdaptFormEvent $event)
 {
     $searchWidget = new SearchFormWidget($event->getNode(), $this->em);
     $searchWidget->addType('node_search', new NodeSearchAdminType());
     $tabPane = $event->getTabPane();
     $tabPane->addTab(new Tab('kuma_node.tab.searcher.title', $searchWidget));
 }
 /**
  * @param AdaptFormEvent $event
  */
 public function adaptForm(AdaptFormEvent $event)
 {
     if ($event->getPage() instanceof HasNodeInterface) {
         if ($this->securityContext->isGranted('ROLE_PERMISSIONMANAGER')) {
             $tabPane = $event->getTabPane();
             $tabPane->addTab(new Tab('Permissions', new PermissionsFormWidget($event->getPage(), $event->getNode(), $this->permissionAdmin, $this->permissionMap)));
         }
     }
 }
 /**
  * @param AdaptFormEvent $event
  */
 public function adaptForm(AdaptFormEvent $event)
 {
     /** @var HasMediaSetInterface $page */
     $page = $event->getPage();
     if (false === $page instanceof HasMediaSetInterface) {
         return;
     }
     $mediaSet = $this->repository->getPageMediaSet($page);
     $type = new PageMediaCollectionAdminType($page, $this->mediaSetDefinition);
     $mediaWidget = new FormWidget($type, new ArrayCollection($mediaSet));
     $event->getTabPane()->addTab(new Tab('Media Set', $mediaWidget));
 }
 /**
  * @param AdaptFormEvent $event
  */
 public function adaptForm(AdaptFormEvent $event)
 {
     if ($event->getPage() instanceof HasNodeInterface) {
         /* @var Seo $seo */
         $seo = $this->em->getRepository('KunstmaanSeoBundle:Seo')->findOrCreateFor($event->getPage());
         $seoWidget = new FormWidget();
         $seoWidget->addType('seo', new SeoType(), $seo);
         $event->getTabPane()->addTab(new Tab('SEO', $seoWidget));
         $socialWidget = new FormWidget();
         $socialWidget->addType('social', new SocialType(), $seo);
         $event->getTabPane()->addTab(new Tab('Social', $socialWidget));
     }
 }
 /**
  * @param AdaptFormEvent $event
  */
 public function adaptForm(AdaptFormEvent $event)
 {
     if ($event->getPage() instanceof HasNodeInterface && !$event->getPage()->isStructureNode()) {
         if ($this->authorizationChecker->isGranted('ROLE_PERMISSIONMANAGER')) {
             $tabPane = $event->getTabPane();
             $tabPane->addTab(new Tab('Permissions', new PermissionsFormWidget($event->getPage(), $event->getNode(), $this->permissionAdmin, $this->permissionMap)));
         }
     }
 }
 /**
  * @param AdaptFormEvent $event
  */
 public function adaptForm(AdaptFormEvent $event)
 {
     $page = $event->getPage();
     $tabPane = $event->getTabPane();
     if ($page instanceof HasPageTemplateInterface) {
         $pageTemplateWidget = new PageTemplateWidget($page, $event->getRequest(), $this->em, $this->kernel, $this->formFactory, $this->pagePartAdminFactory);
         /* @var Tab $propertiesTab */
         $propertiesTab = $tabPane->getTabByTitle('Properties');
         if (!is_null($propertiesTab)) {
             $propertiesWidget = $propertiesTab->getWidget();
             $tabPane->removeTab($propertiesTab);
             $tabPane->addTab(new Tab("Content", new ListWidget(array($propertiesWidget, $pageTemplateWidget))), 0);
         } else {
             $tabPane->addTab(new Tab("Content", $pageTemplateWidget), 0);
         }
     } else {
         if ($page instanceof HasPagePartsInterface) {
             /* @var HasPagePartsInterface $page */
             $pagePartConfigurationReader = new PagePartConfigurationReader($this->kernel);
             $pagePartAdminConfigurators = $pagePartConfigurationReader->getPagePartAdminConfigurators($page);
             foreach ($pagePartAdminConfigurators as $index => $pagePartAdminConfiguration) {
                 $pagePartWidget = new PagePartWidget($page, $event->getRequest(), $this->em, $pagePartAdminConfiguration, $this->formFactory, $this->pagePartAdminFactory);
                 if ($index == 0) {
                     /* @var Tab $propertiesTab */
                     $propertiesTab = $tabPane->getTabByTitle('Properties');
                     if (!is_null($propertiesTab)) {
                         $propertiesWidget = $propertiesTab->getWidget();
                         $tabPane->removeTab($propertiesTab);
                         $tabPane->addTab(new Tab($pagePartAdminConfiguration->getName(), new ListWidget(array($propertiesWidget, $pagePartWidget))), 0);
                         continue;
                     }
                 }
                 $tabPane->addTab(new Tab($pagePartAdminConfiguration->getName(), $pagePartWidget), sizeof($tabPane->getTabs()));
             }
         }
     }
 }
 /**
  * @param AdaptFormEvent $event
  */
 public function adaptForm(AdaptFormEvent $event)
 {
     if ($event->getPage() instanceof HasNodeInterface && !$event->getPage()->isStructureNode()) {
         /* @var Seo $seo */
         $seo = $this->em->getRepository('KunstmaanSeoBundle:Seo')->findOrCreateFor($event->getPage());
         $seoWidget = new FormWidget();
         $seoWidget->addType('seo', new SeoType(), $seo);
         $event->getTabPane()->addTab(new Tab('seo.tab.seo.title', $seoWidget));
         $socialWidget = new FormWidget();
         $socialWidget->addType('social', new SocialType(), $seo);
         $socialWidget->setTemplate('KunstmaanSeoBundle:Admin\\Social:social.html.twig');
         $event->getTabPane()->addTab(new Tab('seo.tab.social.title', $socialWidget));
     }
 }