Commit 4d4a0491 authored by hannes's avatar hannes

groups/all didn't work, also fixed pagination in directory/users, and a...

groups/all didn't work, also fixed pagination in directory/users, and a convenient delete-button for admins
parent a3574bac
......@@ -79,12 +79,41 @@ class DirectoryPlugin extends Plugin
function onRouterInitialized($m)
{
$m->connect(
'directory/users/:filter/sort_by/:sort/reverse/:reverse',
array('action' => 'userdirectory'),
array('filter' => '[0-9a-zA-Z]|(0-9)'),
array('sort' => '[a-z]+'),
array('reverse' => '[0-9]')
);
$m->connect(
'directory/users/:filter/sort_by/:sort',
array('action' => 'userdirectory'),
array('filter' => '[0-9a-zA-Z]|(0-9)'),
array('sort' => '[a-z]+')
);
$m->connect(
'directory/users/:filter',
array('action' => 'userdirectory'),
array('filter' => '[0-9a-zA-Z]|(0-9)')
);
$m->connect(
'directory/users/sort_by/:sort/reverse/:reverse',
array('action' => 'userdirectory'),
array('sort' => '[a-z]+'),
array('reverse' => '[0-9]')
);
$m->connect(
'directory/users/sort_by/:sort',
array('action' => 'userdirectory'),
array('sort' => '[a-z]+')
);
$m->connect(
'directory/users',
array('action' => 'userdirectory')
......@@ -101,6 +130,12 @@ class DirectoryPlugin extends Plugin
array('action' => 'groupdirectory')
);
$m->connect(
'groups/all',
array('action' => 'groupdirectory')
);
return true;
}
......
......@@ -234,6 +234,13 @@ class UserdirectoryAction extends Action
$args['filter'] = $this->filter;
}
if (isset($this->sort)) {
$args['sort'] = $this->sort;
}
if (!empty($this->reverse)) {
$args['reverse'] = $this->reverse;
}
$this->pagination(
$this->page > 1,
$cnt > PROFILES_PER_PAGE,
......
......@@ -207,6 +207,18 @@ class SortableSubscriptionListItem extends SubscriptionListItem
function endActions()
{
// delete button
$cur = common_current_user();
list($action, $r2args) = $this->out->returnToArgs();
$r2args['action'] = $action;
if ($cur->hasRight(Right::DELETEUSER)) {
$this->out->elementStart('li', 'entity_delete');
$df = new DeleteUserForm($this->out, $this->profile, $r2args);
$df->show();
$this->out->elementEnd('li');
}
$this->out->elementEnd('ul');
$this->out->elementEnd('td');
}
......
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