From 72a19a14aff7a13a8c1fb10e773784643f68d234 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 19 Sep 2017 17:35:57 -0700 Subject: turn common friends into a widget --- Zotlabs/Module/Channel.php | 2 +- Zotlabs/Widget/Common_friends.php | 19 +++++++++++++++++++ include/contact_widgets.php | 19 ++++++++++--------- view/pdl/mod_channel.pdl | 3 +++ view/tpl/common_friends.tpl | 2 +- view/tpl/remote_friends_common.tpl | 39 ++++++++++++++++++++++---------------- 6 files changed, 57 insertions(+), 27 deletions(-) create mode 100644 Zotlabs/Widget/Common_friends.php diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 4ffc9ffc6..8550c69cd 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -123,7 +123,7 @@ class Channel extends \Zotlabs\Web\Controller { //$o .= profile_tabs($a, $is_owner, \App::$profile['channel_address']); - $o .= common_friends_visitor_widget(\App::$profile['profile_uid']); + // $o .= common_friends_visitor_widget(\App::$profile['profile_uid']); if($channel && $is_owner) { $channel_acl = array( diff --git a/Zotlabs/Widget/Common_friends.php b/Zotlabs/Widget/Common_friends.php new file mode 100644 index 000000000..a67b9312c --- /dev/null +++ b/Zotlabs/Widget/Common_friends.php @@ -0,0 +1,19 @@ + sprintf( tt("%d connection in common", "%d connections in common", $t), $t), - '$base' => z_root(), - '$uid' => $profile_uid, - '$cid' => $observer, - '$linkmore' => (($t > 5) ? 'true' : ''), - '$more' => t('show more'), - '$items' => $r + '$desc' => sprintf( t('Common connections: %d'), $t), + '$base' => z_root(), + '$uid' => $profile_uid, + '$cid' => $observer, + '$linkmore' => (($t > $cnt) ? 'true' : ''), + '$more' => t('show more'), + '$items' => $r )); }; diff --git a/view/pdl/mod_channel.pdl b/view/pdl/mod_channel.pdl index 98dc71915..54c2fb489 100644 --- a/view/pdl/mod_channel.pdl +++ b/view/pdl/mod_channel.pdl @@ -7,4 +7,7 @@ [widget=categories][/widget] [widget=tagcloud_wall][var=limit]24[/var][/widget] [/region] +[region=content] +[widget=common_friends][/widget] +[/region] diff --git a/view/tpl/common_friends.tpl b/view/tpl/common_friends.tpl index 489717e78..fa2cf5a13 100755 --- a/view/tpl/common_friends.tpl +++ b/view/tpl/common_friends.tpl @@ -1,4 +1,4 @@ -
+
{{$name}} diff --git a/view/tpl/remote_friends_common.tpl b/view/tpl/remote_friends_common.tpl index d6d2fd211..7ec1a2e6b 100755 --- a/view/tpl/remote_friends_common.tpl +++ b/view/tpl/remote_friends_common.tpl @@ -1,21 +1,28 @@ -
- - {{if $items}} - {{foreach $items as $item}} -
-
- - {{$item.xchan_name}} - +
+
+ -
-
- {{$item.xchan_name}} +
+ {{if $items}} + {{foreach $items as $item}} +
+
+ + {{$item.xchan_name}} + +
+
+ +
+
+ {{/foreach}} + {{/if}} +
+ {{if $linkmore}}{{/if}}
-
- {{/foreach}} - {{/if}} -
-- cgit v1.2.3