aboutsummaryrefslogtreecommitdiff
path: root/mod/groups
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups')
-rw-r--r--mod/groups/actions/delete.php18
-rw-r--r--mod/groups/languages/en.php7
-rw-r--r--mod/groups/start.php2
3 files changed, 27 insertions, 0 deletions
diff --git a/mod/groups/actions/delete.php b/mod/groups/actions/delete.php
new file mode 100644
index 000000000..f75faee76
--- /dev/null
+++ b/mod/groups/actions/delete.php
@@ -0,0 +1,18 @@
+<?php
+ global $CONFIG;
+
+ $guid = (int)get_input('group_guid');
+ $entity = get_entity($guid);
+
+ if (($entity) && ($entity instanceof ElggGroup))
+ {
+ if ($entity->delete())
+ system_message(elgg_echo('group:deleted'));
+ else
+ register_error(elgg_echo('group:notdeleted'));
+ }
+ else
+ register_error(elgg_echo('group:notdeleted'));
+
+ forward($_SERVER['HTTP_REFERER']);
+?> \ No newline at end of file
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index e743ec777..4a0829fee 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -22,6 +22,7 @@
'groups:all' => "All site groups",
'groups:new' => "Create a new group",
'groups:edit' => "Edit group",
+ 'groups:delete' => 'Delete group',
'groups:icon' => 'Group icon (leave blank to leave unchanged)',
'groups:name' => 'Group name',
@@ -164,6 +165,12 @@ or click below to confirm request:
'groups:widgets:entities:label:pleaseedit' => 'Please configure this widget.',
'groups:forumtopic:edited' => 'Forum topic successfully edited.',
+
+ /**
+ * Action messages
+ */
+ 'group:deleted' => 'Group and group contents deleted',
+ 'group:notdeleted' => 'Group could not be deleted',
);
add_translation("en",$english);
diff --git a/mod/groups/start.php b/mod/groups/start.php
index e56d7e644..cd1150a58 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -40,6 +40,7 @@
// Register some actions
register_action("groups/edit",false, $CONFIG->pluginspath . "groups/actions/edit.php");
+ register_action("groups/delete",false, $CONFIG->pluginspath . "groups/actions/delete.php");
register_action("groups/join",false, $CONFIG->pluginspath . "groups/actions/join.php");
register_action("groups/leave",false, $CONFIG->pluginspath . "groups/actions/leave.php");
register_action("groups/joinrequest",false, $CONFIG->pluginspath . "groups/actions/joinrequest.php");
@@ -124,6 +125,7 @@
if (isloggedin()) {
if ($page_owner->canEdit()) {
add_submenu_item(elgg_echo('groups:edit'),$CONFIG->wwwroot . "mod/groups/edit.php?group_guid=" . $page_owner->getGUID(), '1groupsactions');
+ add_submenu_item(elgg_echo('groups:delete'),$CONFIG->wwwroot . "action/groups/delete?group_guid=" . $page_owner->getGUID(), '1groupsactions');
add_submenu_item(elgg_echo('groups:invite'),$CONFIG->wwwroot . "mod/groups/invite.php?group_guid={$page_owner->getGUID()}", '1groupsactions');
}
if ($page_owner->isMember($_SESSION['user'])) {