We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit e759b15a authored by Evan Prodromou's avatar Evan Prodromou

pagination for group inbox

parent 20824292
...@@ -119,7 +119,13 @@ class GroupinboxAction extends GroupDesignAction ...@@ -119,7 +119,13 @@ class GroupinboxAction extends GroupDesignAction
function showContent() function showContent()
{ {
$gml = new GroupMessageList($this, $this->gm); $gml = new GroupMessageList($this, $this->gm);
$gml->show(); $cnt = $gml->show();
$this->pagination($this->page > 1,
$cnt > MESSAGES_PER_PAGE,
$this->page,
'groupinbox',
array('nickname' => $this->group->nickname));
} }
/** /**
......
...@@ -68,10 +68,23 @@ class GroupMessageList extends Widget ...@@ -68,10 +68,23 @@ class GroupMessageList extends Widget
function show() function show()
{ {
$this->out->elementStart('ul', 'notices messages group-messages'); $this->out->elementStart('ul', 'notices messages group-messages');
while ($this->gm->fetch()) {
$cnt = 0;
while ($this->gm->fetch() && $cnt <= MESSAGES_PER_PAGE) {
$cnt++;
if ($cnt > MESSAGES_PER_PAGE) {
break;
}
$gmli = new GroupMessageListItem($this->out, $this->gm); $gmli = new GroupMessageListItem($this->out, $this->gm);
$gmli->show(); $gmli->show();
} }
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
return $cnt;
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment