Changeset 890
- Timestamp:
- 01/30/07 13:21:04 (2 years ago)
- Files:
-
- devel/profile/edit.php (modified) (5 diffs)
- devel/profile/profile.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/profile/edit.php
r880 r890 31 31 protect(1); 32 32 33 global $page_owner, $metatags, $CFG; 33 global $page_owner, $metatags, $CFG, $data; 34 35 if (isset($_SESSION['profile:preload'])) { 36 $data['profile:preload'] = $_SESSION['profile:preload']; 37 unset($_SESSION['profile:preload']); 38 } 39 if (isset($_SESSION['profile:preload:access'])) { 40 $data['profile:preload:access'] = $_SESSION['profile:preload:access']; 41 unset($_SESSION['profile:preload:access']); 42 } 34 43 35 44 $title = run("profile:display:name", $page_owner) . " :: ". __gettext("Edit profile") .""; … … 90 99 $flabel = !empty($field[0]) ? $field[0] : ''; 91 100 $frequired = false; 101 $fcat = __gettext("Main"); 92 102 // Otherwise map things the new way! 93 103 } else { … … 95 105 $flabel = $datatype->name; 96 106 $frequired = $datatype->required; 107 if (empty($datatype->category)) { 108 $fcat = __gettext("Main"); 109 } else { 110 $fcat = $datatype->category; 111 } 97 112 } 98 113 if ($fname == $field && $frequired == true) { 99 $requiredmissing[] = $flabel;114 $requiredmissing[] = sprintf(__gettext("%s (in category %s)"),$flabel,$fcat); 100 115 } 101 116 } … … 132 147 } else { 133 148 149 $savedata = array(); 150 151 foreach($insertvalues as $insertvalue) { 152 $savedata['profile:preload'][$insertvalue->name] = $insertvalue->value; 153 $savedata['profile:preload:access'][$insertvalue->name] = $insertvalue->access; 154 } 134 155 foreach($requiredmissing as $key=> $missinglabel) { 135 156 $message = ""; … … 139 160 $message .= $missinglabel; 140 161 } 162 141 163 $messages[] = sprintf(__gettext("You need to fill in the following required fields: %s"),$message); 142 164 143 165 $updatedok = false; 166 $_SESSION['profile:preload'] = $savedata['profile:preload']; 167 $_SESSION['profile:preload:access'] = $savedata['profile:preload:access']; 144 168 } 145 169 } devel/profile/profile.class.php
r883 r890 237 237 } 238 238 239 if (!isset($data['profile:preload'][$f label])) {239 if (!isset($data['profile:preload'][$fname])) { 240 240 if (!$value = get_record('profile_data','name',$fname,'owner',$page_owner)) { 241 241 $value = ""; … … 246 246 $value = ""; 247 247 $value->value = $data['profile:preload'][$fname]; 248 $value->access = $CFG->default_access; 248 if (!isset($data['profile:preload:access'][$fname])) { 249 $value->access = $CFG->default_access; 250 } else { 251 $value->access = $data['profile:preload:access'][$fname]; 252 } 249 253 250 254 }
