MediaWiki  1.23.15
ImagePage Class Reference

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

Inheritance diagram for ImagePage:
Collaboration diagram for ImagePage:

Public Member Functions

 delete ()
 Delete the file, or an earlier version of it. More...
 
 getContentObject ()
 Overloading Article's getContentObject method. More...
 
 getDisplayedFile ()
 
 getImageLimitsFromOption ( $user, $optionName)
 Returns the corresponding $wgImageLimits entry for the selected user option. More...
 
 getUploadUrl ()
 
 render ()
 Handler for action=render Include body text only; none of the image extras. More...
 
 setFile ( $file)
 
 showError ( $description)
 Display an error with a wikitext description. More...
 
 view ()
 This is the default action of the index.php entry point: just view the page of the given title. More...
 
- Public Member Functions inherited from Article
 __call ( $fname, $args)
 Use PHP's magic __call handler to transform instance calls to WikiPage functions for backwards compatibility. More...
 
 __construct (Title $title, $oldId=null)
 Constructor and clear the article. More...
 
 __get ( $fname)
 Use PHP's magic __get handler to handle accessing of raw WikiPage fields for backwards compatibility. More...
 
 __set ( $fname, $fvalue)
 Use PHP's magic __set handler to handle setting of raw WikiPage fields for backwards compatibility. More...
 
 adjustDisplayTitle (ParserOutput $pOutput)
 Adjust title for pages with displaytitle, -{T|}- or language conversion. More...
 
 clear ()
 Clear the object. More...
 
 commitRollback ( $fromP, $summary, $bot, &$resultDetails, User $guser=null)
 
 confirmDelete ( $reason)
 Output deletion confirmation dialog. More...
 
 doDelete ( $reason, $suppress=false)
 Perform a deletion and output success or failure messages. More...
 
 doDeleteArticle ( $reason, $suppress=false, $id=0, $commit=true, &$error='')
 
 doRollback ( $fromP, $summary, $token, $bot, &$resultDetails, User $user=null)
 
 doUpdateRestrictions (array $limit, array $expiry, &$cascade, $reason, User $user)
 
 fetchContent ()
 Get text of an article from database Does NOT follow redirects. More...
 
 generateReason (&$hasHistory)
 
 getContent ()
 Note that getContent/loadContent do not follow redirects anymore. More...
 
 getContext ()
 Gets the context this Article is executed in. More...
 
 getOldID ()
 
 getOldIDFromRequest ()
 Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect. More...
 
 getPage ()
 Get the WikiPage object of this instance. More...
 
 getParserOptions ()
 Get parser options suitable for rendering the primary article wikitext. More...
 
 getParserOutput ( $oldid=null, User $user=null)
 #- More...
 
 getRevIdFetched ()
 Use this to fetch the rev ID used on page views. More...
 
 getRevisionFetched ()
 Get the fetched Revision object depending on request parameters or null on failure. More...
 
 getRobotPolicy ( $action, $pOutput=null)
 Get the robot policy to be used for the current view. More...
 
 getTitle ()
 Get the title object of the article. More...
 
 info ()
 Info about this page. More...
 
 isCurrent ()
 Returns true if the currently-referenced revision is the current edit to this page (and it exists). More...
 
 isFileCacheable ()
 Check if the page can be cached. More...
 
 loadContent ()
 Load the revision (including text) into this object. More...
 
 protect ()
 action=protect handler More...
 
 purge ()
 Handle action=purge. More...
 
 revert ()
 Handle action=revert. More...
 
 rollback ()
 Handle action=rollback. More...
 
 setContext ( $context)
 Sets the context this Article is executed in. More...
 
 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 -> More...
 
 setParserOptions (ParserOptions $options)
 Override the ParserOptions used to render the primary article wikitext. More...
 
 setRedirectedFrom (Title $from)
 Tell the page view functions that this view was redirected from another page on the wiki. More...
 
 showDeletedRevisionHeader ()
 If the revision requested for view is deleted, check permissions. More...
 
 showDiffPage ()
 Show a diff page according to current request variables. More...
 
 showMissingArticle ()
 Show the error text for a missing article. More...
 
 showNamespaceHeader ()
 Show a header specific to the namespace currently being viewed, like [[MediaWiki:Talkpagetext]]. More...
 
 showPatrolFooter ()
 If patrol is possible, output a patrol UI box. More...
 
 showRedirectedFromHeader ()
 If this request is a redirect view, send "redirected from" subtitle to the output. More...
 
 showViewFooter ()
 Show the footer section of an ordinary page view. More...
 
 unprotect ()
 action=unprotect handler (alias) More...
 
 updateRestrictions ( $limit=array(), $reason='', &$cascade=0, $expiry=array())
 
 viewRedirect ( $target, $appendSubtitle=true, $forceKnown=false)
 View redirect. More...
 

