MediaWiki
1.33.1
|
Class for viewing MediaWiki file description pages. More...
Public Member Functions | |
delete () | |
Delete the file, or an earlier version of it. More... | |
getDisplayedFile () | |
getDuplicates () | |
getEmptyPageParserOutput (ParserOptions $options) | |
Overloading Article's getEmptyPageParserOutput method. More... | |
getFile () | |
getForeignCategories () | |
getImageLimitsFromOption ( $user, $optionName) | |
Returns the corresponding $wgImageLimits entry for the selected user option. More... | |
getUploadUrl () | |
isLocal () | |
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 | |
__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... | |
addHelpLink ( $to, $overrideBaseUrl=false) | |
Adds help link with an icon via page indicators. More... | |
adjustDisplayTitle (ParserOutput $pOutput) | |
Adjust title for pages with displaytitle, -{T|}- or language conversion. More... | |
checkFlags ( $flags) | |
Call to WikiPage function for backwards compatibility. More... | |
checkTouched () | |
Call to WikiPage function for backwards compatibility. More... | |
clear () | |
Clear the object. More... | |
clearPreparedEdit () | |
Call to WikiPage function for backwards compatibility. More... | |
commitRollback ( $fromP, $summary, $bot, &$resultDetails, User $guser=null) | |
confirmDelete ( $reason) | |
Output deletion confirmation dialog. More... | |
doDelete ( $reason, $suppress=false, $immediate=false) | |
Perform a deletion and output success or failure messages. More... | |
doDeleteArticle ( $reason, $suppress=false, $u1=null, $u2=null, &$error='', $immediate=false) | |
doDeleteArticleReal ( $reason, $suppress=false, $u1=null, $u2=null, &$error='', User $user=null, $tags=[], $immediate=false) | |
Call to WikiPage function for backwards compatibility. More... | |
doDeleteUpdates ( $id, Content $content=null, $revision=null, User $user=null) | |
Call to WikiPage function for backwards compatibility. More... | |
doEditContent (Content $content, $summary, $flags=0, $originalRevId=false, User $user=null, $serialFormat=null) | |
Call to WikiPage function for backwards compatibility. More... | |
doEditUpdates (Revision $revision, User $user, array $options=[]) | |
Call to WikiPage function for backwards compatibility. More... | |
doPurge () | |
Call to WikiPage function for backwards compatibility. More... | |
doRollback ( $fromP, $summary, $token, $bot, &$resultDetails, User $user=null) | |
doUpdateRestrictions (array $limit, array $expiry, &$cascade, $reason, User $user) | |
doViewUpdates (User $user, $oldid=0) | |
Call to WikiPage function for backwards compatibility. More... | |
exists () | |
Call to WikiPage function for backwards compatibility. More... | |
followRedirect () | |
Call to WikiPage function for backwards compatibility. More... | |
generateReason (&$hasHistory) | |
getActionOverrides () | |
Call to WikiPage function for backwards compatibility. More... | |
getAutoDeleteReason (&$hasHistory) | |
Call to WikiPage function for backwards compatibility. More... | |
getCategories () | |
Call to WikiPage function for backwards compatibility. More... | |
getComment ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. More... | |
getContentHandler () | |
Call to WikiPage function for backwards compatibility. More... | |
getContentModel () | |
Call to WikiPage function for backwards compatibility. More... | |
getContext () | |
Gets the context this Article is executed in. More... | |
getContributors () | |
Call to WikiPage function for backwards compatibility. More... | |
getCreator ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. More... | |
getDeletionUpdates (Content $content=null) | |
Call to WikiPage function for backwards compatibility. More... | |
getHiddenCategories () | |
Call to WikiPage function for backwards compatibility. More... | |
getId () | |
Call to WikiPage function for backwards compatibility. More... | |
getLatest () | |
Call to WikiPage function for backwards compatibility. More... | |
getLinksTimestamp () | |
Call to WikiPage function for backwards compatibility. More... | |
getMinorEdit () | |
Call to WikiPage function for backwards compatibility. More... | |
getOldestRevision () | |
Call to WikiPage function for backwards compatibility. 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... | |
getRedirectedFrom () | |
Get the page this view was redirected from. More... | |
getRedirectTarget () | |
Call to WikiPage function for backwards compatibility. More... | |
getRedirectURL ( $rt) | |
Call to WikiPage function for backwards compatibility. More... | |
getRevIdFetched () | |
Use this to fetch the rev ID used on page views. More... | |
getRevision () | |
Call to WikiPage function for backwards compatibility. More... | |
getRevisionFetched () | |
Get the fetched Revision object depending on request parameters or null on failure. More... | |
getRobotPolicy ( $action, ParserOutput $pOutput=null) | |
Get the robot policy to be used for the current view. More... | |
getTimestamp () | |
Call to WikiPage function for backwards compatibility. More... | |
getTitle () | |
Get the title object of the article. More... | |
getTouched () | |
Call to WikiPage function for backwards compatibility. More... | |
getUndoContent (Revision $undo, Revision $undoafter=null) | |
Call to WikiPage function for backwards compatibility. More... | |
getUser ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. More... | |
getUserText ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. More... | |
hasViewableContent () | |
Call to WikiPage function for backwards compatibility. More... | |
insertOn ( $dbw, $pageId=null) | |
Call to WikiPage function for backwards compatibility. More... | |
insertProtectNullRevision ( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user=null) | |
Call to WikiPage function for backwards compatibility. More... | |
insertRedirect () | |
Call to WikiPage function for backwards compatibility. More... | |
insertRedirectEntry (Title $rt, $oldLatest=null) | |
Call to WikiPage function for backwards compatibility. More... | |
isCountable ( $editInfo=false) | |
Call to WikiPage function for backwards compatibility. More... | |
isCurrent () | |
Returns true if the currently-referenced revision is the current edit to this page (and it exists). More... | |
isFileCacheable ( $mode=HTMLFileCache::MODE_NORMAL) | |
Check if the page can be cached. More... | |
isRedirect () | |
Call to WikiPage function for backwards compatibility. More... | |
loadFromRow ( $data, $from) | |
Call to WikiPage function for backwards compatibility. More... | |
loadPageData ( $from='fromdb') | |
Call to WikiPage function for backwards compatibility. More... | |
lockAndGetLatest () | |
Call to WikiPage function for backwards compatibility. More... | |
makeParserOptions ( $context) | |
Call to WikiPage function for backwards compatibility. More... | |
pageDataFromId ( $dbr, $id, $options=[]) | |
Call to WikiPage function for backwards compatibility. More... | |
pageDataFromTitle ( $dbr, $title, $options=[]) | |
Call to WikiPage function for backwards compatibility. More... | |
prepareContentForEdit (Content $content, $revision=null, User $user=null, $serialFormat=null, $useCache=true) | |
Call to WikiPage function for backwards compatibility. More... | |
protect () | |
action=protect handler More... | |
protectDescription (array $limit, array $expiry) | |
Call to WikiPage function for backwards compatibility. More... | |
protectDescriptionLog (array $limit, array $expiry) | |
Call to WikiPage function for backwards compatibility. More... | |
render () | |
Handle action=render. More... | |
replaceSectionAtRev ( $sectionId, Content $sectionContent, $sectionTitle='', $baseRevId=null) | |
Call to WikiPage function for backwards compatibility. More... | |
replaceSectionContent ( $sectionId, Content $sectionContent, $sectionTitle='', $edittime=null) | |
Call to WikiPage function for backwards compatibility. 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... | |
setTimestamp ( $ts) | |
Call to WikiPage function for backwards compatibility. More... | |
shouldCheckParserCache (ParserOptions $parserOptions, $oldId) | |
Call to WikiPage function for backwards compatibility. More... | |
showDeletedRevisionHeader () | |
If the revision requested for view is deleted, check permissions. 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... | |
supportsSections () | |
Call to WikiPage function for backwards compatibility. More... | |
triggerOpportunisticLinksUpdate (ParserOutput $parserOutput) | |
Call to WikiPage function for backwards compatibility. More... | |
unprotect () | |
action=unprotect handler (alias) More... | |
updateCategoryCounts (array $added, array $deleted, $id=0) | |
Call to WikiPage function for backwards compatibility. More... | |
updateIfNewerOn ( $dbw, $revision) | |
Call to WikiPage function for backwards compatibility. More... | |
updateRedirectOn ( $dbw, $redirectTitle, $lastRevIsRedirect=null) | |
Call to WikiPage function for backwards compatibility. More... | |
updateRestrictions ( $limit=[], $reason='', &$cascade=0, $expiry=[]) | |
updateRevisionOn ( $dbw, $revision, $lastRevision=null, $lastRevIsRedirect=null) | |
Call to WikiPage function for backwards compatibility. More... | |
viewRedirect ( $target, $appendSubtitle=true, $forceKnown=false) | |
Return the HTML for the top of a redirect page. More... | |
Protected Member Functions | |
closeShowImage () | |
For overloading. More... | |
compare ( $a, $b) | |
Callback for usort() to do link sorts by (namespace, title) Function copied from Title::compare() More... | |
doRenderLangOpt (array $langChoices, $renderLang) | |
Output a drop-down box for language options for the file. More... | |
getDisplayWidthHeight ( $maxWidth, $maxHeight, $width, $height) | |
Get the width and height to display image at. More... | |
getThumbPrevText ( $params, $sizeLinkBigImagePreview) | |
Make the text under the image to say what size preview. More... | |
getThumbSizes ( $origWidth, $origHeight) | |
Get alternative thumbnail sizes. 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... | |
makeSizeLink ( $params, $width, $height) | |
Creates an thumbnail of specified size and returns an HTML link to it. 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... | |
fetchRevisionRecord () | |
Fetches the revision to work on. More... | |
getContentObject () | |
Returns a Content object representing the pages effective display content, not necessarily the revision's content! More... | |
showDiffPage () | |
Show a diff page according to current request variables. More... | |
tryFileCache () | |
checkLastModified returns true if it has taken care of all output to the client that is necessary for this request. More... | |
Protected Attributes | |
bool | $mExtraDescription = false |
WikiFilePage | $mPage |
Protected Attributes inherited from Article | |
IContextSource null | $mContext |
The context this Article is executed in. More... | |
WikiPage null | $mPage |
The WikiPage object of this instance. More... | |
bool | $viewIsRenderAction = false |
Whether render() was called. More... | |
Private Member Functions | |
createXmlOptionStringForLanguage ( $lang, $selected) | |
getLanguageForRendering (WebRequest $request, File $file) | |
Returns language code to be used for dispaying the image, based on request context and languages available in the file. More... | |
Private Attributes | |
File | $displayImg |
bool | $fileLoaded |
FileRepo | $repo |
Additional Inherited Members | |
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 | getRedirectHeaderHtml (Language $lang, $target, $forceKnown=false) |
Return the HTML for the top of a redirect page. More... | |
static | newFromID ( $id) |
Constructor from a page id. More... | |
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 | 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. More... | |
Public Attributes inherited from Article | |
bool | $mContentLoaded = false |
Is the target revision loaded? Set by fetchRevisionRecord(). More... | |
Content null | $mContentObject |
Content of the main slot of $this->mRevision. More... | |
int null | $mOldId |
The oldid of the article that was requested to be shown, 0 for the current revision. More... | |
ParserOptions null | $mParserOptions |
ParserOptions object for $wgUser articles. More... | |
ParserOutput null false | $mParserOutput = null |
The ParserOutput generated for viewing the page, initialized by view(). More... | |
Title null | $mRedirectedFrom = null |
Title from which we were redirected here, if any. More... | |
string bool | $mRedirectUrl = false |
URL to redirect to or false if none. More... | |
int | $mRevIdFetched = 0 |
Revision ID of revision that was loaded. More... | |
Revision null | $mRevision = null |
Revision to be shown. More... | |
Class for viewing MediaWiki file description pages.
Definition at line 31 of file ImagePage.php.
|
protected |
|
protected |
Callback for usort() to do link sorts by (namespace, title) Function copied from Title::compare()
object | $a | Object page to compare with |
object | $b | Object page to compare with |
Definition at line 1020 of file ImagePage.php.
|
private |
string | $lang | |
bool | $selected |
Definition at line 1104 of file ImagePage.php.
References $code, $lang, $name, LanguageCode\bcp47(), Language\fetchLanguageName(), Article\getContext(), and Xml\option().
Referenced by doRenderLangOpt().
ImagePage::delete | ( | ) |
Delete the file, or an earlier version of it.
Reimplemented from Article.
Definition at line 986 of file ImagePage.php.
References $file.
|
protected |
Output a drop-down box for language options for the file.
array | $langChoices | Array of string language codes |
string | $renderLang | Language code for the language we want the file to rendered in. |
Definition at line 1059 of file ImagePage.php.
References $lang, $wgScript, as, createXmlOptionStringForLanguage(), Article\getContext(), Article\getTitle(), Xml\option(), Xml\submitButton(), and text.
Referenced by openShowImage().
ImagePage::getDisplayedFile | ( | ) |
Definition at line 215 of file ImagePage.php.
References $displayImg, and loadFile().
Referenced by ImageHistoryList\__construct().
|
protected |
Get the width and height to display image at.
int | $maxWidth | Max width to display at |
int | $maxHeight | Max height to display at |
int | $width | Actual width of the image |
int | $height | Actual height of the image |
MWException |
Definition at line 1134 of file ImagePage.php.
Referenced by openShowImage().
ImagePage::getDuplicates | ( | ) |
Definition at line 1216 of file ImagePage.php.
ImagePage::getEmptyPageParserOutput | ( | ParserOptions | $options | ) |
Overloading Article's getEmptyPageParserOutput method.
Omit noarticletext if sharedupload; text will be fetched from the shared upload server if possible.
ParserOptions | $options |
Reimplemented from Article.
Definition at line 283 of file ImagePage.php.
References $options, Article\getId(), and loadFile().
ImagePage::getFile | ( | ) |
ImagePage::getForeignCategories | ( | ) |
Definition at line 1224 of file ImagePage.php.
ImagePage::getImageLimitsFromOption | ( | $user, | |
$optionName | |||
) |
Returns the corresponding $wgImageLimits entry for the selected user option.
User | $user | |
string | $optionName | Name of a option to check, typically imagesize or thumbsize |
Definition at line 1033 of file ImagePage.php.
References $user, $wgImageLimits, and User\getDefaultOption().
Referenced by getThumbSizes(), and openShowImage().
|
private |
Returns language code to be used for dispaying the image, based on request context and languages available in the file.
WebRequest | $request | |
File | $file |
Definition at line 299 of file ImagePage.php.
References $file, $handler, and $request.
Referenced by openShowImage().
|
protected |
Make the text under the image to say what size preview.
array | $params | parameters for thumbnail |
string | $sizeLinkBigImagePreview | HTML for the current size |
Definition at line 638 of file ImagePage.php.
References $params, Article\getContext(), and list.
Referenced by openShowImage().
|
protected |
Get alternative thumbnail sizes.
int | $origWidth | Actual width of image |
int | $origHeight | Actual height of image |
Definition at line 1170 of file ImagePage.php.
References $wgImageLimits, Article\getContext(), getImageLimitsFromOption(), and Article\getUser().
Referenced by openShowImage().
ImagePage::getUploadUrl | ( | ) |
Definition at line 728 of file ImagePage.php.
References SpecialPage\getTitleFor(), and loadFile().
Referenced by uploadLinksBox().
|
protected |
Definition at line 948 of file ImagePage.php.
References $file, $link, $out, as, captcha-old\count, Article\getContext(), Article\getTitle(), Linker\linkKnown(), loadFile(), and Linker\makeExternalLink().
Referenced by view().
|
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 786 of file ImagePage.php.
References $out, Article\getContext(), loadFile(), and uploadLinksBox().
Referenced by view().
|
protected |
Definition at line 819 of file ImagePage.php.
References $link, $out, $query, $res, $rows, $ul, as, captcha-old\count, Article\getContext(), Article\getTitle(), Linker\linkKnown(), Title\makeTitle(), NS_FILE, object, and queryImageLinks().
Referenced by view().
ImagePage::isLocal | ( | ) |
|
protected |
Definition at line 68 of file ImagePage.php.
References Article\getTitle(), Hooks\run(), wfFindFile(), and wfLocalFile().
Referenced by getDisplayedFile(), getEmptyPageParserOutput(), getUploadUrl(), imageDupes(), imageHistory(), openShowImage(), printSharedImageText(), uploadLinksBox(), and view().
|
protected |
Make a table with metadata to be shown in the output page.
array | $metadata | The array containing the Exif data |
Definition at line 252 of file ImagePage.php.
References $type, as, and Article\getContext().
Referenced by view().
|
protected |
Creates an thumbnail of specified size and returns an HTML link to it.
array | $params | Scaler parameters |
int | $width | |
int | $height |
Definition at line 676 of file ImagePage.php.
References $params, and Article\getContext().
Referenced by openShowImage().
|
protected |
Title | $title |
Reimplemented from Article.
Definition at line 53 of file ImagePage.php.
References $title.
|
protected |
Definition at line 314 of file ImagePage.php.
References $dbr, $ext, $handler, $lang, $link, $options, $out, $output, $params, $request, $user, $wgEnableUploads, $wgScript, $wgSend404Code, $wgSVGMaxSize, as, Xml\closeElement(), captcha-old\count, DB_REPLICA, doRenderLangOpt(), Article\getContext(), getDisplayWidthHeight(), Article\getId(), getImageLimitsFromOption(), getLanguageForRendering(), getThumbPrevText(), getThumbSizes(), Article\getTitle(), SpecialPage\getTitleFor(), Linker\linkKnown(), list, loadFile(), makeSizeLink(), Linker\makeThumbLinkObj(), Xml\openElement(), Xml\option(), printSharedImageText(), Linker\processResponsiveImages(), Hooks\run(), LogEventsList\showLogExtract(), Xml\submitButton(), Xml\tags(), text, wfEscapeWikiText(), wfGetDB(), and wfMessageFallback().
Referenced by view().
|
protected |
Show a notice that the file is from a shared repository.
Definition at line 695 of file ImagePage.php.
References $out, $repo, Article\getContext(), FileRepo\getDisplayName(), loadFile(), and plain.
Referenced by openShowImage().
|
protected |
string | $target | |
int | $limit |
Definition at line 807 of file ImagePage.php.
References $dbr, DB_REPLICA, and wfGetDB().
Referenced by imageLinks().
ImagePage::setFile | ( | $file | ) |
ImagePage::showError | ( | $description | ) |
Display an error with a wikitext description.
string | $description |
Definition at line 1003 of file ImagePage.php.
References $out, and Article\getContext().
|
protected |
Create the TOC.
bool | $metadata | Whether or not to show the metadata link |
Definition at line 226 of file ImagePage.php.
References Article\getContext(), and Hooks\run().
Referenced by view().
|
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 741 of file ImagePage.php.
References $out, $wgEnableUploads, Article\getContext(), Article\getTitle(), getUploadUrl(), Article\getUser(), loadFile(), Linker\makeExternalLink(), and text.
Referenced by imageHistory().
ImagePage::view | ( | ) |
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 90 of file ImagePage.php.
References $css, $html, $out, $request, $wgShowEXIF, Xml\closeElement(), closeShowImage(), Xml\element(), Article\getContext(), Article\getOldID(), Article\getTitle(), Article\getUser(), imageDupes(), imageHistory(), imageLinks(), loadFile(), makeMetadataTable(), NS_FILE, null, Xml\openElement(), openShowImage(), Hooks\run(), showTOC(), text, and view().
|
private |
Definition at line 33 of file ImagePage.php.
Referenced by getDisplayedFile().
|
private |
Definition at line 39 of file ImagePage.php.
|
protected |
Definition at line 42 of file ImagePage.php.
|
protected |
Definition at line 47 of file ImagePage.php.
|
private |
Definition at line 36 of file ImagePage.php.
Referenced by printSharedImageText().