aboutsummaryrefslogtreecommitdiff
path: root/lib/visual.inc.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-12-04 15:56:31 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-12-04 15:56:31 +0000
commitc274ac3a284001a14c96fbef0f16fc8ec6b5672d (patch)
tree2dd8b574d2460716d33f45d2322f860c0793a6da /lib/visual.inc.php
parentc1e29f7e8462cc8988f0dca201f7f57dc2807add (diff)
fix tooltip icon usage, fixes #4957
Closes #4957 Merge request studip/studip!3723
Diffstat (limited to 'lib/visual.inc.php')
-rw-r--r--lib/visual.inc.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/visual.inc.php b/lib/visual.inc.php
index 7aa4908..15b1c7d 100644
--- a/lib/visual.inc.php
+++ b/lib/visual.inc.php
@@ -412,11 +412,13 @@ function tooltip2($text, $with_alt = TRUE, $with_popup = FALSE) {
/**
* returns a html-snippet with an icon and a tooltip on it
*
- * @param string $text tooltip text, html gets encoded
- * @param bool $important render icon in "important" style
- * @param bool $html tooltip text is HTML content
+ * @param string|null $text tooltip text, html gets encoded
+ * @param bool $important render icon in "important" style
+ * @param bool $html tooltip text is HTML content
+ * @param bool $alt_info
+ * @return string
*/
-function tooltipIcon(string $text, bool $important = false, bool $html = false, bool $alt_info= false): string
+function tooltipIcon(?string $text, bool $important = false, bool $html = false, bool $alt_info= false): string
{
if (!trim($text)) {
return '';
@@ -430,10 +432,11 @@ function tooltipIcon(string $text, bool $important = false, bool $html = false,
/**
* returns a html-snippet with an icon and a tooltip on it
*
- * @param string $text tooltip text, html is rendered as is
- * @param bool $important render icon in "important" style
+ * @param string|null $text tooltip text, html is rendered as is
+ * @param bool $important render icon in "important" style
+ * @return string
*/
-function tooltipHtmlIcon(string $text, bool $important = false)
+function tooltipHtmlIcon(?string $text, bool $important = false)
{
return tooltipIcon($text, $important, true);
}