/** * {@inheritdoc} */ public function getContentRootPath($full = false) { if ($this->requestAnalyzer !== null) { if ($full) { return $this->requestAnalyzer->getPortalUrl(); } else { return $this->requestAnalyzer->getResourceLocatorPrefix(); } } else { return '/'; } }
/** * {@inheritdoc} */ public function resolve(RequestAnalyzerInterface $requestAnalyzer) { // determine default locale (if one exists) $defaultLocalization = $requestAnalyzer->getPortal()->getDefaultLocalization(); $defaultLocale = $defaultLocalization ? $defaultLocalization->getLocalization() : null; return ['request' => ['webspaceKey' => $requestAnalyzer->getWebspace()->getKey(), 'defaultLocale' => $defaultLocale, 'locale' => $requestAnalyzer->getCurrentLocalization()->getLocalization(), 'portalUrl' => $requestAnalyzer->getPortalUrl(), 'resourceLocatorPrefix' => $requestAnalyzer->getResourceLocatorPrefix(), 'resourceLocator' => $requestAnalyzer->getResourceLocator(), 'get' => $requestAnalyzer->getGetParameters(), 'post' => $requestAnalyzer->getPostParameters(), 'analyticsKey' => $requestAnalyzer->getAnalyticsKey()]]; }
/** * @return Route */ protected function getRedirectWebSpaceRoute() { $localization = $this->defaultLocaleProvider->getDefaultLocale(); $redirect = $this->requestAnalyzer->getRedirect(); $redirect = $this->urlReplacer->replaceCountry($redirect, $localization->getCountry()); $redirect = $this->urlReplacer->replaceLanguage($redirect, $localization->getLanguage()); $redirect = $this->urlReplacer->replaceLocalization($redirect, $localization->getLocale(Localization::DASH)); // redirect by information from webspace config // has to be done for all routes, because double slashes introduce problems otherwise return new Route('/{wildcard}', ['_controller' => 'SuluWebsiteBundle:Redirect:redirectWebspace', 'url' => $this->requestAnalyzer->getPortalUrl(), 'redirect' => $redirect], ['wildcard' => '.*']); }
/** * @param Request $request * * @return Route */ protected function getRedirectWebSpaceRoute(Request $request) { // redirect by information from webspace config return new Route($request->getPathInfo(), ['_controller' => 'SuluWebsiteBundle:Default:redirectWebspace', 'url' => $this->requestAnalyzer->getPortalUrl(), 'redirect' => $this->requestAnalyzer->getRedirect()]); }