From e44f5ff04544e9aeaff41a66c623339c18119444 Mon Sep 17 00:00:00 2001 From: Hamatoma Date: Sat, 4 May 2024 19:59:43 +0200 Subject: [PATCH] Icons und Images --- app/Helpers/MediaWiki.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/Helpers/MediaWiki.php b/app/Helpers/MediaWiki.php index deef9a7..a3c12ef 100644 --- a/app/Helpers/MediaWiki.php +++ b/app/Helpers/MediaWiki.php @@ -42,7 +42,7 @@ class MediaWiki extends MediaWikiBase $rc = "$text"; break; case 'mark': - $rc = '' . $matches[2] . ''; + $rc = '' . $matches[2] . ''; break; case 'add': $rc = '' . (count($matches) == 4 ? ($matches[2] . $matches[3]) : $matches[2]) . ''; @@ -54,15 +54,27 @@ class MediaWiki extends MediaWikiBase $name = $matches[2]; $value = ''; $size = 8; - if (count($matches) > 3){ + if (count($matches) > 3) { $parts = explode('|', substr($matches[3], 1)); $value = $parts[0]; - if (count($parts) > 1){ + if (count($parts) > 1) { $size = $parts[1]; } } $rc = ""; break; + case 'icon': + $name = $matches[2]; + $size = count($matches) < 4 ? 0 : intval(substr($matches[3], 1)); + $class = $size == 0 ? '' : "lkn-icon-$size"; + $rc = ""; + break; + case 'image': + $name = $matches[2]; + $size = count($matches) < 4 ? null : $matches[3]); + $class = $size == 0 ? '' : "lkn-icon-$size"; + $rc = ""; + break; default: $rc = $matches[0]; break; -- 2.39.5