delete groups from groups directory, for admins

This commit is contained in:
Hannes Mannerheim 2014-11-07 15:44:22 +01:00 committed by Mikael Nordfeldth
parent 492d8e72ed
commit b81857656f
2 changed files with 19 additions and 0 deletions

View File

@ -171,6 +171,8 @@ class DeletegroupAction extends RedirectingAction
function showContent() { function showContent() {
$this->areYouSureForm(); $this->areYouSureForm();
$block = new GroupProfileBlock($this, $this->group);
$block->show();
} }
/** /**

View File

@ -221,6 +221,23 @@ class SortableGroupListItem extends SortableSubscriptionListItem
$this->endProfile(); $this->endProfile();
} }
function endActions()
{
// delete button
$cur = common_current_user();
list($action, $r2args) = $this->out->returnToArgs();
$r2args['action'] = $action;
if ($cur instanceof User && $cur->hasRight(Right::DELETEGROUP)) {
$this->out->elementStart('li', 'entity_delete');
$df = new DeleteGroupForm($this->out, $this->profile, $r2args);
$df->show();
$this->out->elementEnd('li');
}
$this->out->elementEnd('ul');
$this->out->elementEnd('td');
}
function showActions() function showActions()
{ {
$this->startActions(); $this->startActions();