aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Common.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-10-03 11:37:45 +0200
committerMario Vavti <mario@mariovavti.com>2017-10-03 11:37:45 +0200
commitfa93114804801bceabea06570e8eee602167600a (patch)
treeabab8976923b91b21fb35a7863bcd5863742fc06 /Zotlabs/Module/Common.php
parent66511d8f078cebdbad34bf1b40097159c2335bf4 (diff)
downloadvolse-hubzilla-fa93114804801bceabea06570e8eee602167600a.tar.gz
volse-hubzilla-fa93114804801bceabea06570e8eee602167600a.tar.bz2
volse-hubzilla-fa93114804801bceabea06570e8eee602167600a.zip
some basic work on mod common
Diffstat (limited to 'Zotlabs/Module/Common.php')
-rw-r--r--Zotlabs/Module/Common.php31
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;
}