diff options
author | zotlabs <mike@macgirvin.com> | 2017-10-04 19:37:35 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-10-04 19:37:35 -0700 |
commit | 2862baeee1cbecead3c9d38d2798140ac0256d1a (patch) | |
tree | 525c291cd4611b0cbb481bb928d1c653cfa6a700 /Zotlabs/Module/Common.php | |
parent | 47b29594867deb96f6b93d8a5ace8d4d4e569630 (diff) | |
parent | 6f88d5e92be06ad8fa61f900e8a4fb41ba54135e (diff) | |
download | volse-hubzilla-2862baeee1cbecead3c9d38d2798140ac0256d1a.tar.gz volse-hubzilla-2862baeee1cbecead3c9d38d2798140ac0256d1a.tar.bz2 volse-hubzilla-2862baeee1cbecead3c9d38d2798140ac0256d1a.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs/Module/Common.php')
-rw-r--r-- | Zotlabs/Module/Common.php | 31 |
1 files changed, 15 insertions, 16 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; } |