Esempio n. 1
0
 /**
  * Get frontend root node.
  *
  * @param string $locale
  *
  * @return Node
  */
 public function getRootNode($locale)
 {
     $rootNode = $this->sitemapProvider->getRootNode();
     $translation = $rootNode->getTranslation($locale);
     if (null === $translation) {
         $translation = $this->createBackendNodeTranslation($rootNode, $this->getTitle($rootNode, $locale), $locale);
         $rootNode->addTranslation($translation);
         $this->nodeTranslationManager->save();
     }
     return $this->createFrontendNode($rootNode, $translation->getTitle(), $this->hasChildren($rootNode), $this->getIcon($rootNode));
 }
 /**
  * On success.
  *
  * @param string $locale
  * @param NodeInterface $node
  *
  * @return string
  */
 public function onSuccess($locale, NodeInterface $node)
 {
     $this->eventDispatcher->dispatch(TadckaTreeEvents::NODE_EDIT_SUCCESS, new TreeNodeEvent($locale, $node));
     $this->nodeTranslationManager->save();
     return $this->translator->trans('success.node_redirect_route_save', array(), 'TadckaSitemapBundle');
 }