Skip to content

Commit

Permalink
user MDL-25094 adding message link to the user course profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Davis committed Nov 8, 2010
1 parent a8e3b00 commit 42ec733
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions theme/base/style/user.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
.userselector div label {margin-right: 0.3em;}
#userselector_options .collapsibleregioncaption {font-weight: bold;}
#userselector_options p {margin:0.2em 0;text-align:left;}
/** user full profile */
#page-user-profile .messagebox {text-align:center;margin-left:auto;margin-right:auto;}
/** user course profile */
#page-course-view-weeks .messagebox {text-align:center;margin-left:auto;margin-right:auto;}

/** Overide for RTL layout **/
.dir-rtl .userprofile .profilepicture {float:right; margin-left:20px;margin-right:0px;}
Expand Down
8 changes: 8 additions & 0 deletions user/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,14 @@

echo "</table></div></div>";

// Print messaging link if allowed
if (isloggedin() && has_capability('moodle/site:sendmessage', $usercontext)
&& !empty($CFG->messaging) && !isguestuser() && !isguestuser($user) && ($USER->id != $user->id)) {
echo '<div class="messagebox">';
echo '<a href="'.$CFG->wwwroot.'/message/index.php?id='.$user->id.'">'.get_string('messageselectadd').'</a>';
echo '</div>';
}

if ($currentuser || has_capability('moodle/user:viewdetails', $usercontext) || has_coursecontact_role($id)) {
echo '<div class="fullprofilelink">';
echo html_writer::link($CFG->wwwroot.'/user/profile.php?id='.$id, get_string('fullprofile'));
Expand Down

0 comments on commit 42ec733

Please sign in to comment.