]> git.mxchange.org Git - friendica.git/commitdiff
put group-logic for "widget" to php-file
authorJakobus Schürz <jakobus.schuerz@home.arpa>
Thu, 5 Oct 2023 21:18:04 +0000 (23:18 +0200)
committerJakobus Schürz <jakobus.schuerz@home.arpa>
Fri, 6 Oct 2023 23:23:29 +0000 (01:23 +0200)
src/Content/Widget/VCard.php
view/theme/frio/templates/widget/vcard.tpl

index 478ab52fe798d62a738a826de62bb213963e6d4a..b325a7db158601d9e7a94fedcb08843f372aa464 100644 (file)
@@ -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]
                ]);
        }
 }
index e3a8918eb9a1afd2d90082b5c8d98818697eb2e7..814dec49edca10f5be53bc28a2efa824ed655068 100644 (file)
                        {{/if}}
                         {{if $contact.addr}}
                                <div id="mention-link-button">
-                                       <button type="button" id="mention-link" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="openWallMessage('compose/0?body={{if $contact.forum==1}}!{{else}}@{{/if}}{{$contact.addr}}')">
+                                       <button type="button" id="mention-link" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="openWallMessage('{{$mention.1}}')" titel="{{$mention.0}}" aria-label="{{$mention.0}}">
                                                <span class=""><i class="fa fa-pencil-square-o"></i></span>
-                                               <span class="">{{if $contact.forum==1}}{{$posttogroup}}{{else}}{{$mention}}{{/if}}</span>
+                                               <span class="">{{$mention.0}}</span>
                                        </button>
                                </div>
                         {{/if}}
                         {{if $contact.forum==1 || $contact.prv==1}}
                                <div id="show-group-button">
-                                       <button type="button" id="show-group" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="window.location.href='{{$showgroup_link}}'">
+                                       <button type="button" id="show-group" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="window.location.href='{{$showgroup.1}}'">
                                                <span class=""><i class="fa fa-group"></i></span>
-                                               <span class="">{{$showgroup}}</span>
+                                               <span class="">{{$showgroup.0}}</span>
                                        </button>
                                </div>
                         {{/if}}