aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default
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/views/default
parent4d42fd0263948eee4a7c7a26ceca0647c01cce32 (diff)
downloadelgg-84666d49fcc1191075f45b75a164ed0383c2c375.tar.gz
elgg-84666d49fcc1191075f45b75a164ed0383c2c375.tar.bz2
Fixes #4381. Group edit form made sticky.
Diffstat (limited to 'mod/groups/views/default')
-rw-r--r--mod/groups/views/default/forms/groups/edit.php14
1 files changed, 11 insertions, 3 deletions
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>';
}