MediaWiki  REL1_22
TraditionalImageGallery Class Reference
Inheritance diagram for TraditionalImageGallery:
Collaboration diagram for TraditionalImageGallery:

List of all members.

Public Member Functions

 toHTML ()
 Return a HTML representation of the image gallery.

Protected Member Functions

 adjustImageParameters ($thumb, &$imageParameters)
 Adjust the image parameters for a thumbnail.
 getAllPadding ()
 Get total padding.
 getGBBorders ()
 Get how much extra space the borders around the image takes up.
 getGBPadding ()
 getGBWidth ($thumb)
 Width of gallerybox .
 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 such the thumb have between image and inner div that 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.

Detailed Description

Definition at line 23 of file TraditionalImageGallery.php.


Member Function Documentation

TraditionalImageGallery::adjustImageParameters ( thumb,
&$  imageParameters 
) [protected]

Adjust the image parameters for a thumbnail.

Used by a subclass to insert extra high resolution images.

Parameters:
MediaTransformOutput$thumbThe thumbnail
Array$imageParametersArray of options

Reimplemented in PackedImageGallery.

Definition at line 313 of file TraditionalImageGallery.php.

Referenced by toHTML().

Get total padding.

Returns:
int How many pixels of whitespace surround the thumbnail.

Definition at line 241 of file TraditionalImageGallery.php.

References getGBBorders(), getGBPadding(), and getThumbPadding().

Referenced by toHTML().

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.

Returns:
int

Reimplemented in NolinesImageGallery.

Definition at line 232 of file TraditionalImageGallery.php.

Referenced by getAllPadding().

Note:
GB stands for gallerybox (as in the element)
Returns:
int

Reimplemented in PackedImageGallery.

Definition at line 221 of file TraditionalImageGallery.php.

Referenced by getAllPadding(), and getGBWidth().

TraditionalImageGallery::getGBWidth ( thumb) [protected]

Width of gallerybox .

Generally is the width of the image, plus padding on image plus padding on gallerybox.

Note:
Important: parameter will be false if no thumb used.
Parameters:
Mixed$thumbMediaTransformObject object or false.
Returns:
int width of gallerybox element

Reimplemented in PackedImageGallery.

Definition at line 291 of file TraditionalImageGallery.php.

References getGBPadding(), and getThumbPadding().

Referenced by toHTML().

Get a list of modules to include in the page.

Primarily intended for subclasses.

Returns:
Array modules to include

Reimplemented in PackedImageGallery.

Definition at line 302 of file TraditionalImageGallery.php.

References array().

Referenced by toHTML().

TraditionalImageGallery::getThumbDivWidth ( thumbWidth) [protected]

Get the width of the inner div that contains the thumbnail in question.

This is the div with the class of "thumb".

Parameters:
int$thumbWidthThe width of the thumbnail.
Returns:
int Width of inner thumb div.

Reimplemented in PackedImageGallery.

Definition at line 277 of file TraditionalImageGallery.php.

References getThumbPadding().

Referenced by toHTML().

How much padding such the thumb have between image and inner div that that contains the border.

This is both for verical and horizontal padding. (However, it is cut in half in the vertical direction).

Returns:
int

Reimplemented in PackedImageGallery, and NolinesImageGallery.

Definition at line 211 of file TraditionalImageGallery.php.

Referenced by getAllPadding(), getGBWidth(), getThumbDivWidth(), getVPad(), and toHTML().

Get the transform parameters for a thumbnail.

Parameters:
File$imgThe file in question. May be false for invalid image

Reimplemented in PackedImageGallery.

Definition at line 263 of file TraditionalImageGallery.php.

References array().

Referenced by toHTML().

TraditionalImageGallery::getVPad ( boxHeight,
thumbHeight 
) [protected]

Get vertical padding for a thumbnail.

Generally this is the total height minus how high the thumb is.

Parameters:
int$boxHeightHow high we want the box to be.
int$thumbHeightHow high the thumbnail is.
Returns:
int How many vertical padding to add on each side.

Reimplemented in PackedImageGallery, and NolinesImageGallery.

Definition at line 254 of file TraditionalImageGallery.php.

References getThumbPadding().

Referenced by toHTML().

Return a HTML representation of the image gallery.

For each image in the gallery, display

  • a thumbnail
  • the image name
  • the additional text provided when adding the image
  • the size of the image
Returns:
string

Reimplemented from ImageGalleryBase.

Definition at line 37 of file TraditionalImageGallery.php.

References $attribs, $link, $options, $output, $params, adjustImageParameters(), array(), as, block, getAllPadding(), ImageGalleryBase\getContextTitle(), getGBWidth(), getModules(), ContextSource\getOutput(), ImageGalleryBase\getRenderLang(), getThumbDivWidth(), getThumbPadding(), getThumbParams(), getVPad(), http, Linker\link(), list, Sanitizer\mergeAttributes(), ContextSource\msg(), Xml\openElement(), tags(), that, wfFindFile(), wfIsBadImage(), wfRunHooks(), and wrapGalleryText().

TraditionalImageGallery::wrapGalleryText ( galleryText,
thumb 
) [protected]

Add the wrapper html around the thumb's caption.

Parameters:
String$galleryTextThe caption
MediaTransformOutput | boolean$thumbThe thumb this caption is for or false for bad image.

Reimplemented in PackedOverlayImageGallery.

Definition at line 195 of file TraditionalImageGallery.php.

Referenced by toHTML().


The documentation for this class was generated from the following file: