- Posts: 44
[Closed] Link Moodle Profile to Jomsocial Profile
- adamtong
- Topic Author
- Offline
- Senior Member
-
I found that when I am in Moodle, I can click the "edit profile" to enter the profile page in Moodle.
However, when I am in Jomsicial, I also have a jomsocial profile page. it is quite odd to have 2 type of profile pages.
How to link the Moodle profile page to jomsocial profile page instead?
That means when I click the Moodle profile page, i will enter into Jomsocial profile page.
Thanks
Please Log in or Create an account to join the conversation.
- Chris
-
- Offline
- Moderator
-
1) editing the profile page
2) linking
For 1) you can lock your profile so that is is not editable from within Moodle. Just edit your joomdle configuration inside moodle to specify which fields are locked.
2) You would need to hack Moodle for this. I am not aware of an existing hack or if anybody else has done this yet. It should not be that hard however.
Please Log in or Create an account to join the conversation.
- adamtong
- Topic Author
- Offline
- Senior Member
-
- Posts: 44
Then I map the fileds with Jomsocial by Joomdle's mapping setting.
I just found that I cannot map the firstname and lastname in mapping.
But this way can make users only edit their profile in Jomsocial.
But I don't know whether is is possible to move the code in editlib.php from Moodle to jomsocial:
$mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
} else {
$mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
$mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
}
$mform->addRule('firstname', $strrequired, 'required', null, 'client');
$mform->setType('firstname', PARAM_NOTAGS);
$mform->addRule('lastname', $strrequired, 'required', null, 'client');
$mform->setType('lastname', PARAM_NOTAGS);
$choices = array();
$choices = get_string('emaildigestoff');
$choices = get_string('emaildigestcomplete');
$choices = get_string('emaildigestsubjects');
$mform->addElement('select', 'maildigest', get_string('emaildigest'), $choices);
$mform->setDefault('maildigest', 0);
$choices = array();
$choices = get_string('autosubscribeyes');
$choices = get_string('autosubscribeno');
$mform->addElement('hidden', 'autosubscribe', get_string('autosubscribe'), $choices);//changed 'select' to 'hidden'
$mform->setDefault('autosubscribe', 1);
if (!empty($CFG->forum_trackreadposts)) {
$choices = array();
$choices = get_string('trackforumsno');
$choices = get_string('trackforumsyes');
$mform->addElement('select', 'trackforums', get_string('trackforums'), $choices);
$mform->setDefault('trackforums', 0);
}
Please Log in or Create an account to join the conversation.
- Chris
-
- Offline
- Moderator
-
But I do not know why you wish to move the moodle code across? I would think this would be more work than looking at jomsocial code as all the fields and classes are different.
Why not just create a new field in Jomsocial for first and/or last name and map that across? Personally I would use the current name field as "display name" and then create a first and last name. Map these across to moodle and done.
Please Log in or Create an account to join the conversation.
- adamtong
- Topic Author
- Offline
- Senior Member
-
- Posts: 44
Let me try this method.
Please Log in or Create an account to join the conversation.
- Jeff Paul
- Offline
- Junior Member
-
- Posts: 31
chris wrote: Why not just create a new field in Jomsocial for first and/or last name and map that across? Personally I would use the current name field as "display name" and then create a first and last name. Map these across to moodle and done.
This is what I did and it works fine. The only drawback is that the new register in JomSocial needs to enter a screen name, user name and then on the second page of the registration enter their first and second names in the new separate fields. That's only a minor inconvenience and saves them from entering the last two directly in their Moodle profile.
Please Log in or Create an account to join the conversation.
- Chris
-
- Offline
- Moderator
-
Please Log in or Create an account to join the conversation.
- Jeff Paul
- Offline
- Junior Member
-
- Posts: 31
chris wrote: What screens and fields are field into the Jomsocial fields is up to you. If you do not want to use two screens, you can set it up this way. Have a play around with Jomsocial or if you really are adventurous have a look at Joomlaxi. They enhance the Jomsocial log and user experience.
Agreed, I've knocked off many of the superfluous fields in JomSocial but I kept the first and last names I added live (and mapped) since the Moodle record says they're required. The great news is that Joomdle creates a usable Moodle user even without the first and last name filled. Web owner's choice. JSPT from joomlaxi is tremendous. Playing with it now to make sure I can differentiate between what teachers and students can access.
Sorry for thread stealing, but while I'm here, I'm still having the nagging issue with the server error when logging out from the Moodle side in the wrapper. It seems to be logging out on both Moodle/Joomla sides but only after the error message shows and I do a browser refresh. It looks like a problem with the session key or redirect routine on logout, but I'm not sure at that stage if I should be looking in the Moodle, the Joomdle or the Joomla files. Any ideas?
Cheers.
Please Log in or Create an account to join the conversation.