Fixing a small css issue in the user class.
[elgg.git] / units / friends / user_info_menu_text.php
blobec7d16d4388dc04cc25e3f89f2dbbf7608721236
1 <?php
2 global $CFG,$USER;
3 global $user_type;
5 // If we've been passed a valid user ID as a parameter ...
6 if (isset($parameter) && (isset($parameter[0])) && ($parameter[0] != $_SESSION['userid']) && logged_on) {
8 $user_id = (int) $parameter[0];
10 if (user_type($user_id) == "person" || user_type($user_id) == "external") {
12 if (!count_records_sql('SELECT COUNT(u.ident) FROM '.$CFG->prefix.'friends f
13 JOIN '.$CFG->prefix.'users u ON u.ident = f.friend
14 WHERE f.owner = ? AND f.friend = ?',array($USER->ident,$user_id))) {
15 $moderation = user_info('moderation',$user_id);
16 switch ($moderation) {
17 case 'no':
18 case 'yes':
19 $run_result = "<a href=\"".url."_friends/index.php?friends_name=".$_SESSION['username']."&amp;action=friend&amp;friend_id=$user_id\" onclick=\"return confirm('". __gettext("Are you sure you want to add this user as a friend?") ."')\">" . __gettext("Click here to add this user as a friend."). "</a>";
20 break;
21 case 'priv':
22 $run_result = '';
23 break;
25 } else {
26 $run_result = "<a href=\"".url."_friends/index.php?friends_name=".$_SESSION['username']."&amp;action=unfriend&amp;friend_id=$user_id\" onclick=\"return confirm('". __gettext("Are you sure you want to remove this user from your friends list?") ."')\">" . __gettext("Click here to remove this user from your friends list."). "</a>";