diff options
-rw-r--r-- | mod/groups/actions/edit.php | 19 | ||||
-rw-r--r-- | mod/groups/start.php | 7 | ||||
-rw-r--r-- | mod/groups/views/default/forms/groups/edit.php | 52 |
3 files changed, 38 insertions, 40 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();
diff --git a/mod/groups/start.php b/mod/groups/start.php index 29f96785d..bbc27baa6 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -46,7 +46,7 @@ register_action("groups/leave",false, $CONFIG->pluginspath . "groups/actions/leave.php");
register_action("groups/joinrequest",false, $CONFIG->pluginspath . "groups/actions/joinrequest.php");
register_action("groups/killrequest",false,$CONFIG->pluginspath . "groups/actions/groupskillrequest.php");
- register_action("groups/addtogroup",false, $CONFIG->pluginspath . "groups/actions/addtogroup.php"); + register_action("groups/addtogroup",false, $CONFIG->pluginspath . "groups/actions/addtogroup.php");
register_action("groups/invite",false, $CONFIG->pluginspath . "groups/actions/invite.php");
// Use group widgets
@@ -73,7 +73,10 @@ // Listen to notification events and supply a more useful message
register_plugin_hook('notify:entity:message', 'object', 'groupforumtopic_notify_message');
-
+
+ // add the forum tool option
+ add_group_tool_option('forum',elgg_echo('groups:enableforum'),true);
+
// Now override icons
register_plugin_hook('entity:icon:url', 'group', 'groups_groupicon_hook');
}
diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php index 6b5f7b02d..82dd3d71f 100644 --- a/mod/groups/views/default/forms/groups/edit.php +++ b/mod/groups/views/default/forms/groups/edit.php @@ -54,46 +54,24 @@ </p>
+ <?php
+ if (isset($vars['config']->group_tool_options)) {
+ foreach($vars['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';
+ }
+?>
<p>
<label>
- <?php echo elgg_echo('groups:enablepages'); ?><br />
+ <?php echo $group_option->label; ?><br />
<?php
echo elgg_view("input/radio",array(
- "internalname" => "pages_enable",
- "value" => $vars['entity']->pages_enable ? $vars['entity']->pages_enable : 'yes',
- 'options' => array(
- elgg_echo('groups:yes') => 'yes',
- elgg_echo('groups:no') => 'no',
- ),
- ));
- ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo('groups:enableforum'); ?><br />
- <?php
-
- echo elgg_view("input/radio",array(
- "internalname" => "forum_enable",
- "value" => $vars['entity']->forum_enable ? $vars['entity']->forum_enable : 'yes',
- 'options' => array(
- elgg_echo('groups:yes') => 'yes',
- elgg_echo('groups:no') => 'no',
- ),
- ));
- ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo('groups:enablefiles'); ?><br />
- <?php
-
- echo elgg_view("input/radio",array(
- "internalname" => "files_enable",
- "value" => $vars['entity']->files_enable ? $vars['entity']->files_enable : 'yes',
+ "internalname" => $group_option_toggle_name,
+ "value" => $vars['entity']->$group_option_toggle_name ? $vars['entity']->$group_option_toggle_name : $group_option_default_value,
'options' => array(
elgg_echo('groups:yes') => 'yes',
elgg_echo('groups:no') => 'no',
@@ -102,6 +80,10 @@ ?>
</label>
</p>
+ <?php
+ }
+ }
+ ?>
<p>
<?php
if ($vars['entity'])
|