diff options
Diffstat (limited to 'application/modules/user/controllers/PrebootController.php')
-rw-r--r-- | application/modules/user/controllers/PrebootController.php | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/application/modules/user/controllers/PrebootController.php b/application/modules/user/controllers/PrebootController.php index b4382cf..3b5b703 100644 --- a/application/modules/user/controllers/PrebootController.php +++ b/application/modules/user/controllers/PrebootController.php @@ -65,20 +65,16 @@ class User_PrebootController extends Zend_Controller_Action $this->view->prebootlist = $this->prebootMapper->findBy("groupID", $groupID); // Pagination - $perpage = 2; - $req_page = $this->_request->getParam('page'); - $all = count($this->view->prebootlist); - $numpages = ceil($all/$perpage); - if($req_page < 0 || !is_numeric($req_page) ) - $req_page = 0; - if($req_page >= $numpages) - $req_page = $numpages-1; - $startitem = $req_page * $perpage; + $pagination = new Pbs_Pagination(); + $pagination->setPerPage(2); + $pagination->setElement($this->view->prebootlist); + $pagination->setRequestPage($this->_request->getParam('page')); + $pagination->setPageUrl('/user/preboot/index'.((isset($this->view->search))?'/search/'.$this->view->search:'')); + $this->view->prebootlist = $pagination->getElements(); - $pagination = new Pbs_Pagination(); - $this->view->pagination = $pagination->pagination('/user/preboot/index',$req_page,$numpages); - $this->view->page = $req_page; - $this->view->prebootlist = array_slice($this->view->prebootlist,$startitem,$perpage); + $this->view->pagination = $pagination->pagination($pageurl); + $this->view->page = $pagination->getRequestPage(); + $this->view->prebootlist= $this->view->prebootlist; |