// Raphael modification on Franck's computer related to url creation

This commit is contained in:
fBrignoli committed 2011-10-20 14:18:44 +00:00
1 parent e8a0385668
commit 17ea105b19
1 file changed
+7 -10
+7 -10
View File
@@ -251,12 +251,12 @@ class LinkCore
* Create a link to a supplier * Create a link to a supplier
* *
* @since 1.5.0 * @since 1.5.0
* @param string $name Module name * @param string $module Module name
* @param string $action Action name * @param string $action Action name
* @param int $id_lang * @param int $id_lang
* @return string * @return string
*/ */
public function getModuleLink($name, $action, $ssl = false, $id_lang = null) public function getModuleLink($module, $action, $ssl = false, $id_lang = null)
{ {
$base = (($ssl && Configuration::get('PS_SSL_ENABLED')) ? _PS_BASE_URL_SSL_ : _PS_BASE_URL_); $base = (($ssl && Configuration::get('PS_SSL_ENABLED')) ? _PS_BASE_URL_SSL_ : _PS_BASE_URL_);
$url = $base.__PS_BASE_URI__.$this->getLangLink($id_lang); $url = $base.__PS_BASE_URI__.$this->getLangLink($id_lang);
@@ -265,7 +265,7 @@ class LinkCore
// Set available keywords // Set available keywords
$params = array(); $params = array();
$params['name'] = $name; $params['module'] = $module;
$params['action'] = $action; $params['action'] = $action;
return $url.Dispatcher::getInstance()->createUrl('module', $params, $this->allow); return $url.Dispatcher::getInstance()->createUrl('module', $params, $this->allow);
@@ -336,16 +336,13 @@ class LinkCore
if (!$id_lang) if (!$id_lang)
$id_lang = (int)Context::getContext()->language->id; $id_lang = (int)Context::getContext()->language->id;
if (is_array($request)) if (!is_array($request))
{ parse_str($request, $request);
unset($request['controller']); unset($request['controller']);
$request = http_build_query($request);
}
$uri_path = Dispatcher::getInstance()->createUrl($controller); $uri_path = Dispatcher::getInstance()->createUrl($controller, $request);
$url = ($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true); $url = ($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true);
$url .= __PS_BASE_URI__.$this->getLangLink($id_lang).ltrim($uri_path, '/'); $url .= __PS_BASE_URI__.$this->getLangLink($id_lang).ltrim($uri_path, '/');
$url .= ($request ? ((strpos($url, '?') === false ? '?' : '&').trim($request)) : '');
return $url; return $url;
} }