From: Jakobus Schürz Date: Thu, 5 Oct 2023 21:18:04 +0000 (+0200) Subject: put group-logic for "widget" to php-file X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=02b26f5969fbe67e4aaabc08dd10c2b8b4f2ab76;p=friendica.git put group-logic for "widget" to php-file --- 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}}