From df24fff1a2623089ea299d0e846c8a13859a68f5 Mon Sep 17 00:00:00 2001 From: joelmoss Date: Sat, 10 May 2008 18:32:51 +0000 Subject: [PATCH] Paginator Helper prev and next methods are now wrapped in span tags instead of div tags. Tests also modified to support this. Closes #3991 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6795 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/paginator.php | 5 ++++- cake/tests/cases/libs/view/helpers/paginator.test.php | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index be521d68f..a3d948462 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -311,7 +311,10 @@ class PaginatorHelper extends AppHelper { if ($this->{$check}()) { return $this->link($title, $url, array_merge($options, array('escape' => $escape))); } else { - return $this->Html->div(null, $title, $options, $escape); + if ($escape) { + $title = h($title); + } + return sprintf('%s', $this->_parseAttributes($options), $title); } } /** diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index 2de80b130..8815cebb8 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -85,12 +85,12 @@ class PaginatorTest extends UnitTestCase { $this->Paginator->params['paging']['Article']['nextPage'] = false; $this->Paginator->params['paging']['Article']['page'] = 1; $result = $this->Paginator->next('Next', array(), true); - $expected = '
Next
'; + $expected = 'Next'; $this->assertEqual($result, $expected); $this->Paginator->params['paging']['Article']['prevPage'] = false; $result = $this->Paginator->prev('prev', array('update'=> 'theList', 'indicator'=> 'loading', 'url'=> array('controller' => 'posts')), null, array('class' => 'disabled')); - $expected = '
prev
'; + $expected = 'prev'; $this->assertEqual($result, $expected); } @@ -202,7 +202,7 @@ class PaginatorTest extends UnitTestCase { 'options' => array('page' => 1, 'limit' => 3, 'order' => array('Client.name' => 'DESC'), 'conditions' => array())) ); $result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled')); - $expected = '
<< Previous
'; + $expected = '<< Previous'; $this->assertEqual($result, $expected); $this->Paginator->params['paging']['Client']['page'] = 2;