From 95c38e37ff3123469c13ba83a476569896586737 Mon Sep 17 00:00:00 2001
From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de>
Date: Mon, 8 Aug 2022 07:14:02 +0000
Subject: [PATCH] don't render link text in action-menu-single mode, fixes
 #1404

Closes #1404

Merge request studip/studip!869
---
 lib/classes/MultiPersonSearch.class.php | 6 ++++--
 templates/shared/action-menu-single.php | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/classes/MultiPersonSearch.class.php b/lib/classes/MultiPersonSearch.class.php
index a5b2c1e63a4..972b7ab5827 100644
--- a/lib/classes/MultiPersonSearch.class.php
+++ b/lib/classes/MultiPersonSearch.class.php
@@ -126,12 +126,14 @@ class MultiPersonSearch {
 
     /**
      * renders a link to open the multipersonsearch dialog.
+     *
+     * @param string $with_link_text include link text in output
      */
-    public function render() {
+    public function render($with_link_text = true) {
         $template = $GLOBALS['template_factory']->open('multipersonsearch/link.php');
 
         $template->set_attribute('linkIconPath', $this->linkIconPath);
-        $template->set_attribute('linkText', $this->linkText);
+        $template->set_attribute('linkText', $with_link_text ? $this->linkText : '');
         $template->set_attribute('title', $this->title);
         $template->set_attribute('name', $this->name);
         $template->set_attribute('description', $this->description);
diff --git a/templates/shared/action-menu-single.php b/templates/shared/action-menu-single.php
index 8fcab9b6102..7b49f313fb7 100644
--- a/templates/shared/action-menu-single.php
+++ b/templates/shared/action-menu-single.php
@@ -16,6 +16,6 @@
             </button>
         <? endif ?>
     <? elseif ($action['type'] === 'multi-person-search'): ?>
-        <?= $action['object']->render() ?>
+        <?= $action['object']->render(false) ?>
     <? endif ?>
 <? endforeach ?>
-- 
GitLab