/**
  * If the language has been changed, set a cookie with the new default language and force a page reload
  */
 public function onLanguageChange()
 {
     if ($this->request->getPost()->has('lang')) {
         setcookie('ACP3_INSTALLER_LANG', $this->request->getPost()->get('lang', ''), time() + 3600, '/');
         $this->redirect->temporary($this->request->getFullPath())->send();
         exit;
     }
 }
Example #2
0
 /**
  * Sets a redirect messages and redirects to the given internal path
  *
  * @param int|bool    $success
  * @param string      $text
  * @param string|null $path
  *
  * @return \Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function setMessage($success, $text, $path = null)
 {
     $this->sessionHandler->set('redirect_message', ['success' => is_int($success) ? true : (bool) $success, 'text' => $text]);
     // If no path has been given, guess it automatically
     if ($path === null) {
         $path = $this->request->getModuleAndController();
     }
     return $this->redirect->temporary($path);
 }
Example #3
0
 /**
  * @param \Exception $exception
  * @param \ACP3\Core\Http\RedirectResponse $redirect
  * @param string $route
  * @return Response
  */
 private function handleException(\Exception $exception, RedirectResponse $redirect, $route)
 {
     if ($this->appMode === ApplicationMode::DEVELOPMENT) {
         return $this->renderApplicationException($exception);
     }
     return $redirect->temporary($route);
 }