MediaWiki
REL1_22
|
Image gallery. More...
Public Member Functions | |
__construct ($mode= 'traditional') | |
Create a new image gallery object. | |
add ($title, $html= '', $alt= '', $link= '', $handlerOpts=array()) | |
Add an image to the gallery. | |
count () | |
getContextTitle () | |
Get the contextual title, if applicable. | |
insert ($title, $html= '', $alt= '', $link= '', $handlerOpts=array()) | |
Add an image at the beginning of the gallery. | |
isEmpty () | |
isEmpty() returns true if the gallery contains no images | |
setAdditionalOptions ($options) | |
Allow setting additional options. | |
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 () | |
Display an html representation of the gallery. | |
useSkin ($skin) | |
Instruct the class to use a specific skin for rendering. | |
Static Public Member Functions | |
static | factory ($mode=false) |
Get a new image gallery. | |
Public Attributes | |
$mCaption = false | |
$mHideBadImages | |
Hide blacklisted images? | |
$mImages | |
$mMode | |
Parser | $mParser |
Registered parser object for output callbacks. | |
$mShowBytes | |
$mShowFilename | |
Protected Member Functions | |
getRenderLang () | |
Determines the correct language to be used for this image gallery. | |
Protected Attributes | |
$contextTitle = false | |
Contextual title, used when images are being screened against the bad image list. | |
$mAttribs = array() | |
Static Private Member Functions | |
static | loadModes () |
Static Private Attributes | |
static | $modeMapping = false |
Image gallery.
Add images to the gallery using add(), then render that list to HTML using toHTML().
Definition at line 30 of file ImageGalleryBase.php.
ImageGalleryBase::__construct | ( | $ | mode = 'traditional' | ) |
Create a new image gallery object.
You should not call this directly, but instead use ImageGalleryBase::factory().
Reimplemented in ImageGallery, and PackedImageGallery.
Definition at line 96 of file ImageGalleryBase.php.
ImageGalleryBase::add | ( | $ | title, |
$ | html = '' , |
||
$ | alt = '' , |
||
$ | link = '' , |
||
$ | handlerOpts = array() |
||
) |
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 |
$link | String: Override image link (optional) |
$handlerOpts | Array: Array of options for image handler (aka page number) |
Definition at line 212 of file ImageGalleryBase.php.
Definition at line 289 of file ImageGalleryBase.php.
static ImageGalleryBase::factory | ( | $ | mode = false | ) | [static] |
Get a new image gallery.
This is the method other callers should use to get a gallery.
String | bool | $mode | Mode to use. False to use the default. |
Definition at line 60 of file ImageGalleryBase.php.
Referenced by NewFilesPager\getStartBody(), and ImageQueryPage\outputResults().
Get the contextual title, if applicable.
Definition at line 307 of file ImageGalleryBase.php.
Referenced by TraditionalImageGallery\toHTML().
ImageGalleryBase::getRenderLang | ( | ) | [protected] |
Determines the correct language to be used for this image gallery.
Definition at line 317 of file ImageGalleryBase.php.
Referenced by TraditionalImageGallery\toHTML().
ImageGalleryBase::insert | ( | $ | title, |
$ | html = '' , |
||
$ | alt = '' , |
||
$ | link = '' , |
||
$ | handlerOpts = array() |
||
) |
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 |
$link | String: Override image link (optional) |
$handlerOpts | Array: Array of options for image handler (aka page number) |
Definition at line 230 of file ImageGalleryBase.php.
isEmpty() returns true if the gallery contains no images
Definition at line 242 of file ImageGalleryBase.php.
static ImageGalleryBase::loadModes | ( | ) | [static, private] |
Definition at line 76 of file ImageGalleryBase.php.
References array(), and wfRunHooks().
ImageGalleryBase::setAdditionalOptions | ( | $ | options | ) |
Allow setting additional options.
This is meant to allow extensions to add additional parameters to <gallery> parser tag.
Array | $options | Attributes of gallery tag. |
Definition at line 190 of file ImageGalleryBase.php.
ImageGalleryBase::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.
array | $attribs | of HTML attribute pairs |
Definition at line 275 of file ImageGalleryBase.php.
ImageGalleryBase::setCaption | ( | $ | caption | ) |
Set the caption (as plain text)
string | $caption | Caption |
Definition at line 136 of file ImageGalleryBase.php.
ImageGalleryBase::setCaptionHtml | ( | $ | caption | ) |
Set the caption (as HTML)
string | $caption | Caption |
Definition at line 145 of file ImageGalleryBase.php.
ImageGalleryBase::setContextTitle | ( | $ | title | ) |
Set the contextual title.
$title | Title: contextual title |
Definition at line 298 of file ImageGalleryBase.php.
ImageGalleryBase::setHeights | ( | $ | num | ) |
Set how high each image will be, in pixels.
$num | Integer > 0; invalid numbers will be ignored |
Definition at line 177 of file ImageGalleryBase.php.
ImageGalleryBase::setHideBadImages | ( | $ | flag = true | ) |
Set bad image flag.
Definition at line 127 of file ImageGalleryBase.php.
ImageGalleryBase::setParser | ( | $ | parser | ) |
Register a parser object.
If you do not set this and the output of this gallery ends up in parser cache, the javascript will break!
$parser | Parser |
Definition at line 120 of file ImageGalleryBase.php.
ImageGalleryBase::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 |
Reimplemented in PackedImageGallery.
Definition at line 155 of file ImageGalleryBase.php.
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 252 of file ImageGalleryBase.php.
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 262 of file ImageGalleryBase.php.
ImageGalleryBase::setWidths | ( | $ | num | ) |
Set how wide each image will be, in pixels.
$num | Integer > 0; invalid numbers will be ignored |
Definition at line 166 of file ImageGalleryBase.php.
ImageGalleryBase::toHTML | ( | ) | [abstract] |
Display an html representation of the gallery.
Reimplemented in TraditionalImageGallery.
ImageGalleryBase::useSkin | ( | $ | skin | ) |
Instruct the class to use a specific skin for rendering.
$skin | Skin object |
Definition at line 198 of file ImageGalleryBase.php.
ImageGalleryBase::$contextTitle = false [protected] |
Contextual title, used when images are being screened against the bad image list.
Definition at line 48 of file ImageGalleryBase.php.
ImageGalleryBase::$mAttribs = array() [protected] |
Definition at line 50 of file ImageGalleryBase.php.
ImageGalleryBase::$mCaption = false |
Definition at line 32 of file ImageGalleryBase.php.
ImageGalleryBase::$mHideBadImages |
Hide blacklisted images?
Definition at line 37 of file ImageGalleryBase.php.
ImageGalleryBase::$mImages |
Definition at line 31 of file ImageGalleryBase.php.
ImageGalleryBase::$mMode |
Definition at line 31 of file ImageGalleryBase.php.
ImageGalleryBase::$modeMapping = false [static, private] |
Definition at line 52 of file ImageGalleryBase.php.
Parser ImageGalleryBase::$mParser |
Registered parser object for output callbacks.
Definition at line 42 of file ImageGalleryBase.php.
ImageGalleryBase::$mShowBytes |
Definition at line 31 of file ImageGalleryBase.php.
ImageGalleryBase::$mShowFilename |
Definition at line 31 of file ImageGalleryBase.php.