MediaWiki master
PackedOverlayImageGallery.php
Go to the documentation of this file.
1<?php
34 protected function wrapGalleryText( $galleryText, $thumb ) {
35 // If we have no text, do not output anything to avoid
36 // ugly white overlay.
37 if ( trim( $galleryText ) === '' ) {
38 return '';
39 }
40
41 $thumbWidth = $this->getGBWidth( $thumb ) - $this->getThumbPadding() - $this->getGBPadding();
42 $captionWidth = ceil( $thumbWidth - 20 );
43
44 $outerWrapper = '<div class="gallerytextwrapper" style="width: ' . $captionWidth . 'px">';
45
46 return "\n\t\t\t" .
47 $outerWrapper . '<div class="gallerytext">' . $galleryText . "</div>"
48 . "\n\t\t\t</div>";
49 }
50}
getThumbPadding()
How much padding the thumb has between the image and the inner div that contains the border.
Packed overlay image gallery.
wrapGalleryText( $galleryText, $thumb)
Add the wrapper html around the thumb's caption.