|
@ -9,13 +9,10 @@ |
|
|
* @filesource $URL$ |
|
|
* @filesource $URL$ |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
class PagerAction extends ViewAction |
|
|
|
|
|
|
|
|
class PagerAction extends Action |
|
|
{ |
|
|
{ |
|
|
public $page; |
|
|
public $page; |
|
|
public $last_page; |
|
|
public $last_page; |
|
|
|
|
|
|
|
|
//protected $num_rows;
|
|
|
|
|
|
|
|
|
|
|
|
protected $offset = 0; |
|
|
protected $offset = 0; |
|
|
protected $count = 0; |
|
|
protected $count = 0; |
|
|
protected $limit; |
|
|
protected $limit; |
|
@ -33,7 +30,6 @@ class PagerAction extends ViewAction |
|
|
$this->last_page = ceil($this->count/$this->limit); |
|
|
$this->last_page = ceil($this->count/$this->limit); |
|
|
$this->page = ($page <= $this->last_page && $page > 0) ? $page : 1; |
|
|
$this->page = ($page <= $this->last_page && $page > 0) ? $page : 1; |
|
|
$this->offset = $this->limit * ($this->page - 1); |
|
|
$this->offset = $this->limit * ($this->page - 1); |
|
|
//$this->num_rows = ($this->limit + $this->offset) <= $this->count ? ($this->limit + $this->offset) : $this->count;
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getOffset() |
|
|
public function getOffset() |
|
@ -51,16 +47,4 @@ class PagerAction extends ViewAction |
|
|
$template = ($this->template) ? $this->template : substr(get_class($this), 0, -6/*strlen('Action')*/); |
|
|
$template = ($this->template) ? $this->template : substr(get_class($this), 0, -6/*strlen('Action')*/); |
|
|
return '/actions/' . $template; |
|
|
return '/actions/' . $template; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* public function setNumRows($num_rows) |
|
|
|
|
|
{ |
|
|
|
|
|
$this->num_rows = $num_rows; |
|
|
|
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
/*function prepare() |
|
|
|
|
|
{ |
|
|
|
|
|
$this->templater->assign('page', $this->page); |
|
|
|
|
|
$this->templater->assign('page_max', $this->max_page_num); |
|
|
|
|
|
}*/ |
|
|
|
|
|
} |
|
|
} |