From f294bbee49f6005442937c360317705fa151f1b2 Mon Sep 17 00:00:00 2001 From: Stijn Haulotte Date: Thu, 1 May 2014 17:06:26 +0200 Subject: [PATCH] Ignore files that may not be commited --- .gitignore | 3 +++ config/ZfcUserList.global.php.dist | 7 ++++--- src/ZfcUserList/Controller/UserListController.php | 2 +- src/ZfcUserList/Options/ModuleOptions.php | 12 ++++++++++++ .../user-list/pagination_userlist.phtml | 6 +++--- 5 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8470c6c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.buildpath +/.project +/.settings \ No newline at end of file diff --git a/config/ZfcUserList.global.php.dist b/config/ZfcUserList.global.php.dist index 3208d10..a23f977 100644 --- a/config/ZfcUserList.global.php.dist +++ b/config/ZfcUserList.global.php.dist @@ -25,14 +25,15 @@ $settings = array( 'userListElements' => array('Id' => 'id', 'Email address' => 'email', 'Display name' => 'display_name') /** - * [WIP] + * The amount of elements(users) shown per page. */ - 'orderBy' => 'username', + 'elementsPerPage' => '10', + /** * [WIP] */ - 'elementsPerPage' => '10', + 'orderBy' => 'username', ); /** diff --git a/src/ZfcUserList/Controller/UserListController.php b/src/ZfcUserList/Controller/UserListController.php index 1b8ede8..2d70c0c 100644 --- a/src/ZfcUserList/Controller/UserListController.php +++ b/src/ZfcUserList/Controller/UserListController.php @@ -22,7 +22,7 @@ public function listAction() $paginator = $users; } - $paginator->setItemCountPerPage(10); + $paginator->setItemCountPerPage($this->getOptions()->getElementsPerPage()); $paginator->setCurrentPageNumber($this->getEvent()->getRouteMatch()->getParam('p')); return array( 'users' => $paginator, diff --git a/src/ZfcUserList/Options/ModuleOptions.php b/src/ZfcUserList/Options/ModuleOptions.php index efa250e..5654952 100644 --- a/src/ZfcUserList/Options/ModuleOptions.php +++ b/src/ZfcUserList/Options/ModuleOptions.php @@ -19,6 +19,8 @@ class ModuleOptions extends AbstractOptions implements */ protected $userListElements = array('Id' => 'id', 'Email address' => 'email'); + protected $elementsPerPage = 10; + protected $userMapper = 'ZfcUserList\Mapper\UserDoctrine'; public function setUserMapper($userMapper) @@ -40,4 +42,14 @@ public function getUserListElements() { return $this->userListElements; } + + public function setElementsPerPage($elementsPerPage) + { + $this->elementsPerPage = $elementsPerPage; + } + + public function getElementsPerPage() + { + return $this->elementsPerPage; + } } diff --git a/view/zfc-user-list/user-list/pagination_userlist.phtml b/view/zfc-user-list/user-list/pagination_userlist.phtml index 6d77117..b9d4d12 100644 --- a/view/zfc-user-list/user-list/pagination_userlist.phtml +++ b/view/zfc-user-list/user-list/pagination_userlist.phtml @@ -1,4 +1,4 @@ -pageCount): ?> +pageCount):?>