Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Commit

Permalink
Ignore files that may not be commited
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnhau committed May 28, 2014
1 parent 57a3976 commit f294bbe
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.buildpath
/.project
/.settings
7 changes: 4 additions & 3 deletions config/ZfcUserList.global.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/ZfcUserList/Controller/UserListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions src/ZfcUserList/Options/ModuleOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -40,4 +42,14 @@ public function getUserListElements()
{
return $this->userListElements;
}

public function setElementsPerPage($elementsPerPage)
{
$this->elementsPerPage = $elementsPerPage;
}

public function getElementsPerPage()
{
return $this->elementsPerPage;
}
}
6 changes: 3 additions & 3 deletions view/zfc-user-list/user-list/pagination_userlist.phtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if ($this->pageCount): ?>
<?php if ($this->pageCount):?>

<ul class="pagination ">

Expand All @@ -9,7 +9,7 @@

<!-- Previous page link -->
<li<?php echo (isset($this->previous)) ? '' : ' class="disabled"'; ?>>
<a href="<?php echo $this->url('zfcuser/zfcuserlist', array('p' => $this->previous-9)); ?>">&lt; Previous 10</a>
<a href="<?php echo $this->url('zfcuser/zfcuserlist', array('p' => $this->previous-$this->itemCountPerPage+1)); ?>">&lt; Previous <?php echo $this->itemCountPerPage; ?></a>
</li>

<!-- Numbered page links -->
Expand All @@ -21,7 +21,7 @@

<!-- Next page link -->
<li<?php echo (isset($this->next)) ? '' : ' class="disabled"'; ?>>
<a href="<?php echo $this->url('zfcuser/zfcuserlist', array('p' => $this->next+9)); ?>">Next 10 &gt;</a>
<a href="<?php echo $this->url('zfcuser/zfcuserlist', array('p' => $this->next+$this->itemCountPerPage-1)); ?>">Next <?php echo $this->itemCountPerPage; ?> &gt;</a>
</li>

<!-- Last page link -->
Expand Down

0 comments on commit f294bbe

Please sign in to comment.