From b81857656f95861cd687abd804bb489635f1b2d9 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Fri, 7 Nov 2014 15:44:22 +0100 Subject: [PATCH] delete groups from groups directory, for admins --- actions/deletegroup.php | 2 ++ plugins/Directory/lib/sortablegrouplist.php | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/actions/deletegroup.php b/actions/deletegroup.php index 6d9d66d30e..c64bc1d8e9 100644 --- a/actions/deletegroup.php +++ b/actions/deletegroup.php @@ -171,6 +171,8 @@ class DeletegroupAction extends RedirectingAction function showContent() { $this->areYouSureForm(); + $block = new GroupProfileBlock($this, $this->group); + $block->show(); } /** diff --git a/plugins/Directory/lib/sortablegrouplist.php b/plugins/Directory/lib/sortablegrouplist.php index 2849e75eba..7474d0daa6 100644 --- a/plugins/Directory/lib/sortablegrouplist.php +++ b/plugins/Directory/lib/sortablegrouplist.php @@ -221,6 +221,23 @@ class SortableGroupListItem extends SortableSubscriptionListItem $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() { $this->startActions(); -- 2.39.5