Static Public Member Functions

static newFromID ( $id)
 Constructor from a page id. More...
 
- Static Public Member Functions inherited from Article
static formatRobotPolicy ( $policy)
 Converts a String robot policy into an associative array, to allow merging of several policies using array_merge(). More...
 
static getAutosummary ( $oldtext, $newtext, $flags)
 
static newFromTitle ( $title, IContextSource $context)
 Create an Article object of the appropriate class for the given page. More...
 
static newFromWikiPage (WikiPage $page, IContextSource $context)
 Create an Article object of the appropriate class for the given page. More...
 
static onArticleCreate ( $title)
 
static onArticleDelete ( $title)
 
static onArticleEdit ( $title)
 
static selectFields ()
 

Public Attributes

 $mExtraDescription = false
 
- Public Attributes inherited from Article
ParserOptions $mParserOptions
 ParserOptions object for $wgUser articles $mParserOptions. More...
 
string $mContent
 Text of the revision we are working on $mContent. More...
 
Content $mContentObject
 Content of the revision we are working on. More...
 
bool $mContentLoaded = false
 Is the content ($mContent) already loaded? $mContentLoaded. More...
 
int null $mOldId
 The oldid of the article that is to be shown, 0 for the current revision $mOldId. More...
 
Title $mRedirectedFrom = null
 Title from which we were redirected here $mRedirectedFrom. More...
 
string false $mRedirectUrl = false
 URL to redirect to or false if none $mRedirectUrl. More...
 
int $mRevIdFetched = 0
 Revision ID of revision we are working on $mRevIdFetched. More...
 
Revision $mRevision = null
 Revision we are working on $mRevision. More...
 
ParserOutput $mParserOutput
 ParserOutput object $mParserOutput. More...
 

Protected Member Functions

 closeShowImage ()
 
 compare ( $a, $b)
 Callback for usort() to do link sorts by (namespace, title) Function copied from Title::compare() More...
 
 doRenderLangOpt (array $langChoices, $curLang, $defaultLang)
 Output a drop-down box for language options for the file. More...
 
 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. More...
 
 imageLinks ()
 
 loadFile ()
 
 makeMetadataTable ( $metadata)
 Make a table with metadata to be shown in the output page. More...
 
 newPage (Title $title)
 
 openShowImage ()
 
 printSharedImageText ()
 Show a notice that the file is from a shared repository. More...
 
 queryImageLinks ( $target, $limit)
 
 showTOC ( $metadata)
 Create the TOC. More...
 
 uploadLinksBox ()
 Print out the various links at the bottom of the image page, e.g. More...
 
- Protected Member Functions inherited from Article
 fetchContentObject ()
 Get text content object Does NOT follow redirects. More...
 
 showCssOrJsPage ( $showCacheHint=true)
 Show a page view for a page formatted as CSS or JavaScript. More...
 
 tryFileCache ()
 checkLastModified returns true if it has taken care of all output to the client that is necessary for this request. More...
 

Private Member Functions

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

Private Attributes

File $displayImg
 
 $fileLoaded
 
FileRepo $repo
 

Additional Inherited Members

- Protected Attributes inherited from Article
IContextSource $mContext
 The context this Article is executed in $mContext. More...
 
WikiPage $mPage
 The WikiPage object of this instance $mPage. More...
 

Detailed Description

Class for viewing MediaWiki file description pages.

Definition at line 28 of file ImagePage.php.

Member Function Documentation

◆ closeShowImage()

ImagePage::closeShowImage ( )
protected

Definition at line 703 of file ImagePage.php.

Referenced by view().

◆ compare()

ImagePage::compare (   $a,
  $b 
)
protected

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

Parameters
$aobject page to compare with
$bobject page to compare with
Returns
Integer: result of string comparison, or namespace comparison

Definition at line 932 of file ImagePage.php.

◆ delete()

ImagePage::delete ( )

