/** * Theme summary screen * * @param Symfony\Component\HttpFoundation\Request $request * * @return Symfony\Component\HttpFoundation\Response */ public function themeSummaryAction(Request $request) { ThemeInstaller::assignSummaryInfo($request->get("classname"), $this->assignation, $request->getLocale()); return $this->render('steps/themeSummary.html.twig', $this->assignation); }
/** * @param Symfony\Component\HttpFoundation\Request $request * @param array $data * @param string $className */ private function addTheme(Request $request, array &$data) { $existing = $this->getService('em')->getRepository('RZ\\Roadiz\\Core\\Entities\\Theme')->findOneBy(['className' => $data["classname"]]); if ($existing !== null) { throw new EntityAlreadyExistsException($this->getTranslator()->trans('theme.%name%.no_creation.already_exists', ['%name%' => $theme->getClassName()]), 1); } $importFile = ThemeInstaller::install($request, $data["classname"], $this->getService("em")); $theme = $this->getService("em")->getRepository("RZ\\Roadiz\\Core\\Entities\\Theme")->findOneByClassName($data["classname"]); $this->setThemeValue($request, $data, $theme); $this->getService('em')->flush(); // Clear result cache $cacheDriver = $this->getService('em')->getConfiguration()->getResultCacheImpl(); if ($cacheDriver !== null) { $cacheDriver->deleteAll(); } if ($importFile === false) { return $this->redirect($this->generateUrl('themesHomePage')); } else { return $this->redirect($this->generateUrl('themesImportPage', ["id" => $theme->getId()])); } }