MediaWiki
1.23.2
|
Image gallery. More...
Public Member Functions | |
__construct ( $mode='traditional') | |
Create a new image gallery object. More... | |
add ( $title, $html='', $alt='', $link='', $handlerOpts=array()) | |
Add an image to the gallery. More... | |
count () | |
getContextTitle () | |
Get the contextual title, if applicable. More... | |
insert ( $title, $html='', $alt='', $link='', $handlerOpts=array()) | |
Add an image at the beginning of the gallery. More... | |
isEmpty () | |
isEmpty() returns true if the gallery contains no images More... | |
setAdditionalOptions ( $options) | |
Allow setting additional options. More... | |
setAttributes ( $attribs) | |
Set arbitrary attributes to go on the HTML gallery output element. More... | |
setCaption ( $caption) | |
Set the caption (as plain text) More... | |
setCaptionHtml ( $caption) | |
Set the caption (as HTML) More... | |
setContextTitle ( $title) | |
Set the contextual title. More... | |
setHeights ( $num) | |
Set how high each image will be, in pixels. More... | |
setHideBadImages ( $flag=true) | |
Set bad image flag. More... | |
setParser ( $parser) | |
Register a parser object. More... | |
setPerRow ( $num) | |
Set how many images will be displayed per row. More... | |
setShowBytes ( $f) | |
Enable/Disable showing of the file size of an image in the gallery. More... | |
setShowFilename ( $f) | |
Enable/Disable showing of the filename of an image in the gallery. More... | |
setWidths ( $num) | |
Set how wide each image will be, in pixels. More... | |
toHTML () | |
Display an html representation of the gallery. More... | |
useSkin ( $skin) | |
Instruct the class to use a specific skin for rendering. More... | |
Public Member Functions inherited from ContextSource | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). More... | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. More... | |
getConfig () | |
Get the Config object. More... | |
getContext () | |
Get the RequestContext object. More... | |
getLang () | |
Get the Language object. More... | |
getLanguage () | |
Get the Language object. More... | |
getOutput () | |
Get the OutputPage object. More... | |
getRequest () | |
Get the WebRequest object. More... | |
getSkin () | |
Get the Skin object. More... | |
getTitle () | |
Get the Title object. More... | |
getUser () | |
Get the User object. More... | |
getWikiPage () | |
Get the WikiPage object. More... | |
msg () | |
Get a Message object with context set Parameters are the same as wfMessage() More... | |
setContext (IContextSource $context) | |
Set the IContextSource object. More... | |
Static Public Member Functions | |
static | factory ( $mode=false) |
Get a new image gallery. More... | |
Public Attributes | |
bool string | $mCaption = false |
Gallery caption. More... | |
bool | $mHideBadImages |
Hide blacklisted images? More... | |
array | $mImages |
Gallery images *. More... | |
string | $mMode |
Gallery mode. More... | |
Parser | $mParser |
Registered parser object for output callbacks. More... | |
bool | $mShowBytes |
Whether to show the filesize in bytes in categories *. More... | |
bool | $mShowFilename |
Whether to show the filename. More... | |
Protected Member Functions | |
getRenderLang () | |
Determines the correct language to be used for this image gallery. More... | |
Protected Attributes | |
Title | $contextTitle = false |
Contextual title, used when images are being screened against the bad image list. More... | |
array | $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 102 of file ImageGalleryBase.php.
ImageGalleryBase::add | ( | $title, | |
$html = '' , |
|||
$alt = '' , |
|||
$link = '' , |
|||
$handlerOpts = array() |
|||
) |
Add an image to the gallery.
Title | $title | Title object of the image that is added to the gallery |
string | $html | Additional HTML text to be shown. The name and size of the image are always shown. |
string | $alt | Alt text for the image |
string | $link | Override image link (optional) |
array | $handlerOpts | Array of options for image handler (aka page number) |
Definition at line 220 of file ImageGalleryBase.php.
ImageGalleryBase::count | ( | ) |
Definition at line 298 of file ImageGalleryBase.php.
|
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. |
MWException |
Definition at line 66 of file ImageGalleryBase.php.
References $wgContLang, global, and loadModes().
Referenced by CategoryViewer\clearCategoryState(), SpecialUpload\getDupeWarning(), NewFilesPager\getStartBody(), and ImageQueryPage\outputResults().
ImageGalleryBase::getContextTitle | ( | ) |
Get the contextual title, if applicable.
Definition at line 316 of file ImageGalleryBase.php.
Referenced by TraditionalImageGallery\toHTML().
|
protected |
Determines the correct language to be used for this image gallery.
Definition at line 326 of file ImageGalleryBase.php.
References ContextSource\getLanguage().
Referenced by TraditionalImageGallery\toHTML().
ImageGalleryBase::insert | ( | $title, | |
$html = '' , |
|||
$alt = '' , |
|||
$link = '' , |
|||
$handlerOpts = array() |
|||
) |
Add an image at the beginning of the gallery.
Title | $title | Title object of the image that is added to the gallery |
string | $html | Additional HTML text to be shown. The name and size of the image are always shown. |
string | $alt | Alt text for the image |
string | $link | Override image link (optional) |
array | $handlerOpts | Array of options for image handler (aka page number) |
Definition at line 239 of file ImageGalleryBase.php.
ImageGalleryBase::isEmpty | ( | ) |
isEmpty() returns true if the gallery contains no images
Definition at line 251 of file ImageGalleryBase.php.
|
staticprivate |
Definition at line 82 of file ImageGalleryBase.php.
References array(), and wfRunHooks().
Referenced by factory().
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 196 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 | Array of HTML attribute pairs |
Definition at line 284 of file ImageGalleryBase.php.
References $attribs.
ImageGalleryBase::setCaption | ( | $caption | ) |
Set the caption (as plain text)
string | $caption | Caption |
Definition at line 142 of file ImageGalleryBase.php.
ImageGalleryBase::setCaptionHtml | ( | $caption | ) |
Set the caption (as HTML)
string | $caption | Caption |
Definition at line 151 of file ImageGalleryBase.php.
ImageGalleryBase::setContextTitle | ( | $title | ) |
Set the contextual title.
Title | $title | Contextual title |
Definition at line 307 of file ImageGalleryBase.php.
References $title.
ImageGalleryBase::setHeights | ( | $num | ) |
Set how high each image will be, in pixels.
int | $num | Integer > 0; invalid numbers will be ignored |
Definition at line 183 of file ImageGalleryBase.php.
ImageGalleryBase::setHideBadImages | ( | $flag = true | ) |
Set bad image flag.
Definition at line 133 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 126 of file ImageGalleryBase.php.
References $parser.
ImageGalleryBase::setPerRow | ( | $num | ) |
Set how many images will be displayed per row.
int | $num | Integer >= 0; If perrow=0 the gallery layout will adapt to screensize invalid numbers will be rejected |
Reimplemented in PackedImageGallery.
Definition at line 161 of file ImageGalleryBase.php.
ImageGalleryBase::setShowBytes | ( | $f | ) |
Enable/Disable showing of the file size of an image in the gallery.
Enabled by default.
bool | $f | Set to false to disable. |
Definition at line 261 of file ImageGalleryBase.php.
References $f.
ImageGalleryBase::setShowFilename | ( | $f | ) |
Enable/Disable showing of the filename of an image in the gallery.
Enabled by default.
bool | $f | Set to false to disable. |
Definition at line 271 of file ImageGalleryBase.php.
References $f.
ImageGalleryBase::setWidths | ( | $num | ) |
Set how wide each image will be, in pixels.
int | $num | Integer > 0; invalid numbers will be ignored |
Definition at line 172 of file ImageGalleryBase.php.
|
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 |
Definition at line 205 of file ImageGalleryBase.php.
References wfDeprecated().
Contextual title, used when images are being screened against the bad image list.
Definition at line 52 of file ImageGalleryBase.php.
Definition at line 54 of file ImageGalleryBase.php.
bool string ImageGalleryBase::$mCaption = false |
bool ImageGalleryBase::$mHideBadImages |
Hide blacklisted images?
Definition at line 43 of file ImageGalleryBase.php.
array ImageGalleryBase::$mImages |
Gallery images *.
Definition at line 31 of file ImageGalleryBase.php.
string ImageGalleryBase::$mMode |
|
staticprivate |
Definition at line 57 of file ImageGalleryBase.php.
Parser ImageGalleryBase::$mParser |
Registered parser object for output callbacks.
Definition at line 47 of file ImageGalleryBase.php.
bool ImageGalleryBase::$mShowBytes |
Whether to show the filesize in bytes in categories *.
Definition at line 33 of file ImageGalleryBase.php.
bool ImageGalleryBase::$mShowFilename |