From 02b26f5969fbe67e4aaabc08dd10c2b8b4f2ab76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jakobus=20Sch=C3=BCrz?= Date: Thu, 5 Oct 2023 23:18:04 +0200 Subject: [PATCH] put group-logic for "widget" to php-file --- src/Content/Widget/VCard.php | 15 ++++++++++----- view/theme/frio/templates/widget/vcard.tpl | 8 ++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Content/Widget/VCard.php b/src/Content/Widget/VCard.php index 478ab52fe7..b325a7db15 100644 --- a/src/Content/Widget/VCard.php +++ b/src/Content/Widget/VCard.php @@ -102,8 +102,15 @@ class VCard } if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) { - $showgroup_link = 'network/group/' . $id; + $mention_label = DI::l10n()->t('Post to group'); + $mention_url = 'compose/0?body=!' . $contact['addr']; + $showgroup_label = DI::l10n()->t('View group'); + $showgroup_url = 'network/group/' . $id; + } else { + $mention_label = DI::l10n()->t('Mention'); + $mention_url = 'compose/0?body=@' . $contact['addr']; } + } return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [ @@ -124,10 +131,8 @@ class VCard '$unfollow_link' => $unfollow_link, '$wallmessage' => DI::l10n()->t('Message'), '$wallmessage_link' => $wallmessage_link, - '$mention' => DI::l10n()->t('Mention'), - '$posttogroup' => DI::l10n()->t('Post to group'), - '$showgroup' => DI::l10n()->t('View group'), - '$showgroup_link' => $showgroup_link, + '$mention' => [$mention_label, $mention_url], + '$showgroup' => [$showgroup_label, $showgroup_url] ]); } } diff --git a/view/theme/frio/templates/widget/vcard.tpl b/view/theme/frio/templates/widget/vcard.tpl index e3a8918eb9..814dec49ed 100644 --- a/view/theme/frio/templates/widget/vcard.tpl +++ b/view/theme/frio/templates/widget/vcard.tpl @@ -58,17 +58,17 @@ {{/if}} {{if $contact.addr}} {{/if}} {{if $contact.forum==1 || $contact.prv==1}}
-
{{/if}} -- 2.39.5