<validationpattern><![CDATA[^(small|medium|large|original)$]]></validationpattern>
</attribute>
<attribute name="2">
- <validationpattern><![CDATA[^(left|right|none)$]]></validationpattern>
+ <validationpattern><![CDATA[^(left|right|center|none)$]]></validationpattern>
</attribute>
+ <attribute name="3">
+ <validationpattern><![CDATA[^\d+$]]></validationpattern>
+ </attribute>
</attributes>
</bbcode>
<bbcode name="wsp">
{if !$removeLinks|isset}{assign var='removeLinks' value=false}{/if}
- <span class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}">
+{if $float === 'center'}<p class="text-center">{/if}
+ <span class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}"{if $width !== 'auto'} style="width: {$width}px; display: inline-flex"{/if}>
{if $media->isImage}
{if $thumbnailSize != 'original'}
{if !$removeLinks}
{if !$removeLinks|isset}{assign var='removeLinks' value=false}{/if}
- <span class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}">
+{if $float === 'center'}<p class="text-center">{/if}
+ <span class="mediaBBCode{if $float != 'none'} messageFloatObject{$float|ucfirst}{/if}"{if $width !== 'auto'} style="width: {$width}px; display: inline-flex"{/if}>
{if $media->isImage}
{if $thumbnailSize != 'original'}
{if !$removeLinks}
$imageElement,
FontAwesomeIcon::fromValues('magnifying-glass')->toHtml(24),
);
- '<span title="%s" class="%s" style="width: %s">%s</span>',
+ } else {
+ $result = \sprintf(
++ '<span title="%s" class="%s" style="width: %s; display: inline-flex;">%s</span>',
+ $title,
+ $class,
+ $width,
+ $imageElement,
+ );
}
-
- return \sprintf(
- '<span title="%s" class="%s" style="width: %s; display: inline-flex;">%s</span>',
- $title,
- $class,
- $width,
- $imageElement,
- );
+ if ($alignment === 'center') {
+ return \sprintf(
+ '<p class="text-center">%s</p>',
+ $result,
+ );
+ }
+ return $result;
}
private function showImageAsThumbnail(Attachment $attachment, string $alignment, bool $hasParentLink, string $width): string
$imageElement,
$enlargeImageControls,
);
- '<span class="%s" stlye="width: %s">%s%s</span>',
+ } else {
+ $result = \sprintf(
++ '<span class="%s" style="width: %s; display: inline-flex">%s%s</span>',
+ $class,
+ $width,
+ $imageElement,
+ \str_contains($imageClasses, 'embeddedAttachmentLink') ? $enlargeImageControls : '',
+ );
+ }
+ if ($alignment === 'center') {
+ return \sprintf(
+ '<p class="text-center">%s</p>',
+ $result,
+ );
}
- return \sprintf(
- '<span class="%s" style="width: %s; display: inline-flex">%s%s</span>',
- $class,
- $width,
- $imageElement,
- \str_contains($imageClasses, 'embeddedAttachmentLink') ? $enlargeImageControls : '',
- );
+ return $result;
}
/**