MediaWiki master
MediaWiki\Page\ImagePage Class Reference

Rendering of file description pages. More...

Inherits MediaWiki\Page\Article.

Collaboration diagram for MediaWiki\Page\ImagePage:

Public Member Functions

 getDisplayedFile ()
 
 getDuplicates ()
 
 getFile ()
 
 getForeignCategories ()
 
 getUploadUrl ()
 
 isLocal ()
 
 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.
 
- Public Member Functions inherited from MediaWiki\Page\Article
 __construct (Title $title, $oldId=null)
 
 addHelpLink ( $to, $overrideBaseUrl=false)
 Adds help link with an icon via page indicators.
 
 adjustDisplayTitle (ParserOutput $pOutput)
 Adjust title for pages with displaytitle, -{T|}- or language conversion.
 
 clear ()
 
 fetchRevisionRecord ()
 Fetches the revision to work on.
 
 getActionOverrides ()
 Call to WikiPage function for backwards compatibility.
 
 getContext ()
 Gets the context this Article is executed in.
 
 getOldID ()
 
 getOldIDFromRequest ()
 Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect.
 
 getPage ()
 Get the WikiPage object of this instance.
 
 getParserOptions ()
 Get parser options suitable for rendering the primary article wikitext.
 
 getParserOutput ( $oldid=null, ?UserIdentity $user=null)
 Lightweight method to get the parser output for a page, checking the parser cache and so on.
 
 getRedirectedFrom ()
 Get the page this view was redirected from.
 
 getRevIdFetched ()
 Use this to fetch the rev ID used on page views.
 
 getRobotPolicy ( $action, ?ParserOutput $pOutput=null)
 Get the robot policy to be used for the current view.
 
 getTitle ()
 Get the title object of the article.
 
 isCurrent ()
 Returns true if the currently-referenced revision is the current edit to this page (and it exists).
 
 isFileCacheable ( $mode=HTMLFileCache::MODE_NORMAL)
 Check if the page can be cached.
 
 protect ()
 action=protect handler
 
 render ()
 Handle action=render.
 
 setContext ( $context)
 Sets the context this Article is executed in.
 
 setOldSubtitle ( $oldid=0)
 Generate the navigation links when browsing through an article revisions It shows the information as: Revision as of \<date\>; view current revision \<- Previous version | Next Version -\>
 
 setRedirectedFrom (Title $from)
 Tell the page view functions that this view was redirected from another page on the wiki.
 
 showDeletedRevisionHeader ()
 If the revision requested for view is deleted, check permissions.
 
 showMissingArticle ()
 Show the error text for a missing article.
 
 showNamespaceHeader ()
 Show a header specific to the namespace currently being viewed, like [[MediaWiki:Talkpagetext]].
 
 showPatrolFooter ()
 If patrol is possible, output a patrol UI box.
 
 showProtectionIndicator ()
 Show a lock icon above the article body if the page is protected.
 
 showRedirectedFromHeader ()
 If this request is a redirect view, send "redirected from" subtitle to the output.
 
 showViewFooter ()
 Show the footer section of an ordinary page view.
 
 unprotect ()
 action=unprotect handler (alias)
 

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, $renderLang)
 Output a drop-down box for language options for the file.
 
 getThumbPrevText ( $params, $sizeLinkBigImagePreview)
 Make the text under the image to say what size preview.
 
 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.
 
 makeSizeLink ( $params, $width, $height)
 Creates a thumbnail of specified size and returns an HTML link to it.
 
 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 ()
 Add the re-upload link (or message about not being able to re-upload) to the output.
 
- Protected Member Functions inherited from MediaWiki\Page\Article
 isDiffOnlyView ()
 
 showDiffPage ()
 Show a diff page according to current request variables.
 
 tryFileCache ()
 checkLastModified returns true if it has taken care of all output to the client that is necessary for this request.
 

Protected Attributes

