Beispiel #1
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);
 }
Beispiel #2
0
 /**
  * @param string $menu
  *
  * @return int
  */
 protected function selectMenuItem($menu)
 {
     if ($this->request->getArea() !== Core\Controller\AreaEnum::AREA_ADMIN) {
         $in = [$this->request->getQuery(), $this->request->getUriWithoutPages(), $this->request->getFullPath(), $this->request->getModuleAndController(), $this->request->getModule()];
         return $this->menuItemRepository->getLeftIdByUris($menu, $in);
     }
     return 0;
 }
Beispiel #3
0
 private function appendControllerActionBreadcrumbs()
 {
     $serviceId = $this->getControllerServiceId();
     if ($this->request->getController() !== 'index' && $this->container->has($serviceId)) {
         $this->append($this->translator->t($this->request->getModule(), $this->getControllerIndexActionTitle()), $this->request->getModuleAndController());
     }
     if ($this->request->getAction() !== 'index') {
         $this->append($this->translator->t($this->request->getModule(), $this->getControllerActionTitle()), $this->request->getFullPath());
     }
 }
Beispiel #4
0
 /**
  * @param string|null $moduleConfirmUrl
  * @param string|null $moduleIndexUrl
  *
  * @return array
  */
 private function generateDefaultConfirmationBoxUris($moduleConfirmUrl, $moduleIndexUrl)
 {
     if ($moduleConfirmUrl === null) {
         $moduleConfirmUrl = $this->request->getFullPath();
     }
     if ($moduleIndexUrl === null) {
         $moduleIndexUrl = $this->request->getModuleAndController();
     }
     return [$moduleConfirmUrl, $moduleIndexUrl];
 }