Improve dashboard pagination
This commit is contained in:
@@ -102,6 +102,14 @@ class Paginator
|
||||
*/
|
||||
private $action = '';
|
||||
|
||||
/**
|
||||
* URL anchor
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $anchor = '';
|
||||
|
||||
/**
|
||||
* Url params
|
||||
*
|
||||
@@ -183,13 +191,15 @@ class Paginator
|
||||
* @param string $controller
|
||||
* @param string $action
|
||||
* @param array $params
|
||||
* @param string $anchor
|
||||
* @return $this
|
||||
*/
|
||||
public function setUrl($controller, $action, array $params = array())
|
||||
public function setUrl($controller, $action, array $params = array(), $anchor = '')
|
||||
{
|
||||
$this->controller = $controller;
|
||||
$this->action = $action;
|
||||
$this->params = $params;
|
||||
$this->anchor = $anchor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -399,7 +409,10 @@ class Paginator
|
||||
$this->action,
|
||||
$this->getUrlParams($this->page - 1, $this->order, $this->direction),
|
||||
false,
|
||||
'js-modal-replace'
|
||||
'js-modal-replace',
|
||||
t('Previous'),
|
||||
false,
|
||||
$this->anchor
|
||||
);
|
||||
} else {
|
||||
$html .= '← '.t('Previous');
|
||||
@@ -427,7 +440,10 @@ class Paginator
|
||||
$this->action,
|
||||
$this->getUrlParams($this->page + 1, $this->order, $this->direction),
|
||||
false,
|
||||
'js-modal-replace'
|
||||
'js-modal-replace',
|
||||
t('Next'),
|
||||
false,
|
||||
$this->anchor
|
||||
);
|
||||
} else {
|
||||
$html .= t('Next').' →';
|
||||
|
||||
Reference in New Issue
Block a user