diff options
Diffstat (limited to 'application/modules')
-rw-r--r-- | application/modules/user/controllers/BootmenuController.php | 20 | ||||
-rw-r--r-- | application/modules/user/views/scripts/bootmenu/index.phtml | 21 |
2 files changed, 33 insertions, 8 deletions
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index b92d9c1..2c9d2b5 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; } diff --git a/application/modules/user/views/scripts/bootmenu/index.phtml b/application/modules/user/views/scripts/bootmenu/index.phtml index d0b8391..dbb7048 100644 --- a/application/modules/user/views/scripts/bootmenu/index.phtml +++ b/application/modules/user/views/scripts/bootmenu/index.phtml @@ -1,7 +1,7 @@ <h1>BootMenu</h1> <?php if($this->notification != ''){echo $this->notification;} ?> <?php echo $this->formButton('createbootmenu', 'Create BootMenu', array( - 'onclick' => 'self.location="/user/bootmenu/createbootmenu"', + 'onclick' => 'self.location="/user/bootmenu/createbootmenu/page/'.$this->page.'"', 'class' => 'addbutton'))?> @@ -24,7 +24,8 @@ 'module' => 'user', 'controller' => 'bootmenu', 'action' => 'editbootmenu', - 'bootmenuID' => $bootmenu->getID() + 'bootmenuID' => $bootmenu->getID(), + 'page' => $this->page ), 'default', true, false) ?>"><img src='/media/img/edit.png' alt='Edit Bootmenu'/></a></td> @@ -33,7 +34,8 @@ 'module' => 'user', 'controller' => 'bootmenu', 'action' => 'deletebootmenu', - 'bootmenuID' => $bootmenu->getID() + 'bootmenuID' => $bootmenu->getID(), + 'page' => $this->page ), 'default', true) ?>"><img src='/media/img/delete.png' alt='Delete Bootmenu'/></a></td> @@ -43,7 +45,8 @@ 'controller' => 'bootmenu', 'action' => 'addbootmenuentry', 'bootmenuID' => $bootmenu->getID(), - 'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]) + 'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]), + 'page' => $this->page ), 'default', true) ?>"><img src='/media/img/add.png' alt='Add Entry'/></a></td> @@ -75,7 +78,8 @@ 'controller' => 'resource', 'action' => 'getbootmenuentry', 'bootmenuentryID' => $bootmenuentry->getID(), - 'alpha' => $_SESSION['alphasessionID'] + 'alpha' => $_SESSION['alphasessionID'],, + 'page' => $this->page ), 'default', true, false) ?>"><img src='/media/img/play.gif'> @@ -96,7 +100,8 @@ 'bootmenuentryID' => $bootmenuentry->getID(), 'bootmenuID' => $bootmenu->getID(), 'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]), - 'oldorder' => $bootmenuentry->getOrder() + 'oldorder' => $bootmenuentry->getOrder(), + 'page' => $this->page ), 'default', true, false) ?>"><img src='/media/img/edit.png' alt='Edit Entry'/></a></td> @@ -105,7 +110,8 @@ 'module' => 'user', 'controller' => 'bootmenu', 'action' => 'removebootmenuentry', - 'bootmenuentryID' => $bootmenuentry->getID() + 'bootmenuentryID' => $bootmenuentry->getID(), + 'page' => $this->page ), 'default', true) ?>"><img src='/media/img/delete.png' alt='Remove Entry'/></a></td> @@ -117,6 +123,7 @@ <?php endif; ?> <?php endforeach; ?> </table> + <?php echo $this->pagination; ?> |