mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding fix for #2836, PaginatorHelper::numbers() outputting extra url params
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5408 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
d6bf52dce7
commit
c9eb45232d
1 changed files with 9 additions and 9 deletions
|
@ -423,7 +423,6 @@ class PaginatorHelper extends AppHelper {
|
|||
function numbers($options = array()) {
|
||||
$options = am(
|
||||
array(
|
||||
'url' => array(),
|
||||
'before'=> null,
|
||||
'after'=> null,
|
||||
'model' => $this->defaultModel(),
|
||||
|
@ -463,26 +462,27 @@ class PaginatorHelper extends AppHelper {
|
|||
$end = $params['page'] + ($modulus - $params['page']) + 1;
|
||||
}
|
||||
for ($i = $start; $i < $params['page']; $i++) {
|
||||
$out .= $this->link($i, am($options['url'], array('page' => $i)), $options) . $separator;
|
||||
$out .= $this->link($i, array('page' => $i), $options) . $separator;
|
||||
}
|
||||
|
||||
$out .= $params['page'] . $separator;
|
||||
|
||||
$start = $params['page'] + 1;
|
||||
for ($i = $start; $i < $end; $i++) {
|
||||
$out .= $this->link($i, am($options['url'], array('page' => $i)), $options) . $separator;
|
||||
$out .= $this->link($i, array('page' => $i), $options) . $separator;
|
||||
}
|
||||
$out .= $this->link($i, am($options['url'], array('page' => $end)), $options);
|
||||
|
||||
if ($end != $params['page']) {
|
||||
$out .= $this->link($i, array('page' => $end), $options);
|
||||
}
|
||||
} else {
|
||||
for ($i = 1; $i < $params['pageCount']; $i++) {
|
||||
for ($i = 1; $i <= $params['pageCount']; $i++) {
|
||||
if ($i == $params['page']) {
|
||||
$out .= $i . $separator;
|
||||
} else {
|
||||
$out .= $this->link($i, am($options['url'], array('page' => $i)), $options) . $separator;
|
||||
$out .= $this->link($i, array('page' => $i), $options) . $separator;
|
||||
}
|
||||
}
|
||||
$out .= $this->link($i, am($options['url'], array('page' => $params['pageCount'])), $options);
|
||||
}
|
||||
$out .= $after;
|
||||
return $this->output($out);
|
||||
|
|
Loading…
Add table
Reference in a new issue