MediaWiki  REL1_24
ImagePage Class Reference

Class for viewing MediaWiki file description pages. More...

Inheritance diagram for ImagePage:
Collaboration diagram for ImagePage:

List of all members.

Public Member Functions

 delete ()
 Delete the file, or an earlier version of it.
 getContentObject ()
 Overloading Article's getContentObject method.
 getDisplayedFile ()
 getImageLimitsFromOption ($user, $optionName)
 Returns the corresponding $wgImageLimits entry for the selected user option.
 getUploadUrl ()
 render ()
 Handler for action=render Include body text only; none of the image extras.
 setFile ($file)
 showError ($description)
 Display an error with a wikitext description.
 view ()
 This is the default action of the index.php entry point: just view the page of the given title.

Static Public Member Functions

static newFromID ($id)
 Constructor from a page id.

Protected Member Functions

 closeShowImage ()
 For overloading.
 compare ($a, $b)
 Callback for usort() to do link sorts by (namespace, title) Function copied from Title::compare()
 doRenderLangOpt (array $langChoices, $curLang, $defaultLang)
 Output a drop-down box for language options for the file.
 getDisplayWidthHeight ($maxWidth, $maxHeight, $width, $height)
 Get the width and height to display image at.
 getThumbSizes ($origWidth, $origHeight)
 Get alternative thumbnail sizes.
 imageDupes ()
 imageHistory ()
 If the page we've just displayed is in the "Image" namespace, we follow it with an upload history of the image and its usage.
 imageLinks ()
 loadFile ()
 makeMetadataTable ($metadata)
 Make a table with metadata to be shown in the output page.
 newPage (Title $title)
 openShowImage ()
 printSharedImageText ()
 Show a notice that the file is from a shared repository.
 queryImageLinks ($target, $limit)
 showTOC ($metadata)
 Create the TOC.
 uploadLinksBox ()
 Print out the various links at the bottom of the image page, e.g.

Protected Attributes

bool $mExtraDescription = false
 *

Private Member Functions

 makeSizeLink ($params, $width, $height)
 Creates an thumbnail of specified size and returns an HTML link to it.

Private Attributes

File $displayImg
 *
bool $fileLoaded
 *
FileRepo $repo
 *

Detailed Description

Class for viewing MediaWiki file description pages.

Definition at line 28 of file ImagePage.php.


Member Function Documentation

ImagePage::closeShowImage ( ) [protected]

For overloading.

Definition at line 708 of file ImagePage.php.

ImagePage::compare ( a,
b 
) [protected]

Callback for usort() to do link sorts by (namespace, title) Function copied from Title::compare()

Parameters:
object$aObject page to compare with
object$bObject page to compare with
Returns:
int Result of string comparison, or namespace comparison

Definition at line 944 of file ImagePage.php.

Delete the file, or an earlier version of it.

Reimplemented from Article.

Definition at line 910 of file ImagePage.php.

ImagePage::doRenderLangOpt ( array langChoices,
curLang,
defaultLang 
) [protected]

Output a drop-down box for language options for the file.

Parameters:
array$langChoicesArray of string language codes
string$curLangLanguage code file is being viewed in.
string$defaultLangLanguage code that image is rendered in by default
Returns:
string HTML to insert underneath image.

Definition at line 988 of file ImagePage.php.

Overloading Article's getContentObject method.

Omit noarticletext if sharedupload; text will be fetched from the shared upload server if possible.

Returns:
string

Reimplemented from Article.

Definition at line 285 of file ImagePage.php.

Returns:
File

Definition at line 223 of file ImagePage.php.

References loadFile().

Referenced by ImageHistoryList\__construct().

ImagePage::getDisplayWidthHeight ( maxWidth,
maxHeight,
width,
height 
) [protected]

Get the width and height to display image at.

Note:
This method assumes that it is only called if one of the dimensions are bigger than the max, or if the image is vectorized.
Parameters:
int$maxWidthMax width to display at
int$maxHeightMax height to display at
int$widthActual width of the image
int$heightActual height of the image
Exceptions:
MWException
Returns:
array Array (width, height)

Definition at line 1068 of file ImagePage.php.

ImagePage::getImageLimitsFromOption ( user,
optionName 
)

