]> git.mxchange.org Git - friendica.git/commitdiff
add "Show Forum" Button to Profile
authorJakobus Schürz (admin) <adminjs@schuerz.at>
Sun, 1 Oct 2023 10:34:56 +0000 (12:34 +0200)
committerJakobus Schürz (admin) <adminjs@schuerz.at>
Sun, 1 Oct 2023 10:34:56 +0000 (12:34 +0200)
src/Content/Widget/VCard.php
view/theme/frio/templates/widget/vcard.tpl

index 62a8e90853f30ff2378bc166104ba28ccc480da0..8a949e9360b9651fb241d3f4d2bcd729db9928f0 100644 (file)
@@ -68,6 +68,7 @@ class VCard
                $follow_link      = '';
                $unfollow_link    = '';
                $wallmessage_link = '';
+               $showforum_link   = '';
 
                $photo   = Contact::getPhoto($contact);
 
@@ -99,6 +100,10 @@ class VCard
                        if (in_array($rel, [Contact::FOLLOWER, Contact::FRIEND]) && Contact::canReceivePrivateMessages($contact)) {
                                $wallmessage_link = 'message/new/' . $id;
                        }
+
+                       if (in_array($rel, [Contact::SHARING])) {
+                               $showforum_link = 'network/group/' . $id;
+                       }
                }
 
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [
@@ -119,6 +124,9 @@ class VCard
                        '$unfollow_link'    => $unfollow_link,
                        '$wallmessage'      => DI::l10n()->t('Message'),
                        '$wallmessage_link' => $wallmessage_link,
+                       '$showforum'        => DI::l10n()->t('Show Forum'),
+                       '$showforum_link'   => $showforum_link,
+                       '$mentioning'       => DI::l10n()->t('Mention'),
                ]);
        }
 }
index 9fef57a9d72dc959b92c6ab5b9d391bd256826ae..8ae0a1d1cdde05b4f695acc9e4e67cd2c721288f 100644 (file)
                                        </button>
                                </div>
                        {{/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}}')">
+                                               <span class=""><i class="fa fa-pencil-square-o"></i></span>
+                                               <span class="">{{$mentioning}}</span>
+                                       </button>
+                               </div>
+                        {{/if}}
+                        {{if $contact.forum==1 || $contact.prv==1}}
+                               <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="window.location.href='{{$showforum_link}}'">
+                                               <span class=""><i class="fa fa-group"></i></span>
+                                               <span class="">{{$showforum}}</span>
+                                       </button>
+                               </div>
+                        {{/if}}
                </div>
 
                <div class="clear"></div>