Fixing a small css issue in the user class.
[elgg.git] / units / communities / communities_membership_requests.php
blob632ee26f55305776b6fdf1f77358277eb7c0d8ff
1 <?php
2 global $CFG;
3 $body = '';
4 // Lists membership requests for a community
6 if (logged_on) {
8 global $page_owner;
9 if (user_type($page_owner) == "community" && run("permissions:check",array("userdetails:change", $page_owner))) {
10 $title = run("profile:display:name") . " :: ". __gettext("Membership requests") ."";
12 if ($pending_requests = get_records_sql('SELECT fr.ident AS request_id, u.* FROM '.$CFG->prefix.'friends_requests fr
13 LEFT JOIN '.$CFG->prefix.'users u ON u.ident = fr.owner
14 WHERE fr.friend = ? ORDER BY u.name ASC',array($page_owner))) {
15 $body .= "<p>" . __gettext("The following users would like to join this community. They need your approval to do this (to change this setting, visit the 'community settings' page).") . "</p>";
17 foreach($pending_requests as $pending_user) {
19 $where = run("users:access_level_sql_where",$_SESSION['userid']);
20 if ($description = get_record_select('profile_data',"($where) AND name = 'minibio' and owner = " . $pending_user->ident)) {
21 $description = "<p>" . stripslashes($description->value) . "</p>";
22 } else {
23 $description = "<p>&nbsp;</p>";
26 $request_id = $pending_user->request_id;
28 $pending_user->name = run("profile:display:name",$pending_user->ident);
30 $col1 = "<p><b>" . $pending_user->name . "</b></p>" . $description;
31 $col1 .= "<p>";
32 $col1 .= '<a href="' . url . $pending_user->username . '/">' . __gettext("Profile") . "</a> | ";
33 $col1 .= '<a href="' . url . $pending_user->username . '/weblog/">' . __gettext("Blog") . "</a></p>";
34 $col2 = '<p><a href="' .url. "_communities/requests.php?action=community:approve:request&amp;request_id=$request_id&amp;owner=$page_owner\">Approve</a> | <a href=\"" .url. "_communities/requests.php?action=community:decline:request&amp;request_id=$request_id&amp;owner=$page_owner\">Decline</a></p>";
35 $ident = $pending_user->ident;
37 $body .= templates_draw(array(
38 'context' => 'adminTable',
39 'name' => '<img src="' . url . '_icon/user/' . $pending_user->icon . '" />',
40 'column1' => $col1,
41 'column2' => $col2
47 } else {
48 $body .= "<p>" . __gettext("You have no pending membership requests.") . "</p>";
51 $run_result = templates_draw( array(
52 'context' => 'contentholder',
53 'title' => $title,
54 'body' => $body