ATTENTION: THE PROFILE MODULE IS PRE ALPHA VERSION !!! DON'T USE IT EXCEPT TRIAL ENVIRONMENT.
XCL2.2 Profile module prototype version
=======================================
As next XCL(2.2)'s user function, I have uploaded prototype version of Profile module and User module.
About this feature, see the following tracker url.
https://sourceforge.net/tracker/index.p ... tid=943472
Now this modules are just trial version. So many functions are not work. I would like to your comment and request about this module(Though I hope to keep this module simple...(^ ^).
Profile module manages user's profiles like gender, birthday, hobby, etc.
The site owner can define these profile field easily.
Each user can edit his profile defined by the site owner on Profile module, or other modueles.
This Profile module provides XCube Service for other modules. So, other modules can use Profile module's data through the way of XCube Service.
- Modules can request profile field list.
- Modules can request profile data of certain user.
- Modules can set profile data of certain user. For example, a Q&A module can set the number the user answers to the Profile module.
See the following "Profile_Service" section.
How to use:
-----------
At first, install the Profile module typically.
After installation, you should add profile field definitions on admin menu of the Profile module. See "Profile Field Definition" section below.
Then, users can edit his profile on the Profile module.
The User module within the zip file are almost the same as XCL 2.1.6.
But on the UserInfo, it displays profile fields.
And on the Edituser, its edit form contains profile fields.
Oh, the profile fields of Edituser don't work now other than named 'homepage_url'.
Profile Field Definition:
-------------------------
field name: mysql's field name. So spaces, some mark are invalid on this field.
label: The profile field's label. Users see this label as field name.
type: Type of input. Now you can select "string", "text", "int", "date", "checkbox" or "selectbox". It is just on a trial basis.
validation: This field provide no function now...
required: If you check this, the field will be required to input.
show form: If you check this, the field will be shown on the profile edit form.
weight: The order of the fields. The lower score appears first.
description: The description of the field.
access: Permitted groups access to this field. The site owner can specify which user group can see this field.
options: Options of select box. But select box don't work now...
Profile_Service:
----------------
Profile_Service is based on XCube_Service.
Other modules can use this service to manage profiles.
Now Profile_Service provides 4 functions.
getDefinitions(int uid, int groupid, bool show_form): get profile field definitions. If uid or groupid are specified, you can get the fields of the user/group can access. If show_form is true, you can get the fields "show_form" is true only.
getProfile(int uid): get profile data of the given user's.
getProfileArr(string field_name, string value): get the profile data of all users. Request of field_name and value is condition of filtering data.
setProfile(string field_name, string value, int uid): insert/update the profile data of the given user's.
Developers can see the sample code on
- modules/user/actions/EditUserAction.class.php
- modules/user/actions/UserInfoAction.class.php
