Go to the documentation of this file.
75 static function factory( $mode =
false ) {
79 $mode = $wgGalleryOptions[
'mode'];
84 if ( isset( self::$modeMapping[$mode] ) ) {
85 return new self::$modeMapping[$mode]( $mode );
87 throw new MWException(
"No gallery class registered for mode $mode" );
92 if ( self::$modeMapping ===
false ) {
93 self::$modeMapping =
array(
94 'traditional' =>
'TraditionalImageGallery',
95 'nolines' =>
'NolinesImageGallery',
96 'packed' =>
'PackedImageGallery',
97 'packed-hover' =>
'PackedHoverImageGallery',
98 'packed-overlay' =>
'PackedOverlayImageGallery',
101 wfRunHooks(
'GalleryGetModes', self::$modeMapping );
113 $this->mImages =
array();
114 $this->mShowBytes = $wgGalleryOptions[
'showBytes'];
115 $this->mShowFilename =
true;
116 $this->mParser =
false;
117 $this->mHideBadImages =
false;
118 $this->mPerRow = $wgGalleryOptions[
'imagesPerRow'];
119 $this->mWidths = $wgGalleryOptions[
'imageWidth'];
120 $this->mHeights = $wgGalleryOptions[
'imageHeight'];
121 $this->mCaptionLength = $wgGalleryOptions[
'captionLength'];
122 $this->mMode = $mode;
143 $this->mHideBadImages = $flag;
152 $this->mCaption = htmlspecialchars( $caption );
161 $this->mCaption = $caption;
172 $this->mPerRow = (int)$num;
183 $this->mWidths = (int)$num;
194 $this->mHeights = (int)$num;
261 return empty( $this->mImages );
271 $this->mShowBytes = (bool)
$f;
281 $this->mShowFilename = (bool)
$f;
302 abstract public function toHTML();
308 return count( $this->mImages );
317 $this->contextTitle =
$title;
326 return is_object( $this->contextTitle ) && $this->contextTitle instanceof
Title
327 ? $this->contextTitle
336 return $this->mParser
337 ? $this->mParser->getTargetLanguage()
setShowBytes( $f)
Enable/Disable showing of the file size of an image in the gallery.
setParser( $parser)
Register a parser object.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
setHeights( $num)
Set how high each image will be, in pixels.
setContextTitle( $title)
Set the contextual title.
string $mMode
Gallery mode.
setWidths( $num)
Set how wide each image will be, in pixels.
setCaption( $caption)
Set the caption (as plain text)
getContextTitle()
Get the contextual title, if applicable.
setShowFilename( $f)
Enable/Disable showing of the filename of an image in the gallery.
bool string $mCaption
Gallery caption.
static factory( $mode=false)
Get a new image gallery.
setAdditionalOptions( $options)
Allow setting additional options.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
getLanguage()
Get the Language object.
setAttributes( $attribs)
Set arbitrary attributes to go on the HTML gallery output element.
Implements some public methods and some protected utility functions which are required by multiple ch...
setHideBadImages( $flag=true)
Set bad image flag.
setPerRow( $num)
Set how many images will be displayed per row.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
bool $mShowFilename
Whether to show the filename.
do that in ParserLimitReportFormat instead $parser
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
Title $contextTitle
Contextual title, used when images are being screened against the bad image list.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
insert( $title, $html='', $alt='', $link='', $handlerOpts=array())
Add an image at the beginning of the gallery.
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
presenting them properly to the user as errors is done by the caller $title
array $mImages
Gallery images *.
bool $mShowBytes
Whether to show the filesize in bytes in categories *.
__construct( $mode='traditional')
Create a new image gallery object.
setCaptionHtml( $caption)
Set the caption (as HTML)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned $skin
getRenderLang()
Determines the correct language to be used for this image gallery.
add( $title, $html='', $alt='', $link='', $handlerOpts=array())
Add an image to the gallery.
Represents a title within MediaWiki.
isEmpty()
isEmpty() returns true if the gallery contains no images
useSkin( $skin)
Instruct the class to use a specific skin for rendering.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
toHTML()
Display an html representation of the gallery.
bool $mHideBadImages
Hide blacklisted images?
Parser $mParser
Registered parser object for output callbacks.