// Fix controller parameter in Link::getPaginationLink() method
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12026 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+10
-10
@@ -418,35 +418,35 @@ class LinkCore
|
||||
|
||||
public function getPaginationLink($type, $id_object, $nb = false, $sort = false, $pagination = false, $array = false)
|
||||
{
|
||||
if ($type AND $id_object)
|
||||
$url = $this->{'get'.$type.'Link'}($id_object, NULL);
|
||||
if ($type && $id_object)
|
||||
$url = $this->{'get'.$type.'Link'}($id_object, null);
|
||||
else
|
||||
{
|
||||
$url = $this->url;
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
$url = $this->getPageLink(basename($url));
|
||||
}
|
||||
$vars = (!$array ? '' : array());
|
||||
$vars = (!$array) ? '' : array();
|
||||
$varsNb = array('n', 'search_query');
|
||||
$varsSort = array('orderby', 'orderway');
|
||||
$varsPagination = array('p');
|
||||
|
||||
$n = 0;
|
||||
foreach ($_GET AS $k => $value)
|
||||
if ($k != 'id_'.$type)
|
||||
foreach ($_GET as $k => $value)
|
||||
if ($k != 'id_'.$type && $k != 'controller')
|
||||
{
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS') AND ($k == 'isolang' OR $k == 'id_lang'))
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS') && ($k == 'isolang' || $k == 'id_lang'))
|
||||
continue;
|
||||
$ifNb = (!$nb || ($nb AND !in_array($k, $varsNb)));
|
||||
$ifSort = (!$sort OR ($sort AND !in_array($k, $varsSort)));
|
||||
$ifNb = (!$nb || ($nb && !in_array($k, $varsNb)));
|
||||
$ifSort = (!$sort || ($sort && !in_array($k, $varsSort)));
|
||||
$ifPagination = (!$pagination || ($pagination && !in_array($k, $varsPagination)));
|
||||
if ($ifNb && $ifSort && $ifPagination AND !is_array($value))
|
||||
if ($ifNb && $ifSort && $ifPagination && !is_array($value))
|
||||
!$array ? ($vars .= ((!$n++ && ($this->allow == 1 || $url == $this->url)) ? '?' : '&').urlencode($k).'='.urlencode($value)) : ($vars[urlencode($k)] = urlencode($value));
|
||||
}
|
||||
if (!$array)
|
||||
return $url.$vars;
|
||||
$vars['requestUrl'] = $url;
|
||||
if ($type AND $id_object)
|
||||
if ($type && $id_object)
|
||||
$vars['id_'.$type] = (is_object($id_object) ? (int)$id_object->id : (int)$id_object);
|
||||
return $vars;
|
||||
}
|
||||
|
||||
@@ -38,18 +38,16 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
{literal}
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#selectPrductSort').change(function()
|
||||
{
|
||||
var requestSortProducts = '{/literal}{$request}{literal}';
|
||||
var requestSortProducts = '{$request}';
|
||||
var splitData = $(this).val().split(':');
|
||||
document.location.href = requestSortProducts + ((requestSortProducts.indexOf('?') < 0) ? '?' : '&') + 'orderby=' + splitData[0] + '&orderway=' + splitData[1];
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
{/literal}
|
||||
</script>
|
||||
|
||||
<form id="productsSortForm" action="{$request|escape:'htmlall':'UTF-8'}">
|
||||
|
||||
Reference in New Issue
Block a user