Returns the corresponding $wgImageLimits entry for the selected user option.

Parameters:
User$user
string$optionNameName of a option to check, typically imagesize or thumbsize
Returns:
array
Since:
1.21

Definition at line 960 of file ImagePage.php.

ImagePage::getThumbSizes ( origWidth,
origHeight 
) [protected]

Get alternative thumbnail sizes.

Note:
This will only list several alternatives if thumbnails are rendered on 404
Parameters:
int$origWidthActual width of image
int$origHeightActual height of image
Returns:
array An array of [width, height] pairs.

Definition at line 1104 of file ImagePage.php.

Definition at line 657 of file ImagePage.php.

ImagePage::imageDupes ( ) [protected]

Definition at line 875 of file ImagePage.php.

ImagePage::imageHistory ( ) [protected]

If the page we've just displayed is in the "Image" namespace, we follow it with an upload history of the image and its usage.

Definition at line 715 of file ImagePage.php.

ImagePage::imageLinks ( ) [protected]

Definition at line 748 of file ImagePage.php.

ImagePage::loadFile ( ) [protected]

Definition at line 68 of file ImagePage.php.

Referenced by getDisplayedFile(), and printSharedImageText().

ImagePage::makeMetadataTable ( metadata) [protected]

Make a table with metadata to be shown in the output page.

Todo:
FIXME: Bad interface, see note on MediaHandler::formatMetadata().
Parameters:
array$metadataThe array containing the Exif data
Returns:
string The metadata table. This is treated as Wikitext (!)

Definition at line 257 of file ImagePage.php.

ImagePage::makeSizeLink ( params,
width,
height 
) [private]

Creates an thumbnail of specified size and returns an HTML link to it.

Parameters:
array$paramsScaler parameters
int$width
int$height
Returns:
string

Definition at line 610 of file ImagePage.php.

static ImagePage::newFromID ( id) [static]

Constructor from a page id.

Parameters:
int$idArticle ID to load
Returns:
ImagePage|null

Reimplemented from Article.

Definition at line 51 of file ImagePage.php.

ImagePage::newPage ( Title title) [protected]
Parameters:
Title$title
Returns:
WikiFilePage

Reimplemented from Article.

Definition at line 41 of file ImagePage.php.

ImagePage::openShowImage ( ) [protected]

Definition at line 293 of file ImagePage.php.

Show a notice that the file is from a shared repository.

Definition at line 629 of file ImagePage.php.

References $out, $repo, array(), Article\getContext(), FileRepo\getDisplayName(), loadFile(), and wfMessage().

ImagePage::queryImageLinks ( target,
limit 
) [protected]
Parameters:
string$target
int$limit
Returns:
ResultWrapper

Definition at line 736 of file ImagePage.php.

Handler for action=render Include body text only; none of the image extras.

Reimplemented from Article.

Definition at line 93 of file ImagePage.php.

ImagePage::setFile ( file)
Parameters:
File$file
Returns:
void

Definition at line 62 of file ImagePage.php.

ImagePage::showError ( description)

Display an error with a wikitext description.

Parameters:
string$description

Definition at line 927 of file ImagePage.php.

ImagePage::showTOC ( metadata) [protected]

Create the TOC.

Parameters:
bool$metadataWhether or not to show the metadata link
Returns:
string

Definition at line 234 of file ImagePage.php.

ImagePage::uploadLinksBox ( ) [protected]

Print out the various links at the bottom of the image page, e.g.

reupload, external editing (and instructions link) etc.

Definition at line 670 of file ImagePage.php.

This is the default action of the index.php entry point: just view the page of the given title.

Reimplemented from Article.

Definition at line 98 of file ImagePage.php.


Member Data Documentation

File ImagePage::$displayImg [private]

*

Definition at line 29 of file ImagePage.php.

bool ImagePage::$fileLoaded [private]

*

Definition at line 33 of file ImagePage.php.

bool ImagePage::$mExtraDescription = false [protected]

*

Definition at line 35 of file ImagePage.php.

FileRepo ImagePage::$repo [private]

*

Definition at line 31 of file ImagePage.php.

Referenced by printSharedImageText().


The documentation for this class was generated from the following file: