diff options
author | Sem <sembrestels@riseup.net> | 2013-11-09 16:14:29 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2013-11-09 16:14:29 +0100 |
commit | ba0d506ade08ae46ba665474a8b9c81e838f2eee (patch) | |
tree | f533d99e7204301d14123384247537fd92d29f4c /mod/friendrequest/views/default | |
parent | e2a2fbdccaf0f48878903f448428cab5852d0870 (diff) | |
parent | bdd9179742dbd9101b61a5138e1a81b084747dd8 (diff) | |
download | elgg-ba0d506ade08ae46ba665474a8b9c81e838f2eee.tar.gz elgg-ba0d506ade08ae46ba665474a8b9c81e838f2eee.tar.bz2 |
Add 'mod/friendrequest/' from commit 'bdd9179742dbd9101b61a5138e1a81b084747dd8'
git-subtree-dir: mod/friendrequest
git-subtree-mainline: e2a2fbdccaf0f48878903f448428cab5852d0870
git-subtree-split: bdd9179742dbd9101b61a5138e1a81b084747dd8
Diffstat (limited to 'mod/friendrequest/views/default')
-rw-r--r-- | mod/friendrequest/views/default/friendrequest/requests.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/mod/friendrequest/views/default/friendrequest/requests.php b/mod/friendrequest/views/default/friendrequest/requests.php new file mode 100644 index 000000000..1680bdc4e --- /dev/null +++ b/mod/friendrequest/views/default/friendrequest/requests.php @@ -0,0 +1,47 @@ +<?php +/** + * The friend requests' list + * + * @uses $vars['requests'] Array of ElggUsers + */ + +if (!empty($vars['requests']) && is_array($vars['requests'])) { + $user = elgg_get_logged_in_user_entity(); + echo '<ul class="elgg-list">'; + foreach ($vars['requests'] as $user) { + $icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => 'true')); + + $user_title = elgg_view('output/url', array( + 'href' => $user->getURL(), + 'text' => $user->name, + 'is_trusted' => true, + )); + + $url = "action/friends/add?friend={$user->guid}"; + $accept_button = elgg_view('output/url', array( + 'href' => $url, + 'text' => elgg_echo('accept'), + 'class' => 'elgg-button elgg-button-submit', + 'is_action' => true, + 'is_trusted' => true, + )); + + $url = "action/friendrequest/decline?guid={$user->guid}"; + $delete_button = elgg_view('output/confirmlink', array( + 'href' => $url, + 'confirm' => elgg_echo('friendrequest:remove:check'), + 'text' => elgg_echo('delete'), + 'class' => 'elgg-button elgg-button-delete mlm', + )); + + $body = "<h4>$user_title</h4>"; + $alt = $accept_button . $delete_button; + + echo '<li class="pvs">'; + echo elgg_view_image_block($icon, $body, array('image_alt' => $alt)); + echo '</li>'; + } + echo '</ul>'; +} else { + echo '<p class="mtm">' . elgg_echo('friendrequest:none') . "</p>"; +} |