Public Member Functions | |
| __construct () | |
| Create a new image gallery object. | |
| setParser ($parser) | |
| Register a parser object. | |
| setHideBadImages ($flag=true) | |
| Set bad image flag. | |
| setCaption ($caption) | |
| Set the caption (as plain text). | |
| setCaptionHtml ($caption) | |
| Set the caption (as HTML). | |
| setPerRow ($num) | |
| Set how many images will be displayed per row. | |
| setWidths ($num) | |
| Set how wide each image will be, in pixels. | |
| setHeights ($num) | |
| Set how high each image will be, in pixels. | |
| useSkin ($skin) | |
| Instruct the class to use a specific skin for rendering. | |
| getSkin () | |
| Return the skin that should be used. | |
| add ($title, $html='') | |
| Add an image to the gallery. | |
| insert ($title, $html='') | |
| Add an image at the beginning of the gallery. | |
| isEmpty () | |
| isEmpty() returns true if the gallery contains no images | |
| 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. | |
| setAttributes ($attribs) | |
| Set arbitrary attributes to go on the HTML gallery output element. | |
| toHTML () | |
| Return a HTML representation of the image gallery. | |
| count () | |
| setContextTitle ($title) | |
| Set the contextual title. | |
| getContextTitle () | |
| Get the contextual title, if applicable. | |
Public Attributes | |
| $mImages | |
| $mShowBytes | |
| $mShowFilename | |
| $mCaption = false | |
| $mSkin = false | |
| $mRevisionId = 0 | |
| $mHideBadImages | |
| Hide blacklisted images? | |
| $mParser | |
| Registered parser object for output callbacks. | |
Private Attributes | |
| $contextTitle = false | |
| Contextual title, used when images are being screened against the bad image list. | |
| $mPerRow = 4 | |
| $mWidths = 120 | |
| $mHeights = 120 | |
| $mAttribs = array() | |
Add images to the gallery using add(), then render that list to HTML using toHTML().
Definition at line 12 of file ImageGallery.php.
| ImageGallery::__construct | ( | ) |
| ImageGallery::add | ( | $ | title, | |
| $ | html = '' | |||
| ) |
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. |
Definition at line 146 of file ImageGallery.php.
| ImageGallery::count | ( | ) |
| ImageGallery::getContextTitle | ( | ) |
Get the contextual title, if applicable.
Definition at line 343 of file ImageGallery.php.
Referenced by toHTML().
| ImageGallery::getSkin | ( | ) |
Return the skin that should be used.
Definition at line 130 of file ImageGallery.php.
References $wgUser.
Referenced by toHTML().
| ImageGallery::insert | ( | $ | title, | |
| $ | html = '' | |||
| ) |
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. |
Definition at line 161 of file ImageGallery.php.
References $title.
| ImageGallery::isEmpty | ( | ) |
isEmpty() returns true if the gallery contains no images
Definition at line 173 of file ImageGallery.php.
| ImageGallery::setAttributes | ( | $ | attribs | ) |
Set arbitrary attributes to go on the HTML gallery output element.
Should be suitable for a <table> element.
Note -- if taking from user input, you should probably run through Sanitizer::validateAttributes() first.
| array | of HTML attribute pairs |
Definition at line 206 of file ImageGallery.php.
| ImageGallery::setCaption | ( | $ | caption | ) |
Set the caption (as plain text).
| $caption | Caption |
Definition at line 70 of file ImageGallery.php.
| ImageGallery::setCaptionHtml | ( | $ | caption | ) |
Set the caption (as HTML).
| $caption | Caption |
Definition at line 79 of file ImageGallery.php.
| ImageGallery::setContextTitle | ( | $ | title | ) |
Set the contextual title.
| Title | $title Contextual title |
Definition at line 334 of file ImageGallery.php.
References $title.
| ImageGallery::setHeights | ( | $ | num | ) |
Set how high each image will be, in pixels.
| int | $num > 0; invalid numbers will be ignored |
Definition at line 110 of file ImageGallery.php.
| ImageGallery::setHideBadImages | ( | $ | flag = true |
) |
| ImageGallery::setParser | ( | $ | parser | ) |
| ImageGallery::setPerRow | ( | $ | num | ) |
Set how many images will be displayed per row.
| int | $num > 0; invalid numbers will be rejected |
Definition at line 88 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 183 of file ImageGallery.php.
| ImageGallery::setShowFilename | ( | $ | 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 193 of file ImageGallery.php.
| ImageGallery::setWidths | ( | $ | num | ) |
Set how wide each image will be, in pixels.
| int | $num > 0; invalid numbers will be ignored |
Definition at line 99 of file ImageGallery.php.
| ImageGallery::toHTML | ( | ) |
Return a HTML representation of the image gallery.
For each image in the gallery, display
Definition at line 220 of file ImageGallery.php.
References $i, $s, $text, $wgLang, getContextTitle(), getSkin(), Sanitizer::mergeAttributes(), Xml::openElement(), wfFindFile(), wfIsBadImage(), wfMsgExt(), wfMsgHtml(), and wfRunHooks().
| ImageGallery::useSkin | ( | $ | skin | ) |
Instruct the class to use a specific skin for rendering.
| $skin | Skin object |
Definition at line 121 of file ImageGallery.php.
ImageGallery::$contextTitle = false [private] |
Contextual title, used when images are being screened against the bad image list.
Definition at line 33 of file ImageGallery.php.
ImageGallery::$mAttribs = array() [private] |
Definition at line 38 of file ImageGallery.php.
| ImageGallery::$mCaption = false |
Definition at line 15 of file ImageGallery.php.
ImageGallery::$mHeights = 120 [private] |
Definition at line 36 of file ImageGallery.php.
| ImageGallery::$mHideBadImages |
| ImageGallery::$mImages |
Definition at line 14 of file ImageGallery.php.
| ImageGallery::$mParser |
ImageGallery::$mPerRow = 4 [private] |
Definition at line 35 of file ImageGallery.php.
| ImageGallery::$mRevisionId = 0 |
Definition at line 17 of file ImageGallery.php.
| ImageGallery::$mShowBytes |
Definition at line 14 of file ImageGallery.php.
| ImageGallery::$mShowFilename |
Definition at line 14 of file ImageGallery.php.
| ImageGallery::$mSkin = false |
Definition at line 16 of file ImageGallery.php.
ImageGallery::$mWidths = 120 [private] |
Definition at line 36 of file ImageGallery.php.
1.5.9