aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/actions
diff options
context:
space:
mode:
authorkevinjardine <kevinjardine@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-03-09 11:21:44 +0000
committerkevinjardine <kevinjardine@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-03-09 11:21:44 +0000
commitb32b99e3f464d23de30e5c199ae33ba1819b6fbd (patch)
tree554dbc0c43533deecc9963eb11e8e021e500813b /mod/groups/actions
parent640444e38d4e3a6c88b182464071944627b4e11e (diff)
downloadelgg-b32b99e3f464d23de30e5c199ae33ba1819b6fbd.tar.gz
elgg-b32b99e3f464d23de30e5c199ae33ba1819b6fbd.tar.bz2
Groups now support add_group_tool_option so that any group tool can be toggled on or off via the group's edit form.
git-svn-id: https://code.elgg.org/elgg/trunk@3131 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/actions')
-rw-r--r--mod/groups/actions/edit.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/mod/groups/actions/edit.php b/mod/groups/actions/edit.php
index 6b66ab9f1..d98ac6084 100644
--- a/mod/groups/actions/edit.php
+++ b/mod/groups/actions/edit.php
@@ -65,9 +65,22 @@
$group->access_id = 2;
// Set group tool options
- $group->files_enable = get_input('files_enable', 'yes');
- $group->pages_enable = get_input('pages_enable', 'yes');
- $group->forum_enable = get_input('forum_enable', 'yes');
+ //$group->files_enable = get_input('files_enable', 'yes');
+ //$group->pages_enable = get_input('pages_enable', 'yes');
+ //$group->forum_enable = get_input('forum_enable', 'yes');
+
+ // Set group tool options
+ if (isset($CONFIG->group_tool_options)) {
+ foreach($CONFIG->group_tool_options as $group_option) {
+ $group_option_toggle_name = $group_option->name."_enable";
+ if ($group_option->default_on) {
+ $group_option_default_value = 'yes';
+ } else {
+ $group_option_default_value = 'no';
+ }
+ $group->$group_option_toggle_name = get_input($group_option_toggle_name, $group_option_default_value);
+ }
+ }
$group->save();