Example #1
0
 /**
  * {@inheritdoc}
  */
 public function updateSeoPage(SeoMetadataInterface $seoMetadata)
 {
     $site = $this->siteManager->find();
     if (null !== $site && null !== ($siteSeoMetadata = $site->getSeoMetadataByLang($seoMetadata->getLang()))) {
         $this->seoPage->setTitle($siteSeoMetadata->getTitle());
     }
     parent::updateSeoPage($seoMetadata);
 }
Example #2
0
 public function indexAction(Request $request)
 {
     $site = $this->siteManager->find();
     if (null === $site) {
         $site = $this->siteManager->create();
     }
     $form = $this->formFactory->create($site);
     if ($this->formHandler->process($request, $form)) {
         $this->formHandler->onSuccess($request->getLocale(), $site);
         return new RedirectResponse($this->router->generate('silvestra_site'));
     }
     return $this->templating->renderResponse('SilvestraSiteBundle:Site:index.html.twig', array('form' => $form->createView(), 'page_header' => $this->translator->trans('site', array(), 'SilvestraSite')));
 }
Example #3
0
 /**
  * On success.
  *
  * @param string $locale
  * @param SiteInterface $site
  */
 public function onSuccess($locale, SiteInterface $site)
 {
     $this->siteManager->save();
     $this->eventDispatcher->dispatch(SiteEvents::EDIT_SUCCESS, new SiteEvent($locale, $site));
     $alert = $this->alertManager->create();
     $alert->addSuccess($this->translator->trans('success.site_save', array(), 'SilvestraSite'));
     $this->alertManager->setFlashAlert($alert);
 }