summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers
diff options
context:
space:
mode:
authorSimon2011-04-01 16:54:09 +0200
committerSimon2011-04-01 16:54:09 +0200
commitef66c5f34a986bdf8a7fc12368e7c3f5d5475b33 (patch)
tree4169c8f3f96f537da09428ef9c316a1de7c7a6e2 /application/modules/user/controllers
parentmerge (diff)
downloadpbs2-ef66c5f34a986bdf8a7fc12368e7c3f5d5475b33.tar.gz
pbs2-ef66c5f34a986bdf8a7fc12368e7c3f5d5475b33.tar.xz
pbs2-ef66c5f34a986bdf8a7fc12368e7c3f5d5475b33.zip
Pagination in Bootmenu
Diffstat (limited to 'application/modules/user/controllers')
-rw-r--r--application/modules/user/controllers/BootmenuController.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php
index 7d829de..0f2fdd4 100644
--- a/application/modules/user/controllers/BootmenuController.php
+++ b/application/modules/user/controllers/BootmenuController.php
@@ -7,6 +7,7 @@ class user_BootmenuController extends Zend_Controller_Action
protected $bootmenuentriesMapper;
protected $membershipMapper;
protected $membership;
+ protected $page;
public function init()
{
@@ -26,6 +27,7 @@ class user_BootmenuController extends Zend_Controller_Action
} else {
$this->_helper->redirector('login', 'auth');
}
+ $this->page = $this->_request->getParam('page');
}
public function indexAction()
@@ -77,8 +79,24 @@ class user_BootmenuController extends Zend_Controller_Action
$bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->gettitle());
}
}
+
+ // Pagination
+ $perpage = 5;
+ $req_page = $this->_request->getParam('page');
+ $all = count($bootmenu);
+ $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();
+ $this->view->pagination = $pagination->pagination('/user/client/index',$req_page,$numpages);
+ $this->view->page = $req_page;
+ $this->view->bootmenulist = array_slice($bootmenu,$startitem,$perpage);
+
- $this->view->bootmenulist = $bootmenu;
$this->view->bootmenuentrylist = $bootmenuentries;
}