Changeset 877
- Timestamp:
- 01/26/07 16:45:17 (2 years ago)
- Files:
-
- devel/mod/profile/lib.php (modified) (1 diff)
- devel/mod/profile/profile.config.php (modified) (27 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/mod/profile/lib.php
r876 r877 157 157 } 158 158 159 // Converts an array to an object (BUT NOT A NUMERIC ARRAY!)160 161 function profile_return_object($array) {162 163 $obj = new stdClass();164 165 if (is_array($array)) {166 167 foreach($array as $key => $element) {168 $obj->$key = $element;169 }170 171 }172 173 return $obj;174 175 }176 177 178 159 ?> devel/mod/profile/profile.config.php
r874 r877 53 53 */ 54 54 55 $data['profile:details'][] = profile_return_object(array(55 $data['profile:details'][] = (object)(array( 56 56 "name" => __gettext("Who am I?"), 57 57 "internal_name" => "biography", … … 60 60 "user_type" => "person", 61 61 "category" => __gettext("Basic details"))); 62 $data['profile:details'][] = profile_return_object(array(62 $data['profile:details'][] = (object)(array( 63 63 "name" => __gettext("Introduction"), 64 64 "internal_name" => "biography", … … 70 70 $data['foaf:profile'][] = array("biography","bio:olb","collated","enclosed"); 71 71 72 $data['profile:details'][] = profile_return_object(array(72 $data['profile:details'][] = (object)(array( 73 73 "name" => __gettext("Brief description"), 74 74 "internal_name" => "minibio", … … 78 78 79 79 // $data['profile:details'][] = array(__gettext("Postal address"),"postaladdress","mediumtext"); 80 $data['profile:details'][] = profile_return_object(array(80 $data['profile:details'][] = (object)(array( 81 81 "name" => __gettext("Street address"), 82 82 "internal_name" => "streetaddress", … … 85 85 $data['vcard:profile:adr'][] = array("streetaddress","vCard:Street","collated","enclosed"); 86 86 87 $data['profile:details'][] = profile_return_object(array(87 $data['profile:details'][] = (object)(array( 88 88 "name" => __gettext("Town"), 89 89 "internal_name" => "town", … … 92 92 $data['vcard:profile:adr'][] = array("town","vCard:Locality","collated","enclosed"); 93 93 94 $data['profile:details'][] = profile_return_object(array(94 $data['profile:details'][] = (object)(array( 95 95 "name" => __gettext("State / Region"), 96 96 "internal_name" => "state", … … 99 99 $data['vcard:profile:adr'][] = array("state","vCard:Region","collated","enclosed"); 100 100 101 $data['profile:details'][] = profile_return_object(array(101 $data['profile:details'][] = (object)(array( 102 102 "name" => __gettext("Postal code"), 103 103 "internal_name" => "postcode", … … 106 106 $data['vcard:profile:adr'][] = array("postcode","vCard:Pcode","collated","enclosed"); 107 107 108 $data['profile:details'][] = profile_return_object(array(108 $data['profile:details'][] = (object)(array( 109 109 "name" => __gettext("Country"), 110 110 "internal_name" => "country", … … 113 113 $data['vcard:profile:adr'][] = array("country","vCard:Country","collated","enclosed"); 114 114 115 $data['profile:details'][] = profile_return_object(array(115 $data['profile:details'][] = (object)(array( 116 116 "name" => __gettext("Email address"), 117 117 "internal_name" => "emailaddress", … … 119 119 "category" => __gettext("Contact"))); 120 120 121 $data['profile:details'][] = profile_return_object(array(121 $data['profile:details'][] = (object)(array( 122 122 "name" => __gettext("Work telephone"), 123 123 "internal_name" => "workphone", … … 126 126 $data['foaf:profile'][] = array("workphone","foaf:phone","individual","resource"); 127 127 128 $data['profile:details'][] = profile_return_object(array(128 $data['profile:details'][] = (object)(array( 129 129 "name" => __gettext("Home telephone"), 130 130 "internal_name" => "homephone", … … 133 133 $data['foaf:profile'][] = array("homephone","foaf:phone","individual","resource"); 134 134 135 $data['profile:details'][] = profile_return_object(array(135 $data['profile:details'][] = (object)(array( 136 136 "name" => __gettext("Mobile telephone"), 137 137 "internal_name" => "mobphone", … … 140 140 $data['foaf:profile'][] = array("mobphone","foaf:phone","individual","resource"); 141 141 142 $data['profile:details'][] = profile_return_object(array(142 $data['profile:details'][] = (object)(array( 143 143 "name" => __gettext("Official website address"), 144 144 "internal_name" => "workweb", … … 148 148 $data['foaf:profile'][] = array("workweb","foaf:workplaceHomepage","individual","resource"); 149 149 150 $data['profile:details'][] = profile_return_object(array(150 $data['profile:details'][] = (object)(array( 151 151 "name" => __gettext("Personal website address"), 152 152 "internal_name" => "personalweb", … … 156 156 $data['foaf:profile'][] = array("personalweb","foaf:homepage","individual","resource"); 157 157 158 $data['profile:details'][] = profile_return_object(array(158 $data['profile:details'][] = (object)(array( 159 159 "name" => __gettext("ICQ number"), 160 160 "internal_name" => "icq", … … 163 163 $data['foaf:profile'][] = array("icq","foaf:icqChatID","individual","enclosed"); 164 164 165 $data['profile:details'][] = profile_return_object(array(165 $data['profile:details'][] = (object)(array( 166 166 "name" => __gettext("MSN chat"), 167 167 "internal_name" => "msn", … … 170 170 $data['foaf:profile'][] = array("msn","foaf:msnChatID","individual","enclosed"); 171 171 172 $data['profile:details'][] = profile_return_object(array(172 $data['profile:details'][] = (object)(array( 173 173 "name" => __gettext("AIM screenname"), 174 174 "internal_name" => "aim", … … 177 177 $data['foaf:profile'][] = array("aim","foaf:aimChatID","individual","enclosed"); 178 178 179 $data['profile:details'][] = profile_return_object(array(179 $data['profile:details'][] = (object)(array( 180 180 "name" => __gettext("Skype username"), 181 181 "internal_name" => "skype", … … 183 183 "category" => __gettext("Contact"))); 184 184 185 $data['profile:details'][] = profile_return_object(array(185 $data['profile:details'][] = (object)(array( 186 186 "name" => __gettext("Jabber username"), 187 187 "internal_name" => "jabber", … … 190 190 $data['foaf:profile'][] = array("jabber","foaf:jabberChatID","individual","enclosed"); 191 191 192 $data['profile:details'][] = profile_return_object(array(192 $data['profile:details'][] = (object)(array( 193 193 "name" => __gettext("Interests"), 194 194 "internal_name" => "interests", … … 199 199 // $data['foaf:profile'][] = array("interests","bio:keywords","collated","enclosed"); 200 200 201 $data['profile:details'][] = profile_return_object(array(201 $data['profile:details'][] = (object)(array( 202 202 "name" => __gettext("Likes"), 203 203 "internal_name" => "likes", … … 205 205 "description" => __gettext("Separated with commas."), 206 206 "category" => __gettext("Basic details"))); 207 $data['profile:details'][] = profile_return_object(array(207 $data['profile:details'][] = (object)(array( 208 208 "name" => __gettext("Dislikes"), 209 209 "internal_name" => "dislikes", … … 211 211 "description" => __gettext("Separated with commas."), 212 212 "category" => __gettext("Basic details"))); 213 $data['profile:details'][] = profile_return_object(array(213 $data['profile:details'][] = (object)(array( 214 214 "name" => __gettext("Occupation"), 215 215 "internal_name" => "occupation", 216 216 "field_type" => "text", 217 217 "category" => __gettext("Employment"))); 218 $data['profile:details'][] = profile_return_object(array(218 $data['profile:details'][] = (object)(array( 219 219 "name" => __gettext("Industry"), 220 220 "internal_name" => "industry", … … 222 222 "category" => __gettext("Employment"))); 223 223 224 $data['profile:details'][] = profile_return_object(array(224 $data['profile:details'][] = (object)(array( 225 225 "name" => __gettext("Company / Institution"), 226 226 "internal_name" => "organisation", … … 229 229 $data['foaf:profile'][] = array("organisation","foaf:organization","collated","enclosed"); 230 230 231 $data['profile:details'][] = profile_return_object(array(231 $data['profile:details'][] = (object)(array( 232 232 "name" => __gettext("Job Title"), 233 233 "internal_name" => "jobtitle", 234 234 "field_type" => "text", 235 235 "category" => __gettext("Employment"))); 236 $data['profile:details'][] = profile_return_object(array(236 $data['profile:details'][] = (object)(array( 237 237 "name" => __gettext("Job Description"), 238 238 "internal_name" => "jobdescription", 239 239 "field_type" => "text", 240 240 "category" => __gettext("Employment"))); 241 $data['profile:details'][] = profile_return_object(array(241 $data['profile:details'][] = (object)(array( 242 242 "name" => __gettext("I would like to ..."), 243 243 "internal_name" => "goals", … … 245 245 "description" => __gettext("Your goals, separated with commas."), 246 246 "category" => __gettext("Basic details"))); 247 $data['profile:details'][] = profile_return_object(array(247 $data['profile:details'][] = (object)(array( 248 248 "name" => __gettext("Career Goals"), 249 249 "internal_name" => "careergoals", … … 251 251 "description" => __gettext("Freeform: let colleagues and potential employers know what you'd like to get out of your career."), 252 252 "category" => __gettext("Employment"))); 253 $data['profile:details'][] = profile_return_object(array(253 $data['profile:details'][] = (object)(array( 254 254 "name" => __gettext("Level of Education"), 255 255 "internal_name" => "educationlevel", 256 256 "field_type" => "text", 257 257 "category" => __gettext("Education"))); 258 $data['profile:details'][] = profile_return_object(array(258 $data['profile:details'][] = (object)(array( 259 259 "name" => __gettext("High School"), 260 260 "internal_name" => "highschool", 261 261 "field_type" => "text", 262 262 "category" => __gettext("Education"))); 263 $data['profile:details'][] = profile_return_object(array(263 $data['profile:details'][] = (object)(array( 264 264 "name" => __gettext("University / College"), 265 265 "internal_name" => "university", 266 266 "field_type" => "text", 267 267 "category" => __gettext("Education"))); 268 $data['profile:details'][] = profile_return_object(array(268 $data['profile:details'][] = (object)(array( 269 269 "name" => __gettext("Degree"), 270 270 "internal_name" => "universitydegree", 271 271 "field_type" => "text", 272 272 "category" => __gettext("Education"))); 273 $data['profile:details'][] = profile_return_object(array(273 $data['profile:details'][] = (object)(array( 274 274 "name" => __gettext("Main Skills"), 275 275 "internal_name" => "skills",
