MediaWiki  REL1_20
ImageGallery Class Reference

Image gallery. More...

Collaboration diagram for ImageGallery:

List of all members.

Public Member Functions

 __construct ()
 Create a new image gallery object.
 add ($title, $html= '', $alt= '', $link= '')
 Add an image to the gallery.
 count ()
 getContextTitle ()
 Get the contextual title, if applicable.
 insert ($title, $html= '', $alt= '')
 Add an image at the beginning of the gallery.
 isEmpty ()
 isEmpty() returns true if the gallery contains no images
 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.
 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.
 toHTML ()
 Return a HTML representation of the image gallery.
 useSkin ($skin)
 Instruct the class to use a specific skin for rendering.

Public Attributes

 $mCaption = false
 $mHideBadImages
 Hide blacklisted images?
 $mImages
Parser $mParser
 Registered parser object for output callbacks.
 $mShowBytes
 $mShowFilename
const GB_BORDERS = 8
const GB_PADDING = 5
const THUMB_PADDING = 30
 Fixed margins.

Protected Attributes

 $contextTitle = false
 Contextual title, used when images are being screened against the bad image list.
 $mAttribs = array()

Detailed Description

Image gallery.

Add images to the gallery using add(), then render that list to HTML using toHTML().

Definition at line 30 of file ImageGallery.php.


Constructor & Destructor Documentation

Create a new image gallery object.

Definition at line 63 of file ImageGallery.php.


Member Function Documentation

ImageGallery::add ( title,
html = '',
alt = '',
link = '' 
)

Add an image to the gallery.

Parameters:
$titleTitle object of the image that is added to the gallery
$htmlString: Additional HTML text to be shown. The name and size of the image are always shown.
$altString: Alt text for the image
$linkString: Override image link (optional)

Definition at line 163 of file ImageGallery.php.

Returns:
Integer: number of images in the gallery

Definition at line 381 of file ImageGallery.php.

Get the contextual title, if applicable.

Returns:
mixed Title or false

Definition at line 399 of file ImageGallery.php.

ImageGallery::insert ( title,
html = '',
alt = '' 
)

Add an image at the beginning of the gallery.

Parameters:
$titleTitle object of the image that is added to the gallery
$htmlString: Additional HTML text to be shown. The name and size of the image are always shown.
$altString: Alt text for the image

Definition at line 179 of file ImageGallery.php.

isEmpty() returns true if the gallery contains no images

Returns:
bool

Definition at line 191 of file ImageGallery.php.

Set arbitrary attributes to go on the HTML gallery output element.

Should be suitable for a

.

Note -- if taking from user input, you should probably run through Sanitizer::validateAttributes() first.

Parameters:
$attribsArray of HTML attribute pairs

Definition at line 224 of file ImageGallery.php.

ImageGallery::setCaption ( caption)

Set the caption (as plain text)

Parameters:
$captionstring Caption

Definition at line 97 of file ImageGallery.php.

Set the caption (as HTML)

Parameters:
$captionString: Caption

Definition at line 106 of file ImageGallery.php.

Set the contextual title.

Parameters:
$titleTitle: contextual title

Definition at line 390 of file ImageGallery.php.

Set how high each image will be, in pixels.

Parameters:
$numInteger > 0; invalid numbers will be ignored

Definition at line 138 of file ImageGallery.php.

ImageGallery::setHideBadImages ( flag = true)

Set bad image flag.

Definition at line 88 of file ImageGallery.php.

ImageGallery::setParser ( parser)

Register a parser object.

Parameters:
$parserParser

Definition at line 81 of file ImageGallery.php.

Set how many images will be displayed per row.

Parameters:
$numInteger >= 0; If perrow=0 the gallery layout will adapt to screensize invalid numbers will be rejected

Definition at line 116 of file ImageGallery.php.

Enable/Disable showing of the file size of an image in the gallery.

Enabled by default.

Parameters:
$fBoolean: set to false to disable.

Definition at line 201 of file ImageGallery.php.

Enable/Disable showing of the filename of an image in the gallery.

Enabled by default.

Parameters:
$fBoolean: set to false to disable.

Definition at line 211 of file ImageGallery.php.

Set how wide each image will be, in pixels.

Parameters:
$numInteger > 0; invalid numbers will be ignored

Definition at line 127 of file ImageGallery.php.

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

Definition at line 239 of file ImageGallery.php.

ImageGallery::useSkin ( skin)

Instruct the class to use a specific skin for rendering.

Parameters:
$skinSkin object
Deprecated:
since 1.18 Not used anymore

Definition at line 150 of file ImageGallery.php.


Member Data Documentation

ImageGallery::$contextTitle = false [protected]

Contextual title, used when images are being screened against the bad image list.

Definition at line 48 of file ImageGallery.php.

ImageGallery::$mAttribs = array() [protected]

Definition at line 50 of file ImageGallery.php.

ImageGallery::$mCaption = false

Definition at line 32 of file ImageGallery.php.

ImageGallery::$mHideBadImages

Hide blacklisted images?

Definition at line 37 of file ImageGallery.php.

ImageGallery::$mImages

Definition at line 31 of file ImageGallery.php.

Parser ImageGallery::$mParser

Registered parser object for output callbacks.

Definition at line 42 of file ImageGallery.php.

ImageGallery::$mShowBytes

Definition at line 31 of file ImageGallery.php.

ImageGallery::$mShowFilename

Definition at line 31 of file ImageGallery.php.

Definition at line 58 of file ImageGallery.php.

Definition at line 56 of file ImageGallery.php.

Fixed margins.

Definition at line 55 of file ImageGallery.php.


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