diff options
author | Mario <mario@mariovavti.com> | 2019-11-22 14:59:46 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-11-22 14:59:46 +0100 |
commit | 530d816df6d4d0ede07fb56543519439dfa50bbc (patch) | |
tree | b5202776942979f9b56a9be0e84b13cfcf65a0c6 /Zotlabs/Module | |
parent | 4a4c43bb2c336622181ccdd006642efc7b9f1ee5 (diff) | |
parent | 23c47f78eada85c1f897bbf348a4f802db9ef2f9 (diff) | |
download | volse-hubzilla-530d816df6d4d0ede07fb56543519439dfa50bbc.tar.gz volse-hubzilla-530d816df6d4d0ede07fb56543519439dfa50bbc.tar.bz2 volse-hubzilla-530d816df6d4d0ede07fb56543519439dfa50bbc.zip |
Merge branch 'better-conn-status' into 'dev'
More descriptive connection status icons
See merge request hubzilla/core!1789
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Connections.php | 23 | ||||
-rw-r--r-- | Zotlabs/Module/Viewconnections.php | 24 |
2 files changed, 47 insertions, 0 deletions
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') diff --git a/Zotlabs/Module/Viewconnections.php b/Zotlabs/Module/Viewconnections.php index 30df0b9e4..18a52c247 100644 --- a/Zotlabs/Module/Viewconnections.php +++ b/Zotlabs/Module/Viewconnections.php @@ -74,6 +74,29 @@ class Viewconnections extends \Zotlabs\Web\Controller { if(! intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) { $oneway = true; } + + $perminfo=[]; + $perminfo['connpermcount']=0; + $perminfo['connperms']=t('Accepts').': '; + if(intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) { + $perminfo['connpermcount']++; + $perminfo['connperms'] .= t('Comments'); + } + if(intval(get_abconfig(\App::$profile['uid'],$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(\App::$profile['uid'],$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'); + } + $url = chanlink_hash($rr['xchan_hash']); if($url) { @@ -88,6 +111,7 @@ class Viewconnections extends \Zotlabs\Web\Controller { 'sparkle' => '', 'itemurl' => $rr['url'], 'network' => '', + 'perminfo' => $perminfo, 'oneway' => $oneway ); } |