aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Common.php31
-rwxr-xr-xview/tpl/common_friends.tpl24
2 files changed, 28 insertions, 27 deletions
diff --git a/Zotlabs/Module/Common.php b/Zotlabs/Module/Common.php
index 2f3c57267..eebc56d2b 100644
--- a/Zotlabs/Module/Common.php
+++ b/Zotlabs/Module/Common.php
@@ -25,7 +25,7 @@ class Common extends \Zotlabs\Web\Controller {
}
- function get() {
+ function get() {
$o = '';
@@ -34,38 +34,37 @@ class Common extends \Zotlabs\Web\Controller {
$observer_hash = get_observer_hash();
-
if(! perm_is_allowed(\App::$profile['profile_uid'],$observer_hash,'view_contacts')) {
notice( t('Permission denied.') . EOL);
return;
}
- $o .= '<h2>' . t('Common connections') . '</h2>';
-
$t = count_common_friends(\App::$profile['profile_uid'],$observer_hash);
if(! $t) {
notice( t('No connections in common.') . EOL);
- return $o;
+ return;
}
$r = common_friends(\App::$profile['profile_uid'],$observer_hash);
if($r) {
-
- $tpl = get_markup_template('common_friends.tpl');
-
foreach($r as $rr) {
- $o .= replace_macros($tpl,array(
- '$url' => $rr['xchan_url'],
- '$name' => $rr['xchan_name'],
- '$photo' => $rr['xchan_photo_m'],
- '$tags' => ''
- ));
+ $items[] = [
+ 'url' => $rr['xchan_url'],
+ 'name' => $rr['xchan_name'],
+ 'photo' => $rr['xchan_photo_m'],
+ 'tags' => ''
+ ];
}
-
- $o .= cleardiv();
}
+
+ $tpl = get_markup_template('common_friends.tpl');
+
+ $o = replace_macros($tpl, [
+ '$title' => t('View Common Connections'),
+ '$items' => $items
+ ]);
return $o;
}
diff --git a/view/tpl/common_friends.tpl b/view/tpl/common_friends.tpl
index fa2cf5a13..b99075210 100755
--- a/view/tpl/common_friends.tpl
+++ b/view/tpl/common_friends.tpl
@@ -1,15 +1,17 @@
<div class="generic-content-wrapper">
- <div class="profile-match-photo">
- <a href="{{$url}}">
- <img src="{{$photo}}" alt="{{$name}}" width="80" height="80" title="{{$name}} [{{$url}}]" />
- </a>
+ <div class="section-title-wrapper">
+ <h2>{{$title}}</h2>
</div>
- <div class="profile-match-break"></div>
- <div class="profile-match-name">
- <a href="{{$url}}" title="{{$name}}[{{$tags}}]">{{$name}}</a>
+ <div class="section-content-wrapper clearfix">
+ {{foreach $items as $item}}
+ <div class="float-left mr-4">
+ <a href="{{$item.url}}">
+ <img class="contact-block-img" src="{{$item.photo}}" alt="{{$item.name}}" title="{{$item.name}} [{{$item.url}}]" />
+ </a>
+ <div>
+ {{$item.name}}
+ </div>
+ </div>
+ {{/foreach}}
</div>
- {{if $note}}
- <div class="profile-match-note">{{$note}}</div>
- {{/if}}
- <div class="profile-match-end"></div>
</div>