string false $mExtraDescription = false
 Guaranteed to be HTML, {.
 
- Protected Attributes inherited from MediaWiki\Page\Article
DatabaseBlockStore $blockStore
 
IConnectionProvider $dbProvider
 
LinkRenderer $linkRenderer
 
IContextSource null $mContext
 The context this Article is executed in.
 
WikiPage $mPage
 The WikiPage object of this instance.
 
RestrictionStore $restrictionStore
 
bool $viewIsRenderAction = false
 Whether render() was called.
 

Additional Inherited Members

- Static Public Member Functions inherited from MediaWiki\Page\Article
static formatRobotPolicy ( $policy)
 Converts a String robot policy into an associative array, to allow merging of several policies using array_merge().
 
static getRedirectHeaderHtml (Language $lang, Title $target, $forceKnown=false)
 Return the HTML for the top of a redirect page.
 
static newFromID ( $id)
 Constructor from a page id.
 
static newFromTitle ( $title, IContextSource $context)
 Create an Article object of the appropriate class for the given page.
 
static newFromWikiPage (WikiPage $page, IContextSource $context)
 Create an Article object of the appropriate class for the given page.
 
static purgePatrolFooterCache ( $articleID)
 Purge the cache used to check if it is worth showing the patrol footer For example, it is done during re-uploads when file patrol is used.
 
- Public Attributes inherited from MediaWiki\Page\Article
int null $mOldId
 The oldid of the article that was requested to be shown, 0 for the current revision.
 
ParserOutput null false $mParserOutput = null
 The ParserOutput generated for viewing the page, initialized by view().
 
Title null $mRedirectedFrom = null
 Title from which we were redirected here, if any.
 
string false $mRedirectUrl = false
 URL to redirect to or false if none.
 

Detailed Description

Rendering of file description pages.

@method WikiFilePage getPage()

Definition at line 45 of file ImagePage.php.

Member Function Documentation

◆ closeShowImage()

MediaWiki\Page\ImagePage::closeShowImage ( )
protected

For overloading.

Definition at line 855 of file ImagePage.php.

Referenced by MediaWiki\Page\ImagePage\view().

◆ compare()

MediaWiki\Page\ImagePage::compare ( $a,
$b )
protected

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

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

Definition at line 1083 of file ImagePage.php.

◆ doRenderLangOpt()

MediaWiki\Page\ImagePage::doRenderLangOpt ( array $langChoices,
$renderLang )
protected

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

Parameters
array$langChoicesArray of string language codes
string | null$renderLangLanguage code for the language we want the file to rendered in, it is pre-selected in the drop down box, use null to select the default case in the option list
Returns
string HTML to insert underneath image.

Definition at line 1096 of file ImagePage.php.

References MediaWiki\Html\element(), MediaWiki\Page\Article\getContext(), MediaWiki\Page\Article\getTitle(), and MediaWiki\MainConfigNames\Script.

Referenced by MediaWiki\Page\ImagePage\openShowImage().

◆ getDisplayedFile()

MediaWiki\Page\ImagePage::getDisplayedFile ( )
Returns
File

Definition at line 240 of file ImagePage.php.

References MediaWiki\Page\ImagePage\loadFile().

Referenced by MediaWiki\Page\ImageHistoryList\__construct().

◆ getDuplicates()

MediaWiki\Page\ImagePage::getDuplicates ( )
See also
WikiFilePage::getDuplicates
Returns
File[]|null

Definition at line 1212 of file ImagePage.php.

◆ getFile()

◆ getForeignCategories()

MediaWiki\Page\ImagePage::getForeignCategories ( )
See also
WikiFilePage::getForeignCategories
Returns
TitleArrayFromResult

Definition at line 1220 of file ImagePage.php.

◆ getThumbPrevText()

MediaWiki\Page\ImagePage::getThumbPrevText ( $params,
$sizeLinkBigImagePreview )
protected

Make the text under the image to say what size preview.

Parameters
array$paramsparameters for thumbnail
string$sizeLinkBigImagePreviewHTML for the current size
Returns
string HTML output

Definition at line 715 of file ImagePage.php.

References MediaWiki\Page\Article\getContext().

Referenced by MediaWiki\Page\ImagePage\openShowImage().

◆ getThumbSizes()

MediaWiki\Page\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
int[][] An array of [width, height] pairs.

Definition at line 1165 of file ImagePage.php.

References MediaWiki\Page\Article\getContext(), and MediaWiki\MainConfigNames\ImageLimits.

Referenced by MediaWiki\Page\ImagePage\openShowImage().

◆ getUploadUrl()

◆ imageDupes()

◆ imageHistory()

MediaWiki\Page\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 862 of file ImagePage.php.

References MediaWiki\Page\Article\getContext(), MediaWiki\Page\ImagePage\getFile(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Page\ImagePage\loadFile(), and MediaWiki\Page\ImagePage\uploadLinksBox().

Referenced by MediaWiki\Page\ImagePage\view().

◆ imageLinks()

MediaWiki\Page\ImagePage::imageLinks ( )
protected

◆ isLocal()

MediaWiki\Page\ImagePage::isLocal ( )
See also
WikiFilePage::isLocal
Returns
bool

Definition at line 1204 of file ImagePage.php.

Referenced by MediaWiki\Page\ImagePage\uploadLinksBox().

◆ loadFile()

◆ makeMetadataTable()

MediaWiki\Page\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 310 of file ImagePage.php.

References MediaWiki\Page\Article\getContext().

Referenced by MediaWiki\Page\ImagePage\view().

◆ makeSizeLink()

MediaWiki\Page\ImagePage::makeSizeLink ( $params,
$width,
$height )
protected

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

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

Definition at line 753 of file ImagePage.php.

Referenced by MediaWiki\Page\ImagePage\openShowImage().

◆ newPage()

MediaWiki\Page\ImagePage::newPage ( Title $title)
protected
Parameters
Title$title
Returns
WikiFilePage

Reimplemented from MediaWiki\Page\Article.

Definition at line 64 of file ImagePage.php.

◆ openShowImage()

◆ printSharedImageText()

MediaWiki\Page\ImagePage::printSharedImageText ( )
protected

◆ queryImageLinks()

MediaWiki\Page\ImagePage::queryImageLinks ( $target,
$limit )
protected
Parameters
string | string[]$target
int$limit
Returns
IResultWrapper

Definition at line 886 of file ImagePage.php.

Referenced by MediaWiki\Page\ImagePage\imageLinks().

◆ setFile()

MediaWiki\Page\ImagePage::setFile ( $file)
Parameters
File$file
Returns
void

Definition at line 73 of file ImagePage.php.

References MediaWiki\Page\Article\getPage().

◆ showError()

MediaWiki\Page\ImagePage::showError ( $description)

Display an error with a wikitext description.

Parameters
string$description

Definition at line 1066 of file ImagePage.php.

References MediaWiki\Page\Article\getContext().

◆ showTOC()

MediaWiki\Page\ImagePage::showTOC ( $metadata)
protected

Create the TOC.

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

Definition at line 251 of file ImagePage.php.

References MediaWiki\Page\Article\getContext().

Referenced by MediaWiki\Page\ImagePage\view().

◆ uploadLinksBox()

◆ view()

Member Data Documentation

◆ $mExtraDescription

string false MediaWiki\Page\ImagePage::$mExtraDescription = false
protected

Guaranteed to be HTML, {.

See also
File::getDescriptionText}

Definition at line 58 of file ImagePage.php.


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