From 37ef26a631f6c31d3e2c65c35f95d43f7bf866ef Mon Sep 17 00:00:00 2001 From: mMarinetti Date: Wed, 28 Sep 2011 10:20:44 +0000 Subject: [PATCH] [+] BO : new method $link->getAdminLink($controller), to build admin url with token --- classes/Link.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/classes/Link.php b/classes/Link.php index 90c72e6c5..7deec6ce5 100644 --- a/classes/Link.php +++ b/classes/Link.php @@ -272,17 +272,13 @@ class LinkCore } /** - * Create a link for a backoffice controller + * use controller name to create link with correct token * - * @param unknown_type $controller - * @param unknown_type $params + * @param string $controller */ - public function getAdminLink($controller, array $params = array()) + public function getAdminLink($controller) { - $url = _PS_BASE_URL_.__PS_BASE_URI__; - - $params['token'] = Tools::getAdminTokenLite($controller); - return $url.Dispatcher::getInstance()->createUrl('module', $params, $this->allow); + return Dispatcher::getInstance()->createUrl($controller, array('token' => Tools::getAdminTokenLite($controller)), false); } /**