Changeset 521
- Timestamp:
- 08/30/06 10:58:42 (2 years ago)
- Files:
-
- devel/profile/profile.class.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/profile/profile.class.php
r458 r521 79 79 80 80 global $page_owner; 81 82 global $ data;81 global $data; 82 global $CFG; 83 83 84 84 $run_result = ''; … … 155 155 Short / unique internal name, 156 156 Type of field, 157 User instructions for entering data 157 User instructions for entering data, 158 Optional: type of user that can see this field 159 (e.g. "person", "community" etc) 158 160 ) 159 161 e.g. … … 181 183 */ 182 184 183 $data['profile:details'][] = array(gettext("Who am I?"),"biography","longtext",gettext("A short introduction for you.")); 185 $data['profile:details'][] = array(gettext("Who am I?"),"biography","longtext",gettext("A short introduction for you."),"person"); 186 $data['profile:details'][] = array(gettext("Introduction"),"biography","longtext",gettext("A short introduction to this community."),"community"); 184 187 $data['foaf:profile'][] = array("biography","bio:olb","collated","enclosed"); 185 188 … … 260 263 function editfield_display ($field) { 261 264 265 global $page_owner; 266 $usertype = user_type($page_owner); 267 262 268 // copy array element with default to '' 263 269 $flabel = !empty($field[0]) ? $field[0] : ''; … … 265 271 $ftype = !empty($field[2]) ? $field[2] : ''; 266 272 $fblurb = !empty($field[3]) ? $field[3] : ''; 273 $fusertype = !empty($field[4]) ? $field[4] : ''; 274 275 if (!empty($fusertype) && $fusertype != $usertype) { 276 return ''; 277 } 267 278 268 279 global $page_owner; … … 629 640 630 641 global $data; 642 global $page_owner; 643 631 644 $run_result = ''; 645 $usertype = user_type($page_owner); 632 646 633 647 // Cycle through all defined profile detail fields and display them … … 637 651 if ($allvalues = get_records('profile_data','owner',$this->id)) { 638 652 foreach($data['profile:details'] as $field) { 653 if (empty($field[4]) || $usertype == $field[4]) { 639 654 // $field is an array, with the name 640 655 // of the field in $field[0] 641 $run_result .= $this->field_display($field,$allvalues); 656 $run_result .= $this->field_display($field,$allvalues); 657 } 642 658 } 643 659 }
