MediaWiki
REL1_19
|
Image gallery. More...
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() |
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.
Create a new image gallery object.
Definition at line 46 of file ImageGallery.php.
References $wgGalleryOptions.
ImageGallery::add | ( | $ | title, |
$ | html = '' , |
||
$ | alt = '' |
||
) |
Add an image to the gallery.
$title | Title object of the image that is added to the gallery |
$html | String: Additional HTML text to be shown. The name and size of the image are always shown. |
$alt | String: Alt text for the image |
Definition at line 145 of file ImageGallery.php.
References $title, and wfDebug().
Definition at line 359 of file ImageGallery.php.
Get the contextual title, if applicable.
Definition at line 377 of file ImageGallery.php.
Referenced by toHTML().
ImageGallery::insert | ( | $ | title, |
$ | html = '' , |
||
$ | alt = '' |
||
) |
Add an image at the beginning of the gallery.
$title | Title object of the image that is added to the gallery |
$html | String: Additional HTML text to be shown. The name and size of the image are always shown. |
$alt | String: 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.
ImageGallery::setAttributes | ( | $ | attribs | ) |
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.
$attribs | Array of HTML attribute pairs |
Definition at line 205 of file ImageGallery.php.
ImageGallery::setCaption | ( | $ | caption | ) |
Set the caption (as plain text)
$caption | Caption |
Definition at line 80 of file ImageGallery.php.
ImageGallery::setCaptionHtml | ( | $ | caption | ) |
Set the caption (as HTML)
$caption | String: Caption |
Definition at line 89 of file ImageGallery.php.
ImageGallery::setContextTitle | ( | $ | title | ) |
Set the contextual title.
$title | Title: contextual title |
Definition at line 368 of file ImageGallery.php.
References $title.
ImageGallery::setHeights | ( | $ | num | ) |
Set how high each image will be, in pixels.
$num | Integer > 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 | ) |
ImageGallery::setPerRow | ( | $ | num | ) |
Set how many images will be displayed per row.
$num | Integer >= 0; If perrow=0 the gallery layout will adapt to screensize invalid numbers will be rejected |
Definition at line 99 of file ImageGallery.php.
ImageGallery::setShowBytes | ( | $ | f | ) |
Enable/Disable showing of the file size of an image in the gallery.
Enabled by default.
$f | Boolean: 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.
$f | Boolean: set to false to disable. |
Definition at line 192 of file ImageGallery.php.
References $f.
ImageGallery::setWidths | ( | $ | num | ) |
Set how wide each image will be, in pixels.
$num | Integer > 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
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().
ImageGallery::useSkin | ( | $ | skin | ) |
Instruct the class to use a specific skin for rendering.
$skin | Skin object |
Definition at line 133 of file ImageGallery.php.
References wfDeprecated().
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.
const ImageGallery::GB_BORDERS = 8 |
Definition at line 41 of file ImageGallery.php.
Referenced by toHTML().
const ImageGallery::GB_PADDING = 5 |
Definition at line 39 of file ImageGallery.php.
Referenced by toHTML().
const ImageGallery::THUMB_PADDING = 30 |