Merge remote-tracking branch 'origin/6.0' into image-center
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 13 Dec 2023 12:16:07 +0000 (13:16 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Wed, 13 Dec 2023 12:16:07 +0000 (13:16 +0100)
# Conflicts:
# com.woltlab.wcf/templates/mediaBBCodeTag.tpl
# wcfsetup/install/files/acp/templates/mediaBBCodeTag.tpl
# wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php

1  2 
com.woltlab.wcf/bbcode.xml
com.woltlab.wcf/templates/mediaBBCodeTag.tpl
wcfsetup/install/files/acp/templates/mediaBBCodeTag.tpl
wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php

index 61ad2dd50295405e2b813c0db9f344d62b90cb75,58d1c19bd63b8e089584f7de661df270beb4a50a..58fa60d9f57bf5697ddc1cb48cdebc6f356984c5
                                        <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">
index 5bfe27894cc08a23b5307c7558eecb823daa3556,cb55423f3c11d66a3b1f469e1deaca6b1981a9eb..b53650955ad3bd1214e021bb8d0f4c220c6ea224
@@@ -1,6 -1,5 +1,6 @@@
  {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}
index 5bfe27894cc08a23b5307c7558eecb823daa3556,cb55423f3c11d66a3b1f469e1deaca6b1981a9eb..b53650955ad3bd1214e021bb8d0f4c220c6ea224
@@@ -1,6 -1,5 +1,6 @@@
  {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}
index b2341d0db930d9f6a9ea0aad63db69f1f388a098,c71ab227fe09e3d333e8df87d5827a6651e7d3fd..2a4b751fd7b3a83ec3bdd8a67be9951feae300ae
@@@ -107,22 -107,15 +107,22 @@@ final class AttachmentBBCode extends Ab
                  $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;
      }
  
      /**