Delete the file, or an earlier version of it.

Reimplemented from Article.

Definition at line 898 of file ImagePage.php.

References $file.

◆ doRenderLangOpt()

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 976 of file ImagePage.php.

References $name, array(), as, Language\fetchLanguageName(), Article\getContext(), Article\getTitle(), global, Html\hidden(), Xml\option(), Html\rawElement(), Xml\submitButton(), text, wfBCP47(), and wfMessage().

Referenced by openShowImage().

◆ getContentObject()

ImagePage::getContentObject ( )

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 283 of file ImagePage.php.

References loadFile().

◆ getDisplayedFile()

ImagePage::getDisplayedFile ( )
Returns
File

Definition at line 220 of file ImagePage.php.

References $displayImg, and loadFile().

◆ getImageLimitsFromOption()

ImagePage::getImageLimitsFromOption (   $user,
  $optionName 
)

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

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

Definition at line 948 of file ImagePage.php.

References $user, array(), User\getDefaultOption(), and global.

Referenced by openShowImage().

◆ getUploadUrl()

ImagePage::getUploadUrl ( )

Definition at line 663 of file ImagePage.php.

References array(), SpecialPage\getTitleFor(), and loadFile().

Referenced by uploadLinksBox().

◆ imageDupes()

ImagePage::imageDupes ( )
protected

◆ imageHistory()

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 709 of file ImagePage.php.

References $out, Article\getContext(), loadFile(), and uploadLinksBox().

Referenced by view().

◆ imageLinks()

◆ loadFile()

◆ makeMetadataTable()

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 254 of file ImagePage.php.

References $type, as, Sanitizer\escapeId(), and wfMessage().

Referenced by view().

◆ makeSizeLink()

ImagePage::makeSizeLink (   $params,
  $width,
  $height 
)
private

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

Parameters
array$paramsScaler parameters
$widthint
$heightint
Returns
string

Definition at line 616 of file ImagePage.php.

References $params, array(), Html\rawElement(), and wfMessage().

Referenced by openShowImage().

◆ newFromID()

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 54 of file ImagePage.php.

References $t, and Title\newFromID().

◆ newPage()

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

Reimplemented from Article.

Definition at line 44 of file ImagePage.php.

References $title.

◆ openShowImage()

◆ printSharedImageText()

ImagePage::printSharedImageText ( )
protected

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

Definition at line 635 of file ImagePage.php.

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

Referenced by openShowImage().

◆ queryImageLinks()

ImagePage::queryImageLinks (   $target,
  $limit 
)
protected
Parameters
$target
$limit
Returns
ResultWrapper

Definition at line 730 of file ImagePage.php.

References $dbr, $limit, array(), DB_SLAVE, and wfGetDB().

Referenced by imageLinks().

◆ render()

ImagePage::render ( )

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

Reimplemented from Article.

Definition at line 96 of file ImagePage.php.

References Article\getContext(), and view().

◆ setFile()

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

Definition at line 65 of file ImagePage.php.

References $file.

◆ showError()

ImagePage::showError (   $description)

Display an error with a wikitext description.

Parameters
$descriptionString

Definition at line 915 of file ImagePage.php.

References $out, Article\getContext(), and wfMessage().

◆ showTOC()

ImagePage::showTOC (   $metadata)
protected

Create the TOC.

Parameters
$metadataBoolean: whether or not to show the metadata link
Returns
String

Definition at line 231 of file ImagePage.php.

References array(), wfMessage(), and wfRunHooks().

Referenced by view().

◆ uploadLinksBox()

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 676 of file ImagePage.php.

References $out, Article\getContext(), Article\getTitle(), getUploadUrl(), global, loadFile(), Linker\makeExternalLink(), text, and wfMessage().

Referenced by imageHistory().

◆ view()

ImagePage::view ( )

Member Data Documentation

◆ $displayImg

File ImagePage::$displayImg
private

Definition at line 32 of file ImagePage.php.

Referenced by getDisplayedFile().

◆ $fileLoaded

ImagePage::$fileLoaded
private

Definition at line 36 of file ImagePage.php.

◆ $mExtraDescription

ImagePage::$mExtraDescription = false

Definition at line 38 of file ImagePage.php.

◆ $repo

FileRepo ImagePage::$repo
private

Definition at line 35 of file ImagePage.php.

Referenced by printSharedImageText().


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