$mention_url = '';
$status_link = '';
$photos_link = '';
- $self = false;
if (($contact['network'] === Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
$profile_link = 'contact/redir/' . $contact['id'];
$pm_url = 'message/new/' . $contact['id'];
}
- if (in_array($contact['rel'], [contact::SHARING])) {
+ if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
+ $mention_label = DI::l10n()->t('Post to group');
$mention_url = 'compose/0?body=!' . $contact['addr'];
} else {
+ $mention_label = DI::l10n()->t('Mention');
$mention_url = 'compose/0?body=@' . $contact['addr'];
}
+ $contact_url = 'contact/' . $contact['id'];
- if (in_array($contact['rel'], [contact::SHARING])) {
- $self = true;
+ if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
+ $network_label = DI::l10n()->t('View group');
+ $network_url = 'network/group/' . $contact['id'];
+ } else {
+ $network_label = DI::l10n()->t('Network Posts');
+ $network_url = 'contact/' . $contact['id'] . '/conversations';
}
- $contact_url = 'contact/' . $contact['id'];
- $posts_link = 'contact/' . $contact['id'] . '/conversations';
- $group_link = 'network/group/' . $contact['id'];
-
$follow_link = '';
$unfollow_link = '';
if (!$contact['self'] && Protocol::supportsFollow($contact['network'])) {
* Menu array:
* "name" => [ "Label", "link", (bool)Should the link opened in a new tab? ]
*/
+
+
if (empty($contact['uid'])) {
$menu = [
'profile' => [DI::l10n()->t('View Profile'), $profile_link, true],
- 'network' => [DI::l10n()->t('Network Posts'), $posts_link, false],
+ 'network' => [$network_label, $network_url, false],
'edit' => [DI::l10n()->t('View Contact'), $contact_url, false],
'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link, true],
'unfollow' => [DI::l10n()->t('Unfollow'), $unfollow_link, true],
- 'mention' => [DI::l10n()->t('Mention'), DI::l10n()->t('Post to group'), $mention_url, false],
- 'group' => [DI::l10n()->t('View group'), $group_link, $contact['forum'], true],
+ 'mention' => [$mention_label, $mention_url, false],
];
} else {
$menu = [
'status' => [DI::l10n()->t('View Status'), $status_link, true],
'profile' => [DI::l10n()->t('View Profile'), $profile_link, true],
'photos' => [DI::l10n()->t('View Photos'), $photos_link, true],
- 'network' => [DI::l10n()->t('Network Posts'), $posts_link, false],
+ 'network' => [$network_label, $network_url, false],
'edit' => [DI::l10n()->t('View Contact'), $contact_url, false],
'pm' => [DI::l10n()->t('Send PM'), $pm_url, false],
- 'mention' => [DI::l10n()->t('Mention'), DI::l10n()->t('Post to group'), $mention_url, false],
'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link, true],
'unfollow' => [DI::l10n()->t('Unfollow'), $unfollow_link, true],
- 'group' => [DI::l10n()->t('View group'), $group_link, $contact['forum'], true],
- 'self' => [$self],
+ 'mention' => [$mention_label, $mention_url, false],
];
if (!empty($contact['pending'])) {