MediaWiki REL1_33
|
Public Member Functions | |
toHTML () | |
Return a HTML representation of the image gallery. | |
Public Member Functions inherited from ImageGalleryBase | |
__construct ( $mode='traditional', IContextSource $context=null) | |
Create a new image gallery object. | |
add ( $title, $html='', $alt='', $link='', $handlerOpts=[]) | |
Add an image to the gallery. | |
count () | |
getContextTitle () | |
Get the contextual title, if applicable. | |
getImages () | |
Returns the list of images this gallery contains. | |
insert ( $title, $html='', $alt='', $link='', $handlerOpts=[]) | |
Add an image at the beginning of the gallery. | |
isEmpty () | |
isEmpty() returns true if the gallery contains no images | |
setAdditionalOptions ( $options) | |
Allow setting additional options. | |
setAttributes ( $attribs) | |
Set arbitrary attributes to go on the HTML gallery output element. | |
setCaption ( $caption) | |
Set the caption (as plain text) | |
setCaptionHtml ( $caption) | |
Set the caption (as HTML) | |
setContextTitle ( $title) | |
Set the contextual title. | |
setHeights ( $num) | |
Set how high each image will be, in pixels. | |
setHideBadImages ( $flag=true) | |
Set bad image flag. | |
setParser ( $parser) | |
Register a parser object. | |
setPerRow ( $num) | |
Set how many images will be displayed per row. | |
setShowBytes ( $f) | |
Enable/Disable showing of the file size of an image in the gallery. | |
setShowDimensions ( $f) | |
Enable/Disable showing of the dimensions of an image in the gallery. | |
setShowFilename ( $f) | |
Enable/Disable showing of the filename of an image in the gallery. | |
setWidths ( $num) | |
Set how wide each image will be, in pixels. | |
Public Member Functions inherited from ContextSource | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. | |
getConfig () | |
getContext () | |
Get the base IContextSource object. | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getStats () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key) | |
Get a Message object with context set Parameters are the same as wfMessage() | |
setContext (IContextSource $context) | |
Protected Member Functions | |
adjustImageParameters ( $thumb, &$imageParameters) | |
Adjust the image parameters for a thumbnail. | |
getAllPadding () | |
Get total padding. | |
getCaptionHtml (Title $nt, Language $lang) | |
getCaptionLength () | |
Length (in characters) to truncate filename to in caption when using "showfilename" (if int). | |
getGBBorders () | |
Get how much extra space the borders around the image takes up. | |
getGBPadding () | |
getGBWidth ( $thumb) | |
Computed width of gallerybox . | |
getGBWidthOverwrite ( $thumb) | |
Allows overwriting the computed width of the gallerybox with a string, like '100'. | |
getModules () | |
Get a list of modules to include in the page. | |
getThumbDivWidth ( $thumbWidth) | |
Get the width of the inner div that contains the thumbnail in question. | |
getThumbPadding () | |
How much padding the thumb has between the image and the inner div that contains the border. | |
getThumbParams ( $img) | |
Get the transform parameters for a thumbnail. | |
getVPad ( $boxHeight, $thumbHeight) | |
Get vertical padding for a thumbnail. | |
wrapGalleryText ( $galleryText, $thumb) | |
Add the wrapper html around the thumb's caption. | |
Protected Member Functions inherited from ImageGalleryBase | |
getRenderLang () | |
Determines the correct language to be used for this image gallery. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ImageGalleryBase | |
static | factory ( $mode=false, IContextSource $context=null) |
Get a new image gallery. | |
Public Attributes inherited from ImageGalleryBase | |
Parser | $mParser |
Registered parser object for output callbacks. | |
Protected Attributes inherited from ImageGalleryBase | |
Title | $contextTitle = false |
Contextual title, used when images are being screened against the bad image list. | |
array | $mAttribs = [] |
bool string | $mCaption = false |
Gallery caption. | |
bool int | $mCaptionLength = true |
Length to truncate filename to in caption when using "showfilename". | |
bool | $mHideBadImages |
Hide blacklisted images? | |
array | $mImages |
Gallery images. | |
string | $mMode |
Gallery mode. | |
bool | $mShowBytes |
Whether to show the filesize in bytes in categories. | |
bool | $mShowDimensions |
Whether to show the dimensions in categories. | |
bool | $mShowFilename |
Whether to show the filename. | |
Definition at line 23 of file TraditionalImageGallery.php.
|
protected |
Adjust the image parameters for a thumbnail.
Used by a subclass to insert extra high resolution images.
MediaTransformOutput | $thumb | The thumbnail |
array | &$imageParameters | Array of options |
Reimplemented in PackedImageGallery.
Definition at line 390 of file TraditionalImageGallery.php.
Referenced by toHTML().
|
protected |
Get total padding.
Definition at line 302 of file TraditionalImageGallery.php.
References getGBBorders(), getGBPadding(), and getThumbPadding().
Referenced by toHTML().
Definition at line 221 of file TraditionalImageGallery.php.
References getCaptionLength(), Title\getText(), Linker\linkKnown(), and Language\truncateForVisual().
Referenced by toHTML().
|
protected |
Length (in characters) to truncate filename to in caption when using "showfilename" (if int).
A value of 'true' will truncate the filename to one line using CSS, while 'false' will disable truncating.
Definition at line 293 of file TraditionalImageGallery.php.
References ImageGalleryBase\$mCaptionLength.
Referenced by getCaptionHtml().
|
protected |
Get how much extra space the borders around the image takes up.
For this mode, it is 2px borders on each side + 2px implied padding on each side from the stylesheet, giving us 2*2+2*2 = 8.
Reimplemented in NolinesImageGallery.
Definition at line 282 of file TraditionalImageGallery.php.
Referenced by getAllPadding().
|
protected |
Reimplemented in PackedImageGallery.
Definition at line 271 of file TraditionalImageGallery.php.
Referenced by getAllPadding(), and getGBWidth().
|
protected |
Computed width of gallerybox .
Generally is the width of the image, plus padding on image plus padding on gallerybox.
MediaTransformOutput | bool | $thumb | MediaTransformObject object or false. |
Reimplemented in PackedImageGallery.
Definition at line 353 of file TraditionalImageGallery.php.
References getGBPadding(), and getThumbPadding().
Referenced by toHTML().
|
protected |
Allows overwriting the computed width of the gallerybox with a string, like '100'.
Generally is the width of the image, plus padding on image plus padding on gallerybox.
MediaTransformOutput | bool | $thumb | MediaTransformObject object or false. |
Definition at line 368 of file TraditionalImageGallery.php.
Referenced by toHTML().
|
protected |
Get a list of modules to include in the page.
Primarily intended for subclasses.
Reimplemented in PackedImageGallery, and SlideshowImageGallery.
Definition at line 379 of file TraditionalImageGallery.php.
Referenced by toHTML().
|
protected |
Get the width of the inner div that contains the thumbnail in question.
This is the div with the class of "thumb".
int | $thumbWidth | The width of the thumbnail. |
Reimplemented in PackedImageGallery.
Definition at line 339 of file TraditionalImageGallery.php.
References getThumbPadding().
Referenced by toHTML().
|
protected |
How much padding the thumb has between the image and the inner div that contains the border.
This is for both vertical and horizontal padding. (However, it is cut in half in the vertical direction).
Reimplemented in NolinesImageGallery, and PackedImageGallery.
Definition at line 262 of file TraditionalImageGallery.php.
Referenced by getAllPadding(), getGBWidth(), getThumbDivWidth(), getVPad(), and toHTML().
|
protected |
Get the transform parameters for a thumbnail.
File | $img | The file in question. May be false for invalid image |
Reimplemented in PackedImageGallery.
Definition at line 325 of file TraditionalImageGallery.php.
Referenced by toHTML().
|
protected |
Get vertical padding for a thumbnail.
Generally this is the total height minus how high the thumb is.
int | $boxHeight | How high we want the box to be. |
int | $thumbHeight | How high the thumbnail is. |
Reimplemented in NolinesImageGallery, and PackedImageGallery.
Definition at line 315 of file TraditionalImageGallery.php.
References getThumbPadding().
Referenced by toHTML().
TraditionalImageGallery::toHTML | ( | ) |
Return a HTML representation of the image gallery.
For each image in the gallery, display
Reimplemented from ImageGalleryBase.
Definition at line 35 of file TraditionalImageGallery.php.
References $attribs, $handler, $lang, $link, $modules, $options, $output, $params, adjustImageParameters(), as, getAllPadding(), getCaptionHtml(), getGBWidth(), getGBWidthOverwrite(), getModules(), ContextSource\getOutput(), ImageGalleryBase\getRenderLang(), getThumbDivWidth(), getThumbPadding(), getThumbParams(), getVPad(), Linker\linkKnown(), list, ContextSource\msg(), NS_FILE, Linker\processResponsiveImages(), wfFindFile(), wfIsBadImage(), and wrapGalleryText().
|
protected |
Add the wrapper html around the thumb's caption.
string | $galleryText | The caption |
MediaTransformOutput | bool | $thumb | The thumb this caption is for or false for bad image. |
Reimplemented in PackedOverlayImageGallery.
Definition at line 245 of file TraditionalImageGallery.php.
Referenced by toHTML().