Skip to content

Commit

Permalink
MDL-49819 profile: Move email to top and interests to lower location
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart authored and abgreeve committed Apr 13, 2015
1 parent 87223ef commit 08cb34a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/myprofilelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
$tree->add_node($node);
}

// Printing tagged interests. We want this only for full profile.
if (!empty($CFG->usetags) && empty($course)) {
if ($interests = tag_get_tags_csv('user', $user->id) ) {
$node = new core_user\output\myprofile\node('contact', 'interests', get_string('interests'), null, null, $interests);
$tree->add_node($node);
}
if (isset($identityfields['email']) and ($iscurrentuser
or $user->maildisplay == 1
or has_capability('moodle/course:useremail', $usercontext)
or ($user->maildisplay == 2 and enrol_sharing_course($user, $USER)))) {
$node = new core_user\output\myprofile\node('contact', 'email', get_string('email'), null, null,
obfuscate_mailto($user->email, ''));
$tree->add_node($node);
}

if (!isset($hiddenfields['country']) && $user->country) {
Expand Down Expand Up @@ -196,15 +197,6 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
$tree->add_node($node);
}

if (isset($identityfields['email']) and ($iscurrentuser
or $user->maildisplay == 1
or has_capability('moodle/course:useremail', $usercontext)
or ($user->maildisplay == 2 and enrol_sharing_course($user, $USER)))) {
$node = new core_user\output\myprofile\node('contact', 'email', get_string('email'), null, null,
obfuscate_mailto($user->email, ''));
$tree->add_node($node);
}

if ($user->url && !isset($hiddenfields['webpage'])) {
$url = $user->url;
if (strpos($user->url, '://') === false) {
Expand All @@ -215,6 +207,14 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user,
$tree->add_node($node);
}

// Printing tagged interests. We want this only for full profile.
if (!empty($CFG->usetags) && empty($course)) {
if ($interests = tag_get_tags_csv('user', $user->id) ) {
$node = new core_user\output\myprofile\node('contact', 'interests', get_string('interests'), null, null, $interests);
$tree->add_node($node);
}
}

if (!isset($hiddenfields['mycourses'])) {
$showallcourses = optional_param('showallcourses', 0, PARAM_INT);
if ($mycourses = enrol_get_all_users_courses($user->id, true, null, 'visible DESC, sortorder ASC')) {
Expand Down

0 comments on commit 08cb34a

Please sign in to comment.