aboutsummaryrefslogtreecommitdiff
path: root/mod/groups
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-11 01:24:57 +0200
committerCash Costello <cash.costello@gmail.com>2012-07-11 18:59:17 -0400
commit84666d49fcc1191075f45b75a164ed0383c2c375 (patch)
tree355b1c43cd33adea935a7d765ef9ab80b88dba02 /mod/groups
parent4d42fd0263948eee4a7c7a26ceca0647c01cce32 (diff)
downloadelgg-84666d49fcc1191075f45b75a164ed0383c2c375.tar.gz
elgg-84666d49fcc1191075f45b75a164ed0383c2c375.tar.bz2
Fixes #4381. Group edit form made sticky.
Diffstat (limited to 'mod/groups')
-rw-r--r--mod/groups/actions/groups/edit.php5
-rw-r--r--mod/groups/views/default/forms/groups/edit.php14
2 files changed, 16 insertions, 3 deletions
diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php
index b513a6098..a3ad91622 100644
--- a/mod/groups/actions/groups/edit.php
+++ b/mod/groups/actions/groups/edit.php
@@ -15,6 +15,8 @@ function profile_array_decoder(&$v) {
$v = html_entity_decode($v, ENT_COMPAT, 'UTF-8');
}
+elgg_make_sticky_form('groups');
+
// Get group fields
$input = array();
foreach ($CONFIG->group as $shortname => $valuetype) {
@@ -106,6 +108,9 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
$group->save();
+// group saved so clear sticky form
+elgg_clear_sticky_form('groups');
+
// group creator needs to be member of new group and river entry created
if ($new_group_flag) {
elgg_set_page_owner_guid($group->guid);
diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php
index 8055b6430..7540d1bf9 100644
--- a/mod/groups/views/default/forms/groups/edit.php
+++ b/mod/groups/views/default/forms/groups/edit.php
@@ -5,8 +5,16 @@
* @package ElggGroups
*/
+if (elgg_is_sticky_form('groups')) {
+ $sticky_values = elgg_get_sticky_values('groups');
+ elgg_clear_sticky_form('groups');
+}
+
// new groups default to open membership
-if (isset($vars['entity'])) {
+if (isset($sticky_values)) {
+ $membership = $sticky_values['membership'];
+ $access = $sticky_values['access_id'];
+} elseif (isset($vars['entity'])) {
$membership = $vars['entity']->membership;
$access = $vars['entity']->access_id;
if ($access != ACCESS_PUBLIC && $access != ACCESS_LOGGED_IN) {
@@ -27,7 +35,7 @@ if (isset($vars['entity'])) {
<label><?php echo elgg_echo("groups:name"); ?></label><br />
<?php echo elgg_view("input/text", array(
'name' => 'name',
- 'value' => $vars['entity']->name,
+ 'value' => isset($sticky_values['name']) ? $sticky_values['name'] : $vars['entity']->name,
));
?>
</div>
@@ -45,7 +53,7 @@ if ($group_profile_fields > 0) {
echo "</label>$line_break";
echo elgg_view("input/{$valtype}", array(
'name' => $shortname,
- 'value' => $vars['entity']->$shortname,
+ 'value' => isset($sticky_values[$shortname]) ? $sticky_values[$shortname] : $vars['entity']->$shortname,
));
echo '</div>';
}