root/devel/mod/profile/profile.config.php

Revision 1532, 36.8 kB (checked in by ewout, 10 months ago)

Fix mistake in r1531.

  • Property svn:eol-style set to native
Line 
1 <?php
2
3         global $data;
4         $run_result = '';
5         // Initial profile data
6
7         /* Profile info WAS of the format:
8     
9         $data['profile:details'][] = array(
10                                                 Description,
11                                                 Short / unique internal name,
12                                                 Type of field,
13                                                 User instructions for entering data,
14                                                 Optional: type of user that can see this field
15                                                     (e.g. "person", "community" etc)
16                                             )
17         e.g.
18         $data['profile:details'][] = array(__gettext("Interests"),"interests","keywords",__gettext("Separated with commas."));
19         
20         It is NOW of the format:
21         
22         $obj = new stdClass;
23     $obj->name              // Description
24     $obj->internal_name     // Short / unique internal name
25     $obj->field_type        // Type of field
26     $obj->description       // User instructions for entering data
27     $obj->user_type         // Type of user that can see this field
28     $obj->required          // True/false: whether field is required
29     $obj->category          // Category field sits in
30     $obj->invisible         // If true, won't display except on edit screen
31     $obj->registration      // Will appear on user registration
32     $obj->col1              // If true, will appear on the profile, first column
33                             // otherwise, only on the extended profile
34     $obj->default_access    // if $CFG->default_access = 'PUBLIC', set this
35                             // to 'LOGGED_IN' or 'PRIVATE' to force a field to default to
36                 // 'LOGGED_IN'. This is to avoid users making things
37                 // public by mistake.
38         $data['profile:details'][] = $obj;
39
40         Additions to this data structure will input/output a corresponding FOAF field
41         
42         $data['foaf:profile'][] = array(
43                                             Short / unique internal name,
44                                             Corresponding FOAF schema field
45                                             "collated" or "individual" -     whether multiple data elements (eg interests)
46                                                                             should be in separate tags ("individual") or
47                                                                             in the same tag separated by commas
48                                                                             (collated = default)
49                                             "resource" or "enclosed" -         whether the data is an rdf:resource="" attribute
50                                                                             or enclosed within the tag
51                                                                             (resource = default)
52                                         )
53         e.g.
54         $data['foaf:profile'][] = array("interests","foaf:interest");
55         
56         Also present is $data['vcard:profile:adr'][] for VCard ADR elements within the FOAF file
57         e.g.
58         $data['vcard:profile:adr'][] = array("streetaddress","vCard:Street","collated");
59         */
60
61         $data['profile:details'][] = (object)(array(
62                                                                     "name" => __gettext("Profile photo"),
63                                                                     "internal_name" => "profilephoto",
64                                                                     "field_type" => "profile_photo",
65                                                                     "description" => __gettext("Photo to display at the top of your profile."),
66                                                                     "category" => __gettext("Basic details"),
67                                                                     "col1" => true,
68                                                                     "invisible" => false,
69                                                                     "required" => false,
70                                                                     "user_type" => "",
71                                                                     ));
72         
73         $data['profile:details'][] = (object)(array(
74                                                                     "name" => __gettext("Who am I?"),
75                                                                     "internal_name" => "biography",
76                                                                     "field_type" => "longtext",
77                                                                     "description" => __gettext("A short introduction for you."),
78                                                                     "user_type" => "person",
79                                                                     "category" => __gettext("Basic details"),
80                                                                     "invisible" => false,
81                                                                     "required" => false,
82                                     "col2" => true,
83                                                                     ));
84         $data['profile:details'][] = (object)(array(
85                                                                     "name" => __gettext("Introduction"),
86                                                                     "internal_name" => "biography",
87                                                                     "field_type" => "longtext",
88                                                                     "description" => __gettext("A short introduction to this community."),
89                                                                     "user_type" => "community",
90                                                                     "category" => __gettext("Basic details"),
91                                                                     "invisible" => false,
92                                                                     "required" => false,
93                                     "col2" => true,
94                                                                     ));
95
96         $data['foaf:profile'][] = array("biography","bio:olb","collated","enclosed");
97
98         $data['profile:details'][] = (object)(array(
99                                                                     "name" => __gettext("Brief description"),
100                                                                     "internal_name" => "minibio",
101                                                                     "field_type" => "text",
102                                                                     "description" => __gettext("For use in your sidebar profile."),
103                                                                     "category" => __gettext("Basic details"),
104                                                                     "invisible" => false,
105                                                                     "col1" => true,
106                                                                     "required" => false,
107                                                                     "user_type" => "",
108                                                                     ));
109
110         // $data['profile:details'][] = array(__gettext("Postal address"),"postaladdress","mediumtext");
111         $data['profile:details'][] = (object)(array(
112                                                                     "name" => __gettext("Street address"),
113                                                                     "internal_name" => "streetaddress",
114                                                                     "field_type" => "text",
115                                                                     "description" => "",
116                                                                     "category" => __gettext("Location"),
117                                                                     "invisible" => false,
118                                                                     "required" => false,
119                                                                     "user_type" => "",
120                                     "default_access" => 'PRIVATE',
121                                                                     ));
122         $data['vcard:profile:adr'][] = array("streetaddress","vCard:Street","collated","enclosed");
123
124         $data['profile:details'][] = (object)(array(
125                                                                     "name" => __gettext("Town"),
126                                                                     "internal_name" => "town",
127                                                                     "field_type" => "keywords",
128                                                                     "description" => "",
129                                                                     "category" => __gettext("Location"),
130                                                                     "col1" => true,
131                                                                     "invisible" => false,
132                                                                     "required" => false,
133                                                                     "user_type" => "",
134                                                                     ));
135         $data['vcard:profile:adr'][] = array("town","vCard:Locality","collated","enclosed");
136
137         $data['profile:details'][] = (object)(array(
138                                                                     "name" => __gettext("State / Region"),
139                                                                     "internal_name" => "state",
140                                                                     "field_type" => "keywords",
141                                                                     "description" => "",
142                                                                     "category" => __gettext("Location"),
143                                                                     "invisible" => false,
144                                                                     "required" => false,
145                                                                     "user_type" => "",
146                                                                     ));
147         $data['vcard:profile:adr'][] = array("state","vCard:Region","collated","enclosed");
148
149         $data['profile:details'][] = (object)(array(
150                                                                     "name" => __gettext("Postal code"),
151                                                                     "internal_name" => "postcode",
152                                                                     "field_type" => "text",
153                                                                     "description" => "",
154                                                                     "category" => __gettext("Location"),
155                                                                     "invisible" => false,
156                                                                     "required" => false,
157                                                                     "user_type" => "",
158                                                                     ));
159         $data['vcard:profile:adr'][] = array("postcode","vCard:Pcode","collated","enclosed");
160         
161         $data['profile:details'][] = (object)(array(
162                                                                     "name" => __gettext("Country"),
163                                                                     "internal_name" => "country",
164                                                                     "field_type" => "keywords",
165                                                                     "description" => "",
166                                                                     "category" => __gettext("Location"),
167                                                                     "invisible" => false,
168                                                                     "required" => false,
169                                                                     "user_type" => "",
170                                                                     ));
171         $data['vcard:profile:adr'][] = array("country","vCard:Country","collated","enclosed");
172         
173         $data['profile:details'][] = (object)(array(
174                                                                     "name" => __gettext("Email address"),
175                                                                     "internal_name" => "emailaddress",
176                                                                     "field_type" => "email",
177                                                                     "description" => "",
178                                                                     "category" => __gettext("Contact"),
179                                                                     "invisible" => false,
180                                                                     "required" => false,
181                                                                     "user_type" => "",
182                                                                     ));
183         
184         $data['profile:details'][] = (object)(array(
185                                                                     "name" => __gettext("Work telephone"),
186                                                                     "internal_name" => "workphone",
187                                                                     "field_type" => "text",
188                                                                     "description" => "",
189                                                                     "category" => __gettext("Contact"),
190                                                                     "invisible" => false,
191                                                                     "required" => false,
192                                                                     "user_type" => "",
193                                                                     ));
194         $data['foaf:profile'][] = array("workphone","foaf:phone","individual","resource");
195         
196         $data['profile:details'][] = (object)(array(
197                                                                     "name" => __gettext("Home telephone"),
198                                                                     "internal_name" => "homephone",
199                                                                     "field_type" => "text",
200                                                                     "description" => "",
201                                                                     "category" => __gettext("Contact"),
202                                                                     "invisible" => false,
203                                                                     "required" => false,
204                                                                     "user_type" => "",
205                                     "default_access" => 'PRIVATE',
206                                                                     ));
207         $data['foaf:profile'][] = array("homephone","foaf:phone","individual","resource");
208         
209         $data['profile:details'][] = (object)(array(
210                                                                     "name" => __gettext("Mobile telephone"),
211                                                                     "internal_name" => "mobphone",
212                                                                     "field_type" => "text",
213                                                                     "description" => "",
214                                                                     "category" => __gettext("Contact"),
215                                                                     "invisible" => false,
216                                                                     "required" => false,
217                                                                     "user_type" => "",
218                                                                     ));
219         $data['foaf:profile'][] = array("mobphone","foaf:phone","individual","resource");
220         
221         $data['profile:details'][] = (object)(array(
222                                                                     "name" => __gettext("Official website address"),
223                                                                     "internal_name" => "workweb",
224                                                                     "field_type" => "web",
225                                                                     "description" => __gettext("The URL to your official website, if you have one."),
226                                                                     "category" => __gettext("Contact"),
227                                                                     "invisible" => false,
228                                                                     "required" => false,
229                                                                     "col2" => true,
230                                                                     "user_type" => "",
231                                     "default_access" => 'PRIVATE',
232                                                                     ));
233         $data['foaf:profile'][] = array("workweb","foaf:workplaceHomepage","individual","resource");
234         
235         $data['profile:details'][] = (object)(array(
236                                                                     "name" => __gettext("Personal website address"),
237                                                                     "internal_name" => "personalweb",
238                                                                     "field_type" => "web",
239                                                                     "description" => __gettext("The URL to your personal website, if you have one."),
240                                                                     "category" => __gettext("Contact"),
241                                                                     "invisible" => false,
242                                                                     "required" => false,
243                                                                     "col2" => true,
244                                                                     "user_type" => "",
245                                                                     ));
246         $data['foaf:profile'][] = array("personalweb","foaf:homepage","individual","resource");
247         
248         $data['profile:details'][] = (object)(array(
249                                                                     "name" => __gettext("ICQ number"),
250                                                                     "internal_name" => "icq",
251                                                                     "field_type" => "icq",
252                                                                     "description" => "",
253                                                                     "category" => __gettext("Contact"),
254                                                                     "invisible" => false,
255                                                                     "required" => false,
256                                                                     "user_type" => "",
257                                                                     ));
258         $data['foaf:profile'][] = array("icq","foaf:icqChatID","individual","enclosed");
259         
260         $data['profile:details'][] = (object)(array(
261                                                                     "name" => __gettext("MSN chat"),
262                                                                     "internal_name" => "msn",
263                                                                     "field_type" => "msn",
264                                                                     "description" => "",
265                                                                     "category" => __gettext("Contact"),
266                                                                     "invisible" => false,
267                                                                     "required" => false,
268                                                                     "user_type" => "",
269                                                                     ));
270         $data['foaf:profile'][] = array("msn","foaf:msnChatID","individual","enclosed");
271         
272         $data['profile:details'][] = (object)(array(
273                                                                     "name" => __gettext("AIM screenname"),
274                                                                     "internal_name" => "aim",
275                                                                     "field_type" => "aim",
276                                                                     "description" => "",
277                                                                     "category" => __gettext("Contact"),
278                                                                     "invisible" => false,
279                                                                     "required" => false,
280                                                                     "user_type" => "",
281                                                                     ));
282         $data['foaf:profile'][] = array("aim","foaf:aimChatID","individual","enclosed");
283         
284         $data['profile:details'][] = (object)(array(
285                                                                     "name" => __gettext("Skype username"),
286                                                                     "internal_name" => "skype",
287                                                                     "field_type" => "skype",
288                                                                     "description" => "",
289                                                                     "category" => __gettext("Contact"),
290                                                                     "invisible" => false,
291                                                                     "required" => false,
292                                                                     "user_type" => "",
293                                                                     ));
294         
295         $data['profile:details'][] = (object)(array(
296                                                                     "name" => __gettext("Jabber username"),
297                                                                     "internal_name" => "jabber",
298                                                                     "field_type" => "text",
299                                                                     "description" => "",
300                                                                     "category" => __gettext("Contact"),
301                                                                     "invisible" => false,
302                                                                     "required" => false,
303                                                                     "user_type" => "",
304                                                                     ));
305         $data['foaf:profile'][] = array("jabber","foaf:jabberChatID","individual","enclosed");
306         
307         $data['profile:details'][] = (object)(array(
308                                                                     "name" => __gettext("Interests"),
309                                                                     "internal_name" => "interests",
310                                          &