From 23c47f78eada85c1f897bbf348a4f802db9ef2f9 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Fri, 22 Nov 2019 14:59:45 +0100 Subject: More descriptive connection status icons --- Zotlabs/Module/Connections.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Zotlabs/Module/Connections.php') diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php index f6133d5f8..f9d9c7135 100644 --- a/Zotlabs/Module/Connections.php +++ b/Zotlabs/Module/Connections.php @@ -283,6 +283,28 @@ class Connections extends \Zotlabs\Web\Controller { if(! intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) { $oneway = true; } + + $perminfo['connpermcount']=0; + $perminfo['connperms']=t('Accepts').': '; + if(intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] .= t('Comments'); + } + if(intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','send_stream'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] = ($perminfo['connperms']) ? $perminfo['connperms'] . ',' : $perminfo['connperms'] ; + $perminfo['connperms'] .= t('Stream items'); + } + if(intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_wall'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] = ($perminfo['connperms']) ? $perminfo['connperms'] . ',' : $perminfo['connperms'] ; + $perminfo['connperms'] .= t('Wall posts'); + } + + if ($perminfo['connpermcount'] == 0) { + $perminfo['connperms'] .= t('Nothing'); + } + foreach($status as $str) { if(!$str) @@ -323,6 +345,7 @@ class Connections extends \Zotlabs\Web\Controller { 'recent_label' => t('Recent activity'), 'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) . '&name=' . $rr['xchan_name'], 'oneway' => $oneway, + 'perminfo' => $perminfo, 'connect' => (intval($rr['abook_not_here']) ? t('Connect') : ''), 'follow' => z_root() . '/follow/?f=&url=' . urlencode($rr['xchan_hash']) . '&interactive=0', 'connect_hover' => t('Connect at this location') -- cgit v1.2.3