Changeset 598

Show
Ignore:
Timestamp:
09/26/06 19:33:59 (2 years ago)
Author:
ben
Message:

Profile fields are now abstracted to mod/profile/profile.config.php.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/profile/lib.php

    r573 r598  
    4444function profile_init() { 
    4545     
    46     global $CFG
     46    global $CFG, $messages, $function
    4747     
     48    // Check to see if the profile config file doesn't exist 
     49    if (!isset($CFG->profileroot)) { 
     50        $CFG->profileroot = $CFG->dirroot . "mod/profile/"; 
     51    } 
     52     
     53    $function['search:init'][] = $CFG->dirroot . "mod/profile/profile.config.php"; 
     54     
     55    // Add items to the dashboard if it exists 
    4856    $CFG->widgets->display['profile'] = "profile_widget_display"; 
    4957    $CFG->widgets->edit['profile'] = "profile_widget_edit"; 
  • devel/profile/profile.class.php

    r573 r598  
    145145    function editfield_defaults () { 
    146146 
    147         global $data; 
    148         $run_result = ''; 
    149         // Initial profile data 
    150  
    151         /* Profile info is of the format: 
    152      
    153         $data['profile:details'][] = array( 
    154                                                 Description, 
    155                                                 Short / unique internal name, 
    156                                                 Type of field, 
    157                                                 User instructions for entering data, 
    158                                                 Optional: type of user that can see this field 
    159                                                     (e.g. "person", "community" etc) 
    160                                             ) 
    161         e.g. 
    162         $data['profile:details'][] = array(gettext("Interests"),"interests","keywords",gettext("Separated with commas.")); 
    163  
    164         Additions to this data structure will input/output a corresponding FOAF field 
    165          
    166         $data['foaf:profile'][] = array( 
    167                                             Short / unique internal name, 
    168                                             Corresponding FOAF schema field 
    169                                             "collated" or "individual" -     whether multiple data elements (eg interests) 
    170                                                                             should be in separate tags ("individual") or  
    171                                                                             in the same tag separated by commas 
    172                                                                             (collated = default) 
    173                                             "resource" or "enclosed" -         whether the data is an rdf:resource="" attribute 
    174                                                                             or enclosed within the tag 
    175                                                                             (resource = default) 
    176                                         ) 
    177         e.g. 
    178         $data['foaf:profile'][] = array("interests","foaf:interest"); 
    179          
    180         Also present is $data['vcard:profile:adr'][] for VCard ADR elements within the FOAF file 
    181         e.g. 
    182         $data['vcard:profile:adr'][] = array("streetaddress","vCard:Street","collated"); 
    183         */ 
    184      
    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"); 
    187         $data['foaf:profile'][] = array("biography","bio:olb","collated","enclosed"); 
    188          
    189         $data['profile:details'][] = array(gettext("Brief description"),"minibio","text",gettext("For use in your sidebar profile.")); 
    190          
    191         // $data['profile:details'][] = array(gettext("Postal address"),"postaladdress","mediumtext"); 
    192         $data['profile:details'][] = array(gettext("Street address"),"streetaddress","text"); 
    193         $data['vcard:profile:adr'][] = array("streetaddress","vCard:Street","collated","enclosed"); 
    194          
    195         $data['profile:details'][] = array(gettext("Town"),"town","keywords"); 
    196         $data['vcard:profile:adr'][] = array("town","vCard:Locality","collated","enclosed"); 
    197          
    198         $data['profile:details'][] = array(gettext("State / Region"),"state","keywords"); 
    199         $data['vcard:profile:adr'][] = array("state","vCard:Region","collated","enclosed"); 
    200          
    201         $data['profile:details'][] = array(gettext("Postal code"),"postcode","text"); 
    202         $data['vcard:profile:adr'][] = array("postcode","vCard:Pcode","collated","enclosed"); 
    203          
    204         $data['profile:details'][] = array(gettext("Country"),"country","keywords"); 
    205         $data['vcard:profile:adr'][] = array("country","vCard:Country","collated","enclosed"); 
    206          
    207         $data['profile:details'][] = array(gettext("Email address"),"emailaddress","email"); 
    208          
    209         $data['profile:details'][] = array(gettext("Work telephone"),"workphone","text"); 
    210         $data['foaf:profile'][] = array("workphone","foaf:phone","individual","resource"); 
    211          
    212         $data['profile:details'][] = array(gettext("Home telephone"),"homephone","text"); 
    213         $data['foaf:profile'][] = array("homephone","foaf:phone","individual","resource"); 
    214          
    215         $data['profile:details'][] = array(gettext("Mobile telephone"),"mobphone","text"); 
    216         $data['foaf:profile'][] = array("mobphone","foaf:phone","individual","resource"); 
    217          
    218         $data['profile:details'][] = array(gettext("Official website address"),"workweb","web",gettext("The URL to your official website, if you have one.")); 
    219         $data['foaf:profile'][] = array("workweb","foaf:workplaceHomepage","individual","resource"); 
    220          
    221         $data['profile:details'][] = array(gettext("Personal website address"),"personalweb","web",gettext("The URL to your personal website, if you have one.")); 
    222         $data['foaf:profile'][] = array("personalweb","foaf:homepage","individual","resource"); 
    223          
    224         $data['profile:details'][] = array(gettext("ICQ number"),"icq","icq"); 
    225         $data['foaf:profile'][] = array("icq","foaf:icqChatID","individual","enclosed"); 
    226          
    227         $data['profile:details'][] = array(gettext("MSN chat"),"msn","msn"); 
    228         $data['foaf:profile'][] = array("msn","foaf:msnChatID","individual","enclosed"); 
    229          
    230         $data['profile:details'][] = array(gettext("AIM screenname"),"aim","aim"); 
    231         $data['foaf:profile'][] = array("aim","foaf:aimChatID","individual","enclosed"); 
    232          
    233         $data['profile:details'][] = array(gettext("Skype username"),"skype","skype"); 
    234          
    235         $data['profile:details'][] = array(gettext("Jabber username"),"jabber","text"); 
    236         $data['foaf:profile'][] = array("jabber","foaf:jabberChatID","individual","enclosed"); 
    237          
    238         $data['profile:details'][] = array(gettext("Interests"),"interests","keywords",gettext("Separated with commas.")); 
    239         $data['foaf:profile'][] = array("interests","foaf:interest","individual","resource"); 
    240         // $data['foaf:profile'][] = array("interests","bio:keywords","collated","enclosed"); 
    241          
    242         $data['profile:details'][] = array(gettext("Likes"),"likes","keywords",gettext("Separated with commas.")); 
    243         $data['profile:details'][] = array(gettext("Dislikes"),"dislikes","keywords",gettext("Separated with commas.")); 
    244         $data['profile:details'][] = array(gettext("Occupation"),"occupation","text"); 
    245         $data['profile:details'][] = array(gettext("Industry"),"industry","keywords"); 
    246          
    247         $data['profile:details'][] = array(gettext("Company / Institution"),"organisation","text"); 
    248         $data['foaf:profile'][] = array("organisation","foaf:organization","collated","enclosed"); 
    249          
    250         $data['profile:details'][] = array(gettext("Job Title"),"jobtitle","text"); 
    251         $data['profile:details'][] = array(gettext("Job Description"),"jobdescription","text"); 
    252         $data['profile:details'][] = array(gettext("I would like to ..."),"goals","keywords",gettext("Separated with commas.")); 
    253         $data['profile:details'][] = array(gettext("Career Goals"),"careergoals","longtext",gettext("Freeform: let colleagues and potential employers know what you'd like to get out of your career.")); 
    254         $data['profile:details'][] = array(gettext("Level of Education"),"educationlevel","text"); 
    255         $data['profile:details'][] = array(gettext("High School"),"highschool","text"); 
    256         $data['profile:details'][] = array(gettext("University / College"),"university","text"); 
    257         $data['profile:details'][] = array(gettext("Degree"),"universitydegree","text"); 
    258         $data['profile:details'][] = array(gettext("Main Skills"),"skills","keywords",gettext("Separated with commas.")); 
     147        global $CFG; 
     148        include($CFG->profilelocation . "profile.config.php"); 
    259149        return $run_result; 
    260150    } 
  • devel/units/profile/main.php

    r585 r598  
    1111    // Initialisation for the search function 
    1212        $function['search:init'][] = path . "units/profile/function_init.php"; 
    13         $function['search:init'][] = path . "units/profile/function_editfield_defaults.php"; 
     13        // $function['search:init'][] = path . "units/profile/function_editfield_defaults.php"; 
    1414        $function['search:all:tagtypes'][] = path . "units/profile/function_search_all_tagtypes.php"; 
    1515        $function['search:all:tagtypes:rss'][] = path . "units/profile/function_search_all_tagtypes_rss.php";