var $mCaption = false;
/**
- * Hide blacklisted images?
+ * @var bool Hide blacklisted images?
*/
var $mHideBadImages;
/**
- * Registered parser object for output callbacks
- * @var Parser
+ * @var Parser Registered parser object for output callbacks
*/
var $mParser;
/**
- * Contextual title, used when images are being screened
- * against the bad image list
+ * @var Title Contextual title, used when images are being screened against
+ * the bad image list
*/
protected $contextTitle = false;
+ /** @var array */
protected $mAttribs = array();
+ /** @var bool */
static private $modeMapping = false;
/**
* Get a new image gallery. This is the method other callers
* should use to get a gallery.
*
- * @param String|bool $mode Mode to use. False to use the default.
+ * @param string|bool $mode Mode to use. False to use the default.
+ * @throws MWException
*/
static function factory( $mode = false ) {
global $wgGalleryOptions, $wgContLang;
/**
* Set how many images will be displayed per row.
*
- * @param $num Integer >= 0; If perrow=0 the gallery layout will adapt to screensize
- * invalid numbers will be rejected
+ * @param int $num Integer >= 0; If perrow=0 the gallery layout will adapt
+ * to screensize invalid numbers will be rejected
*/
public function setPerRow( $num ) {
if ( $num >= 0 ) {
/**
* Set how wide each image will be, in pixels.
*
- * @param $num Integer > 0; invalid numbers will be ignored
+ * @param int $num Integer > 0; invalid numbers will be ignored
*/
public function setWidths( $num ) {
if ( $num > 0 ) {
/**
* Set how high each image will be, in pixels.
*
- * @param $num Integer > 0; invalid numbers will be ignored
+ * @param int $num Integer > 0; invalid numbers will be ignored
*/
public function setHeights( $num ) {
if ( $num > 0 ) {
* to allow extensions to add additional parameters to
* <gallery> parser tag.
*
- * @param Array $options Attributes of gallery tag.
+ * @param array $options Attributes of gallery tag.
*/
public function setAdditionalOptions( $options ) {
}
/**
* Instruct the class to use a specific skin for rendering
*
- * @param $skin Skin object
+ * @param Skin $skin
* @deprecated since 1.18 Not used anymore
*/
function useSkin( $skin ) {
/**
* Add an image to the gallery.
*
- * @param $title Title object of the image that is added to the gallery
- * @param $html String: Additional HTML text to be shown. The name and
- * size of the image are always shown.
- * @param $alt String: Alt text for the image
- * @param $link String: Override image link (optional)
- * @param $handlerOpts Array: Array of options for image handler (aka page number)
+ * @param Title $title Title object of the image that is added to the gallery
+ * @param string $html Additional HTML text to be shown. The name and size
+ * of the image are always shown.
+ * @param string $alt Alt text for the image
+ * @param string $link Override image link (optional)
+ * @param array $handlerOpts Array of options for image handler (aka page number)
*/
function add( $title, $html = '', $alt = '', $link = '', $handlerOpts = array() ) {
if ( $title instanceof File ) {
/**
* Add an image at the beginning of the gallery.
*
- * @param $title Title object of the image that is added to the gallery
- * @param $html String: Additional HTML text to be shown. The name and
- * size of the image are always shown.
- * @param $alt String: Alt text for the image
- * @param $link String: Override image link (optional)
- * @param $handlerOpts Array: Array of options for image handler (aka page number)
+ * @param Title $title Title object of the image that is added to the gallery
+ * @param string $html Additional HTML text to be shown. The name and size
+ * of the image are always shown.
+ * @param string $alt Alt text for the image
+ * @param string $link Override image link (optional)
+ * @param array $handlerOpts Array of options for image handler (aka page number)
*/
function insert( $title, $html = '', $alt = '', $link = '', $handlerOpts = array() ) {
if ( $title instanceof File ) {
* Enable/Disable showing of the file size of an image in the gallery.
* Enabled by default.
*
- * @param $f Boolean: set to false to disable.
+ * @param bool $f Set to false to disable.
*/
function setShowBytes( $f ) {
$this->mShowBytes = (bool)$f;
* Enable/Disable showing of the filename of an image in the gallery.
* Enabled by default.
*
- * @param $f Boolean: set to false to disable.
+ * @param bool $f Set to false to disable.
*/
function setShowFilename( $f ) {
$this->mShowFilename = (bool)$f;
* Note -- if taking from user input, you should probably run through
* Sanitizer::validateAttributes() first.
*
- * @param array $attribs of HTML attribute pairs
+ * @param array $attribs Array of HTML attribute pairs
*/
function setAttributes( $attribs ) {
$this->mAttribs = $attribs;
/**
* Display an html representation of the gallery
*
- * @return String The html
+ * @return string The html
*/
abstract public function toHTML();
/**
- * @return Integer: number of images in the gallery
+ * @return int Number of images in the gallery
*/
public function count() {
return count( $this->mImages );
/**
* Set the contextual title
*
- * @param $title Title: contextual title
+ * @param Title $title Contextual title
*/
public function setContextTitle( $title ) {
$this->contextTitle = $title;
/**
* Get the contextual title, if applicable
*
- * @return mixed Title or false
+ * @return Title|bool Title or false
*/
public function getContextTitle() {
return is_object( $this->contextTitle ) && $this->contextTitle instanceof Title
/**
* Determines the correct language to be used for this image gallery
- * @return Language object
+ * @return Language
*/
protected function getRenderLang() {
return $this->mParser
/**
* Add the wrapper html around the thumb's caption
*
- * @param String $galleryText The caption
- * @param MediaTransformOutput|boolean $thumb The thumb this caption is for
+ * @param string $galleryText The caption
+ * @param MediaTransformOutput|bool $thumb The thumb this caption is for
* or false for bad image.
+ * @return string
*/
protected function wrapGalleryText( $galleryText, $thumb ) {
# ATTENTION: The newline after <div class="gallerytext"> is needed to
/**
* Get total padding.
*
- * @return int How many pixels of whitespace surround the thumbnail.
+ * @return int Number of pixels of whitespace surrounding the thumbnail.
*/
protected function getAllPadding() {
return $this->getThumbPadding() + $this->getGBPadding() + $this->getGBBorders();
*
* @param int $boxHeight How high we want the box to be.
* @param int $thumbHeight How high the thumbnail is.
- * @return int How many vertical padding to add on each side.
+ * @return int Vertical padding to add on each side.
*/
protected function getVPad( $boxHeight, $thumbHeight ) {
return ( $this->getThumbPadding() + $boxHeight - $thumbHeight ) / 2;
* Get the transform parameters for a thumbnail.
*
* @param File $img The file in question. May be false for invalid image
+ * @return array
*/
protected function getThumbParams( $img ) {
return array(
* plus padding on gallerybox.
*
* @note Important: parameter will be false if no thumb used.
- * @param Mixed $thumb MediaTransformObject object or false.
- * @return int width of gallerybox element
+ * @param MediaTransformOutput|bool $thumb MediaTransformObject object or false.
+ * @return int Width of gallerybox element
*/
protected function getGBWidth( $thumb ) {
return $this->mWidths + $this->getThumbPadding() + $this->getGBPadding();
*
* Primarily intended for subclasses.
*
- * @return Array modules to include
+ * @return array Modules to include
*/
protected function getModules() {
return array();
*
* Used by a subclass to insert extra high resolution images.
* @param MediaTransformOutput $thumb The thumbnail
- * @param Array $imageParameters Array of options
+ * @param array $imageParameters Array of options
*/
protected function adjustImageParameters( $thumb, &$imageParameters ) {
}