The router id is now configurable via setters and getters to allow

modules to use their own router.
This commit is contained in:
Franck Allimant
2014-01-16 19:35:12 +01:00
parent 4d933b8a46
commit 42737940a9

View File

@@ -49,6 +49,21 @@ class BaseAdminController extends BaseController
{
const TEMPLATE_404 = "404";
/**
* The current router identifier. The default is router.admin. Modules may use
* setCurrentRouter() method to pass their own router, and use the route related
* methods of this class.
*/
private $currentRouter = "router.admin";
protected function getCurrentRouter() {
return $this->currentRouter;
}
protected function setCurrentRouter($routerId) {
$this->currentRouter = $routerId;
}
/**
* Helper to append a message to the admin log.
*
@@ -242,7 +257,7 @@ class BaseAdminController extends BaseController
protected function getRoute($routeId, $parameters = array(), $referenceType = Router::ABSOLUTE_URL)
{
return $this->getRouteFromRouter(
'router.admin',
$this->currentRouter,
$routeId,
$parameters,
$referenceType