Commit 30ac3c9a authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

added username, introduction, profile picture to denyrequest, removefriend,...

added username, introduction, profile picture to denyrequest, removefriend, requestfriendship and sendmessage pages
parent f30dcd8e
......@@ -5,6 +5,8 @@
<h2>{$heading}</h2>
{include file="user/simpleuser.tpl" user=$user}
{$form}
{include file="columnleftend.tpl"}
......
......@@ -5,6 +5,8 @@
<h2>{$heading}</h2>
{include file="user/simpleuser.tpl" user=$user}
{$form}
{include file="columnleftend.tpl"}
......
......@@ -5,6 +5,8 @@
<h2>{$heading}</h2>
{include file="user/simpleuser.tpl" user=$user}
{$form}
{include file="columnleftend.tpl"}
......
......@@ -5,6 +5,8 @@
<h2>{$heading}</h2>
{include file="user/simpleuser.tpl" user=$user}
{$form}
{include file="columnleftend.tpl"}
......
<div>
<div class="fl">
<img src="{$WWWROOT}thumb.php?type=profileicon&amp;size=50x50&amp;id={$user->id}" alt="">
</div>
<h3>
<a href="{$WWWROOT}user/view.php?id={$user->id}">
{$user->id|display_name|escape}
</a>
</h3>
{if $user->introduction}
<p>
{$user->introduction}
</p>
{/if}
</div>
......@@ -39,6 +39,9 @@ if (!record_exists('usr_friend_request', 'owner', $USER->get('id'), 'requester',
throw new AccessDeniedException(get_string('cantdenyrequest', 'group'));
}
$user = get_record('usr', 'id', $id);
$user->introduction = get_field('artefact', 'title', 'artefacttype', 'introduction', 'owner', $id);
$form = pieform(array(
'name' => 'denyrequest',
'autofocus' => false,
......@@ -60,6 +63,7 @@ $form = pieform(array(
$smarty = smarty();
$smarty->assign('heading', TITLE);
$smarty->assign('form', $form);
$smarty->assign('user', $user);
$smarty->display('user/denyrequest.tpl');
function denyrequest_submit(Pieform $form, $values) {
......
......@@ -36,6 +36,9 @@ if (!is_friend($id, $USER->get('id'))) {
throw new AccessDeniedException(get_string('cantremovefriend', 'group'));
}
$user = get_record('usr', 'id', $id);
$user->introduction = get_field('artefact', 'title', 'artefacttype', 'introduction', 'owner', $id);
define('TITLE', get_string('removefromfriends', 'group', display_name($id)));
$form = pieform(array(
......@@ -59,6 +62,7 @@ $form = pieform(array(
$smarty = smarty();
$smarty->assign('heading', TITLE);
$smarty->assign('form', $form);
$smarty->assign('user', $user);
$smarty->display('user/removefriend.tpl');
function removefriend_submit(Pieform $form, $values) {
......
......@@ -39,6 +39,9 @@ if (is_friend($id, $USER->get('id'))
throw new AccessDeniedException(get_string('cantrequestfriendship', 'group'));
}
$user = get_record('usr', 'id', $id);
$user->introduction = get_field('artefact', 'title', 'artefacttype', 'introduction', 'owner', $id);
define('TITLE', get_string('sendfriendshiprequest', 'group', display_name($id)));
$form = pieform(array(
......@@ -62,6 +65,7 @@ $form = pieform(array(
$smarty = smarty();
$smarty->assign('heading', TITLE);
$smarty->assign('form', $form);
$smarty->assign('user', $user);
$smarty->display('user/requestfriendship.tpl');
function requestfriendship_submit(Pieform $form, $values) {
......
......@@ -34,12 +34,16 @@ safe_require('search', 'internal');
$id = param_integer('id');
$returnto = param_alpha('returnto', 'myfriends');
if (!can_send_message($USER, $id)) {
$user = get_record('usr', 'id', $id);
if (!$user || !can_send_message($USER, $id)) {
throw new AccessDeniedException(get_string('cantmessageuser', 'group'));
}
define('TITLE', get_string('sendmessageto', 'group', display_name($id)));
$user->introduction = get_field('artefact', 'title', 'artefacttype', 'introduction', 'owner', $id);
$form = pieform(array(
'name' => 'sendmessage',
'autofocus' => false,
......@@ -61,7 +65,8 @@ $form = pieform(array(
$smarty = smarty();
$smarty->assign('heading', TITLE);
$smarty->assign('form', $form);
$smarty->display('user/denyrequest.tpl');
$smarty->assign('user', $user);
$smarty->display('user/sendmessage.tpl');
function sendmessage_submit(Pieform $form, $values) {
global $USER, $SESSION, $id;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment