From 7281de8839574dce69f87fe9c7c7eee405dabb72 Mon Sep 17 00:00:00 2001 From: rMalie Date: Wed, 28 Sep 2011 09:53:30 +0000 Subject: [PATCH] // Add Link->getAdminLink() git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8839 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Link.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/classes/Link.php b/classes/Link.php index a60edf164..90c72e6c5 100644 --- a/classes/Link.php +++ b/classes/Link.php @@ -271,6 +271,20 @@ class LinkCore return $url.Dispatcher::getInstance()->createUrl('module', $params, $this->allow); } + /** + * Create a link for a backoffice controller + * + * @param unknown_type $controller + * @param unknown_type $params + */ + public function getAdminLink($controller, array $params = array()) + { + $url = _PS_BASE_URL_.__PS_BASE_URI__; + + $params['token'] = Tools::getAdminTokenLite($controller); + return $url.Dispatcher::getInstance()->createUrl('module', $params, $this->allow); + } + /** * Returns a link to a product image for display * Note: the new image filesystem stores product images in subdirectories of img/p/