]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #5587 - Uses sticky values in profile edit form
authorPaweł Sroka <srokap@gmail.com>
Fri, 7 Jun 2013 01:13:23 +0000 (03:13 +0200)
committerCash Costello <cash.costello@gmail.com>
Fri, 7 Jun 2013 22:17:16 +0000 (18:17 -0400)
views/default/forms/profile/edit.php

index 9538b779eac94b173ae0b9cc7233025e882e56cd..aef180f36cab4cd56d7b9d2011a1ba48b2232f4d 100644 (file)
@@ -13,6 +13,8 @@
 </div>
 <?php
 
+$stickyValues = elgg_get_sticky_values('profile:edit');
+
 $profile_fields = elgg_get_config('profile_fields');
 if (is_array($profile_fields) && count($profile_fields) > 0) {
        foreach ($profile_fields as $shortname => $valtype) {
@@ -40,6 +42,14 @@ if (is_array($profile_fields) && count($profile_fields) > 0) {
                        $access_id = ACCESS_DEFAULT;
                }
 
+               //sticky form values take precedence over saved ones
+               if (isset($stickyValues[$shortname])) {
+                       $value = $stickyValues[$shortname];
+               }
+               if (isset($stickyValues['accesslevel'][$shortname])) {
+                       $access_id = $stickyValues['accesslevel'][$shortname];
+               }
+
 ?>
 <div>
        <label><?php echo elgg_echo("profile:{$shortname}") ?></label>