MediaWiki REL1_35
|
Class for viewing MediaWiki file description pages. More...
Public Member Functions | |
delete () | |
Delete the file, or an earlier version of it. | |
getDisplayedFile () | |
getDuplicates () | |
getEmptyPageParserOutput (ParserOptions $options) | |
Overloading Article's getEmptyPageParserOutput method. | |
getFile () | |
getForeignCategories () | |
getImageLimitsFromOption ( $user, $optionName) | |
Returns the corresponding $wgImageLimits entry for the selected user option. | |
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 Article | |
__construct (Title $title, $oldId=null) | |
__get ( $fname) | |
__set ( $fname, $fvalue) | |
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. | |
checkFlags ( $flags) | |
Call to WikiPage function for backwards compatibility. | |
checkTouched () | |
clear () | |
Clear the object. | |
clearPreparedEdit () | |
Call to WikiPage function for backwards compatibility. | |
commitRollback ( $fromP, $summary, $bot, &$resultDetails, User $guser=null) | |
confirmDelete ( $reason) | |
Output deletion confirmation dialog. | |
doDelete ( $reason, $suppress=false, $immediate=false) | |
Perform a deletion and output success or failure messages. | |
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. | |
doDeleteUpdates ( $id, Content $content=null, $revision=null, User $user=null) | |
doEditUpdates (Revision $revision, User $user, array $options=[]) | |
Call to WikiPage function for backwards compatibility. | |
doPurge () | |
doRollback ( $fromP, $summary, $token, $bot, &$resultDetails, User $user=null) | |
doUpdateRestrictions (array $limit, array $expiry, &$cascade, $reason, User $user) | |
doViewUpdates (User $user, $oldid=0) | |
exists () | |
fetchRevisionRecord () | |
Fetches the revision to work on. | |
followRedirect () | |
generateReason (&$hasHistory) | |
getActionOverrides () | |
Call to WikiPage function for backwards compatibility. | |
getAutoDeleteReason (&$hasHistory) | |
getCategories () | |
getComment ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getContentHandler () | |
getContentModel () | |
getContext () | |
Gets the context this Article is executed in. | |
getContributors () | |
getCreator ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getDeletionUpdates (Content $content=null) | |
getHiddenCategories () | |
getId () | |
getLatest () | |
getLinksTimestamp () | |
getMinorEdit () | |
getOldestRevision () | |
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, User $user=null) | |
#- | |
getRedirectedFrom () | |
Get the page this view was redirected from. | |
getRedirectTarget () | |
getRedirectURL ( $rt) | |
getRevIdFetched () | |
Use this to fetch the rev ID used on page views. | |
getRevision () | |
Call to WikiPage function for backwards compatibility. | |
getRevisionFetched () | |
Get the fetched Revision object depending on request parameters or null on failure. | |
getRobotPolicy ( $action, ParserOutput $pOutput=null) | |
Get the robot policy to be used for the current view. | |
getTimestamp () | |
getTitle () | |
Get the title object of the article. | |
getTouched () | |
getUndoContent (Revision $undo, Revision $undoafter=null) | |
Call to WikiPage function for backwards compatibility. | |
getUser ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
getUserText ( $audience=RevisionRecord::FOR_PUBLIC, User $user=null) | |
hasViewableContent () | |
insertOn ( $dbw, $pageId=null) | |
insertProtectNullRevision ( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user=null) | |
insertRedirect () | |
insertRedirectEntry (Title $rt, $oldLatest=null) | |
isCountable ( $editInfo=false) | |
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. | |
isRedirect () | |
loadFromRow ( $data, $from) | |
loadPageData ( $from='fromdb') | |
lockAndGetLatest () | |
makeParserOptions ( $context) | |
pageDataFromId ( $dbr, $id, $options=[]) | |
pageDataFromTitle ( $dbr, $title, $options=[]) | |
prepareContentForEdit (Content $content, $revision=null, User $user=null, $serialFormat=null, $useCache=true) | |
Call to WikiPage function for backwards compatibility. | |
protect () | |
action=protect handler | |
protectDescription (array $limit, array $expiry) | |
protectDescriptionLog (array $limit, array $expiry) | |
render () | |
Handle action=render. | |
replaceSectionAtRev ( $sectionId, Content $sectionContent, $sectionTitle='', $baseRevId=null) | |
replaceSectionContent ( $sectionId, Content $sectionContent, $sectionTitle='', $edittime=null) | |
Call to WikiPage function for backwards compatibility. | |
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 -\> | |
setParserOptions (ParserOptions $options) | |
Override the ParserOptions used to render the primary article wikitext. | |
setRedirectedFrom (Title $from) | |
Tell the page view functions that this view was redirected from another page on the wiki. | |
setTimestamp ( $ts) | |
shouldCheckParserCache (ParserOptions $parserOptions, $oldId) | |
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. | |
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. | |
supportsSections () | |
triggerOpportunisticLinksUpdate (ParserOutput $parserOutput) | |
unprotect () | |
action=unprotect handler (alias) | |
updateCategoryCounts (array $added, array $deleted, $id=0) | |
updateIfNewerOn ( $dbw, $revision) | |
Call to WikiPage function for backwards compatibility. | |
updateRedirectOn ( $dbw, $redirectTitle, $lastRevIsRedirect=null) | |
updateRestrictions ( $limit=[], $reason='', &$cascade=0, $expiry=[]) | |
updateRevisionOn ( $dbw, $revision, $lastRevision=null, $lastRevIsRedirect=null) | |
viewRedirect ( $target, $appendSubtitle=true, $forceKnown=false) | |
Return the HTML for the top of a redirect page. | |
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 an 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 Article | |
fetchContentObject () | |
Get text content object Does NOT follow redirects. | |
getContentObject () | |
Returns a Content object representing the pages effective display content, not necessarily the revision's content! | |
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 | |
bool | $mExtraDescription = false |
Protected Attributes inherited from Article | |
LinkRenderer | $linkRenderer |
IContextSource null | $mContext |
The context this Article is executed in. | |
WikiPage | $mPage |
The WikiPage object of this instance. | |
bool | $viewIsRenderAction = false |
Whether render() was called. | |
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. | |
Private Attributes | |
File false | $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(). | |
static | getRedirectHeaderHtml (Language $lang, $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 Article | |
bool | $mContentLoaded = false |
Is the target revision loaded? Set by fetchRevisionRecord(). | |
Content null | $mContentObject |
Content of the main slot of $this->mRevisionRecord. | |
int null | $mOldId |
The oldid of the article that was requested to be shown, 0 for the current revision. | |
ParserOptions null | $mParserOptions |
ParserOptions object for $wgUser articles. | |
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 bool | $mRedirectUrl = false |
URL to redirect to or false if none. | |
int | $mRevIdFetched = 0 |
Revision ID of revision that was loaded. | |
Class for viewing MediaWiki file description pages.
@method WikiFilePage getPage()
Definition at line 33 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 1045 of file ImagePage.php.
|
private |
string | $lang | |
bool | $selected |
Definition at line 1115 of file ImagePage.php.
References $lang, and getContext().
Referenced by doRenderLangOpt().
ImagePage::delete | ( | ) |
Delete the file, or an earlier version of it.
Reimplemented from Article.
Definition at line 1010 of file ImagePage.php.
References $file, getContext(), getFile(), and getUser().
|
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 1070 of file ImagePage.php.
References $lang, $wgScript, createXmlOptionStringForLanguage(), getContext(), and getTitle().
Referenced by openShowImage().
ImagePage::getDisplayedFile | ( | ) |
Definition at line 225 of file ImagePage.php.
References loadFile().
Referenced by ImageHistoryList\__construct().
ImagePage::getDuplicates | ( | ) |
Definition at line 1188 of file ImagePage.php.
References Article\getPage().
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 293 of file ImagePage.php.
References getFile(), Article\getId(), Article\getPage(), isLocal(), and loadFile().
ImagePage::getFile | ( | ) |
Definition at line 1172 of file ImagePage.php.
References Article\getPage().
ImagePage::getForeignCategories | ( | ) |
Definition at line 1196 of file ImagePage.php.
References Article\getPage().
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 1059 of file ImagePage.php.
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 313 of file ImagePage.php.
References $file, and WebRequest\getVal().
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 661 of file ImagePage.php.
References getContext().
Referenced by openShowImage().
|
protected |
Get alternative thumbnail sizes.
int | $origWidth | Actual width of image |
int | $origHeight | Actual height of image |
Definition at line 1142 of file ImagePage.php.
References $wgImageLimits, getContext(), getImageLimitsFromOption(), and getUser().
Referenced by openShowImage().
ImagePage::getUploadUrl | ( | ) |
Definition at line 751 of file ImagePage.php.
References getFile(), SpecialPage\getTitleFor(), and loadFile().
Referenced by uploadLinksBox().
|
protected |
Definition at line 970 of file ImagePage.php.
References $file, Article\$linkRenderer, getContext(), Article\getPage(), getTitle(), loadFile(), Linker\makeExternalLink(), and MediaWiki\Linker\LinkRenderer\makeKnownLink().
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 807 of file ImagePage.php.
References Article\exists(), getContext(), getFile(), loadFile(), and uploadLinksBox().
Referenced by view().
|
protected |
Definition at line 840 of file ImagePage.php.
References Article\$linkRenderer, $res, $ul, getContext(), getTitle(), MediaWiki\Linker\LinkRenderer\makeKnownLink(), NS_FILE, and queryImageLinks().
Referenced by view().
ImagePage::isLocal | ( | ) |
Definition at line 1180 of file ImagePage.php.
References Article\getPage().
Referenced by getEmptyPageParserOutput(), and uploadLinksBox().
|
protected |
Definition at line 67 of file ImagePage.php.
References Article\getPage(), and getTitle().
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 262 of file ImagePage.php.
References $type, and 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 699 of file ImagePage.php.
Referenced by openShowImage().
|
protected |
Title | $title |
Reimplemented from Article.
Definition at line 52 of file ImagePage.php.
References $title.
|
protected |
Definition at line 328 of file ImagePage.php.
References $dbr, $ext, $lang, Article\$linkRenderer, $wgEnableUploads, $wgScript, $wgSend404Code, $wgSVGMaxSize, DB_REPLICA, doRenderLangOpt(), getContext(), getFile(), Article\getId(), getImageLimitsFromOption(), getLanguageForRendering(), Article\getPage(), getPermissionManager(), getThumbPrevText(), getThumbSizes(), getTitle(), SpecialPage\getTitleFor(), loadFile(), MediaWiki\Linker\LinkRenderer\makeKnownLink(), makeSizeLink(), Linker\makeThumbLinkObj(), printSharedImageText(), Linker\processResponsiveImages(), wfEscapeWikiText(), wfGetDB(), and wfMessageFallback().
Referenced by view().
|
protected |
Show a notice that the file is from a shared repository.
Definition at line 718 of file ImagePage.php.
References getContext(), FileRepo\getDisplayName(), getFile(), Article\getId(), Article\getPage(), and loadFile().
Referenced by openShowImage().
|
protected |
string | string[] | $target | |
int | $limit |
Definition at line 828 of file ImagePage.php.
References $dbr, DB_REPLICA, and wfGetDB().
Referenced by imageLinks().
ImagePage::setFile | ( | $file | ) |
File | $file |
Definition at line 61 of file ImagePage.php.
References $file, and Article\getPage().
ImagePage::showError | ( | $description | ) |
Display an error with a wikitext description.
string | $description |
Definition at line 1028 of file ImagePage.php.
References getContext().
|
protected |
Create the TOC.
bool | $metadata | Whether or not to show the metadata link |
Definition at line 236 of file ImagePage.php.
References getContext().
Referenced by view().
|
protected |
Add the re-upload link (or message about not being able to re-upload) to the output.
Definition at line 763 of file ImagePage.php.
References getContext(), getFile(), getTitle(), getUploadUrl(), getUser(), isLocal(), loadFile(), and Linker\makeExternalLink().
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 $wgShowEXIF, closeShowImage(), getContext(), getFile(), Article\getId(), Article\getOldID(), Article\getPage(), getTitle(), getUser(), imageDupes(), imageHistory(), imageLinks(), loadFile(), makeMetadataTable(), NS_FILE, openShowImage(), and showTOC().
|
private |
Definition at line 37 of file ImagePage.php.
|
private |
Definition at line 43 of file ImagePage.php.
|
protected |
Definition at line 46 of file ImagePage.php.
|
private |
Definition at line 40 of file ImagePage.php.