MediaWiki master
PackedOverlayImageGallery.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Gallery;
8
10
24 protected function wrapGalleryText( $galleryText, $thumb ) {
25 // If we have no text, do not output anything to avoid
26 // ugly white overlay.
27 if ( trim( $galleryText ) === '' ) {
28 return '';
29 }
30
31 $thumbWidth = $this->getGBWidth( $thumb ) - $this->getThumbPadding() - $this->getGBPadding();
32 $captionWidth = ceil( $thumbWidth - 20 );
33
34 $outerWrapper = '<div class="gallerytextwrapper" style="width: ' . $captionWidth . 'px">';
35
36 return "\n\t\t\t" .
37 $outerWrapper . '<div class="gallerytext">' . $galleryText . "</div>"
38 . "\n\t\t\t</div>";
39 }
40}
41
43class_alias( PackedOverlayImageGallery::class, 'PackedOverlayImageGallery' );
getThumbPadding()
How much padding the thumb has between the image and the inner div that contains the border....
getGBPadding()
GB stands for gallerybox (as in the element)int
wrapGalleryText( $galleryText, $thumb)
Add the wrapper html around the thumb's caption.
Base class for the output of MediaHandler::doTransform() and File::transform().