MediaWiki  REL1_19
ImageGallery Class Reference

Image gallery. More...

List of all members.

Public Member Functions

 __construct ()
 Create a new image gallery object.
 add ($title, $html= '', $alt= '')
 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
 $mParser
 $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 12 of file ImageGallery.php.


Constructor & Destructor Documentation

Create a new image gallery object.

Definition at line 46 of file ImageGallery.php.

References $wgGalleryOptions.


Member Function Documentation

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

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

Definition at line 145 of file ImageGallery.php.

References $title, and wfDebug().

Here is the call graph for this function:

Returns:
Integer: number of images in the gallery

Definition at line 359 of file ImageGallery.php.

Get the contextual title, if applicable.

Returns:
mixed Title or false

Definition at line 377 of file ImageGallery.php.

Referenced by toHTML().

Here is the caller graph for this function:

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 161 of file ImageGallery.php.

References $title.

isEmpty() returns true if the gallery contains no images

Definition at line 172 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 205 of file ImageGallery.php.

ImageGallery::setCaption ( caption)

Set the caption (as plain text)

Parameters:
$captionCaption

Definition at line 80 of file ImageGallery.php.

Set the caption (as HTML)

Parameters:
$captionString: Caption

Definition at line 89 of file ImageGallery.php.

Set the contextual title.

Parameters:
$titleTitle: contextual title

Definition at line 368 of file ImageGallery.php.

References $title.

Set how high each image will be, in pixels.

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

Definition at line 121 of file ImageGallery.php.

ImageGallery::setHideBadImages ( flag = true)

Set bad image flag.

Definition at line 71 of file ImageGallery.php.

ImageGallery::setParser ( parser)

Register a parser object.

Parameters:
$parserParser

Definition at line 64 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 99 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 182 of file ImageGallery.php.

References $f.

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 192 of file ImageGallery.php.

References $f.

Set how wide each image will be, in pixels.

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

Definition at line 110 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

Definition at line 219 of file ImageGallery.php.

References $options, $output, $wgLang, GB_BORDERS, GB_PADDING, getContextTitle(), Linker\link(), Sanitizer\mergeAttributes(), Xml\openElement(), THUMB_PADDING, wfFindFile(), wfIsBadImage(), wfMsgHtml(), and wfRunHooks().

Here is the call graph for this function:

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 133 of file ImageGallery.php.

References wfDeprecated().

Here is the call graph for this function:


Member Data Documentation

ImageGallery::$contextTitle = false [protected]

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

Definition at line 31 of file ImageGallery.php.

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

Definition at line 33 of file ImageGallery.php.

ImageGallery::$mCaption = false

Definition at line 14 of file ImageGallery.php.

ImageGallery::$mHideBadImages

Hide blacklisted images?

Definition at line 19 of file ImageGallery.php.

ImageGallery::$mImages

Definition at line 13 of file ImageGallery.php.

ImageGallery::$mParser

Definition at line 25 of file ImageGallery.php.

ImageGallery::$mShowBytes

Definition at line 13 of file ImageGallery.php.

ImageGallery::$mShowFilename

Definition at line 13 of file ImageGallery.php.

Definition at line 41 of file ImageGallery.php.

Referenced by toHTML().

Definition at line 39 of file ImageGallery.php.

Referenced by toHTML().

Fixed margins.

Definition at line 38 of file ImageGallery.php.

Referenced by toHTML().


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