MediaWiki
master
Toggle main menu visibility
PackedOverlayImageGallery.php
Go to the documentation of this file.
1
<?php
6
7
namespace
MediaWiki\Gallery;
8
9
use MediaWiki\Media\MediaTransformOutput;
10
15
class
PackedOverlayImageGallery
extends
PackedImageGallery
{
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
43
class_alias( PackedOverlayImageGallery::class,
'PackedOverlayImageGallery'
);
MediaWiki\Gallery\PackedImageGallery
Packed image gallery.
Definition
PackedImageGallery.php:16
MediaWiki\Gallery\PackedImageGallery\getThumbPadding
getThumbPadding()
How much padding the thumb has between the image and the inner div that contains the border....
Definition
PackedImageGallery.php:37
MediaWiki\Gallery\PackedImageGallery\getGBWidth
getGBWidth( $thumb)
Definition
PackedImageGallery.php:81
MediaWiki\Gallery\PackedImageGallery\getGBPadding
getGBPadding()
GB stands for gallerybox (as in the element)int
Definition
PackedImageGallery.php:42
MediaWiki\Gallery\PackedOverlayImageGallery
Packed overlay image gallery.
Definition
PackedOverlayImageGallery.php:15
MediaWiki\Gallery\PackedOverlayImageGallery\wrapGalleryText
wrapGalleryText( $galleryText, $thumb)
Add the wrapper html around the thumb's caption.
Definition
PackedOverlayImageGallery.php:24
includes
Gallery
PackedOverlayImageGallery.php
Generated on
for MediaWiki by
1.18.0