Reformatting code, and removing merging of defaults key in the helper. It no longer exists.

This commit is contained in:
mark_story 2010-12-19 12:26:28 -05:00
parent f54479e566
commit ef84d86cf5
2 changed files with 6 additions and 4 deletions

View file

@ -202,7 +202,10 @@ class PaginatorComponent extends Component {
array($object->alias => $paging)
);
if (!in_array('Paginator', $this->Controller->helpers) && !array_key_exists('Paginator', $this->Controller->helpers)) {
if (
!in_array('Paginator', $this->Controller->helpers) &&
!array_key_exists('Paginator', $this->Controller->helpers)
) {
$this->Controller->helpers[] = 'Paginator';
}
return $results;

View file

@ -112,7 +112,6 @@ class PaginatorHelper extends AppHelper {
*/
public function beforeRender($viewFile) {
$this->options['url'] = array_merge($this->request->params['pass'], $this->request->params['named']);
parent::beforeRender($viewFile);
}
@ -191,7 +190,7 @@ class PaginatorHelper extends AppHelper {
public function sortKey($model = null, $options = array()) {
if (empty($options)) {
$params = $this->params($model);
$options = array_merge($params['defaults'], $params['options']);
$options = $params['options'];
}
if (isset($options['sort']) && !empty($options['sort'])) {
@ -217,7 +216,7 @@ class PaginatorHelper extends AppHelper {
if (empty($options)) {
$params = $this->params($model);
$options = array_merge($params['defaults'], $params['options']);
$options = $params['options'];
}
if (isset($options['direction'])) {