From: Hamatoma Date: Sat, 4 May 2024 17:59:43 +0000 (+0200) Subject: Icons und Images X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=e44f5ff04544e9aeaff41a66c623339c18119444;p=gadeku.git Icons und Images --- 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;