/**
  * 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
 /**
  * @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;
 }
Example #3
0
File: Steps.php Project: acp3/core
 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());
     }
 }
Example #4
0
File: Action.php Project: acp3/core
 /**
  * @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];
 }
Example #5
0
 /**
  * Returns the SEO robots setting for the current page
  *
  * @return string
  */
 public function getPageRobotsSetting()
 {
     $robots = $this->getRobotsSetting($this->request->getUriWithoutPages());
     if (empty($robots)) {
         $robots = $this->getRobotsSetting($this->request->getFullPath());
     }
     if (empty($robots)) {
         $robots = $this->getRobotsSetting($this->request->getModule());
     }
     return strtolower(!empty($robots) ? $robots : $this->getRobotsSetting());
 }
Example #6
0
 /**
  * @param bool         $customUris
  * @param array|string $page
  * @param int          $pageNumber
  * @param int          $currentIndex
  *
  * @return bool
  */
 protected function isCurrentPage($customUris, $page, $pageNumber, $currentIndex)
 {
     if ($customUris === true) {
         if (is_array($page) === true && $page['uri'] === $this->router->route($this->request->getQuery()) || $this->router->route($this->request->getQuery()) === $this->router->route($this->request->getFullPath()) && $currentIndex == 0) {
             return true;
         }
     } elseif ($this->integerValidationRule->isValid($this->request->getParameters()->get('page')) === false && $currentIndex === 0 || $this->request->getParameters()->get('page') === $pageNumber) {
         return true;
     }
     return false;
 }