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:
phpnut 2007-07-08 18:28:41 +00:00
parent d6bf52dce7
commit c9eb45232d

View file

@ -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,29 +462,30 @@ 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;
}
if ($end != $params['page']) {
$out .= $this->link($i, array('page' => $end), $options);
}
$out .= $this->link($i, am($options['url'], 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);
}
}
?>
?>