projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Xnet accounts activation.
[platal.git]
/
include
/
userset.inc.php
diff --git
a/include/userset.inc.php
b/include/userset.inc.php
index
e6e636e
..
2c58419
100644
(file)
--- a/
include/userset.inc.php
+++ b/
include/userset.inc.php
@@
-358,19
+358,24
@@
class AddressesView implements PlView
class JSonView implements PlView
{
private $set;
class JSonView implements PlView
{
private $set;
+ private $params;
public function __construct(PlSet $set, array $params)
{
public function __construct(PlSet $set, array $params)
{
- $this->set = $set;
+ $this->set = $set;
+ $this->params = $params;
}
public function apply(PlPage $page)
{
$export = array();
}
public function apply(PlPage $page)
{
$export = array();
- $profiles = $this->set->get(new PlLimit());
- while ($profile = $profiles->next()) {
+ $start = isset($this->params['offset']) ? $this->params['offset'] : 0;
+ $count = isset($this->params['count']) ? $this->params['count'] : 10;
+ $profiles = $this->set->get(new PlLimit($start, $count));
+ foreach ($profiles as $profile) {
$export[] = $profile->export();
}
$export[] = $profile->export();
}
+ $page->jsonAssign('profile_count', $this->set->count());
$page->jsonAssign('profiles', $export);
}
$page->jsonAssign('profiles', $export);
}