Forum OpenACS Development: Re: Extending .LRN Portal types

Collapse
Posted by Victor Guerra on
This is what i have so far:

I added a field ('parent_type') to dotlrn_portal_types_map table, the reason of this field is to indicate which is the parent portal type for a given portal type (This new field references 'type' in the same table.) In this way we can define dotlrn portal "subtypes" based on the default types.

So now on, I have the 4 default dotlrn portal types and im able to define more dotlrn portal types based on the 4 default. (e.g. i am able to add the type "user_advanced" which parent_type value is user).

I added a parameters secction in dotlrn package, named ".LRN Portal Types", in this section there are 4 parameters "dotlrn_class_instance","dotlrn_club","dotlrn_community","user" (this names matches with the default dotlrn portal types as you can see). Each parameter indicates wich portal type has to be used when creating a portal for each type.

For example if the value of the parameter "user" is "user_advanced", then, when creating the portal of the dotlrn users, the template used will the portal associated with the "user_advanced" portal type.

In the portal-templates page (/dotlrn/admin), you can define more dotlrn-portal-types based on the default ones, basically you can 'clone' the default types and make modifications on the new portal types. Also, you can define wich subtype has to be used as default when creating portals for users, communities , classes and subgroups.

Finally each user/community administrator, can change the portal type asigned to them. If a given user wants to modify his portal type, he goes to the control panel tab and selects 'change portal type', then the options presented to him are the "user" portal type and all the subtypes of this portal type (all rows in dotlrn_portal_types which parent_type is "user"). This procees basically takes the user portal and compares it with portal_id asigned to the portal type that he selected to change to. Pages and portal elements are removed or added as needed.

Anny comments or sugestions on this functionality are welcome =).

Regards,
Victor Guerra.