/** * 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; } }
/** * @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; }
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()); } }
/** * @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]; }
/** * 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()); }
/** * @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; }