From: Tim Düsterhus Date: Fri, 10 May 2013 13:46:00 +0000 (+0200) Subject: Allow setting whether an ACP route should be built X-Git-Tag: 2.0.0_Beta_1~211^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bc344403999417533f003db28df3b6c4b91df9fd;p=GitHub%2FWoltLab%2FWCF.git Allow setting whether an ACP route should be built --- diff --git a/wcfsetup/install/files/lib/system/request/LinkHandler.class.php b/wcfsetup/install/files/lib/system/request/LinkHandler.class.php index 6ea96992d0..c85cbac3a9 100644 --- a/wcfsetup/install/files/lib/system/request/LinkHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/LinkHandler.class.php @@ -122,7 +122,7 @@ class LinkHandler extends SingletonFactory { } $parameters['controller'] = $controller; - $routeURL = RouteHandler::getInstance()->buildRoute($parameters); + $routeURL = RouteHandler::getInstance()->buildRoute($parameters, $isACP); if (!$isRaw && !empty($url)) { $routeURL .= (strpos($routeURL, '?') === false) ? '?' : '&'; } diff --git a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php index 0e10264333..775dcb3e38 100644 --- a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php @@ -168,11 +168,14 @@ class RouteHandler extends SingletonFactory { * but a reverse lookup. * * @param array $components + * @param boolean $isACP * @return string */ - public function buildRoute(array $components) { + public function buildRoute(array $components, $isACP = null) { + if ($isACP === null) $isACP = RequestHandler::getInstance()->isACPRequest(); + foreach ($this->routes as $route) { - if (RequestHandler::getInstance()->isACPRequest() != $route->isACP()) { + if ($isACP != $route->isACP()) { continue; }