Allow setting whether an ACP route should be built
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 10 May 2013 13:46:00 +0000 (15:46 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 10 May 2013 13:46:00 +0000 (15:46 +0200)
wcfsetup/install/files/lib/system/request/LinkHandler.class.php
wcfsetup/install/files/lib/system/request/RouteHandler.class.php

index 6ea96992d01547d8fb91a670ee834dec8ff8305d..c85cbac3a9e35026b2daf9e8d4532b99d9dca13e 100644 (file)
@@ -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) ? '?' : '&';
                }
index 0e10264333bc78804db8eb8a845af133de703a7e..775dcb3e3893116360b4ef897e8956126ce47578 100644 (file)
@@ -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;
                        }