MediaWiki REL1_28
|
Class for viewing MediaWiki file description pages. More...
Public Member Functions | |
delete () | |
Delete the file, or an earlier version of it. | |
getContentObject () | |
Overloading Article's getContentObject method. | |
getDisplayedFile () | |
getDuplicates () | |
getFile () | |
getForeignCategories () | |
getImageLimitsFromOption ( $user, $optionName) | |
Returns the corresponding $wgImageLimits entry for the selected user option. | |
getUploadUrl () | |
isLocal () | |
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. | |
Public Member Functions inherited from Article | |
__construct (Title $title, $oldId=null) | |
Constructor and clear the article. | |
__get ( $fname) | |
Use PHP's magic __get handler to handle accessing of raw WikiPage fields for backwards compatibility. | |
__set ( $fname, $fvalue) | |
Use PHP's magic __set handler to handle setting of raw WikiPage fields for backwards compatibility. | |
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 () | |
Call to WikiPage function for backwards compatibility. | |
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) | |
Perform a deletion and output success or failure messages. | |
doDeleteArticle ( $reason, $suppress=false, $u1=null, $u2=null, &$error='') | |
doDeleteArticleReal ( $reason, $suppress=false, $u1=null, $u2=null, &$error='', User $user=null, $tags=[]) | |
Call to WikiPage function for backwards compatibility. | |
doDeleteUpdates ( $id, Content $content=null) | |
Call to WikiPage function for backwards compatibility. | |
doEdit ( $text, $summary, $flags=0, $baseRevId=false, $user=null) | |
Call to WikiPage function for backwards compatibility. | |
doEditContent (Content $content, $summary, $flags=0, $baseRevId=false, User $user=null, $serialFormat=null) | |
Call to WikiPage function for backwards compatibility. | |
doEditUpdates (Revision $revision, User $user, array $options=[]) | |
Call to WikiPage function for backwards compatibility. | |
doPurge ( $flags=WikiPage::PURGE_ALL) | |
Call to WikiPage function for backwards compatibility. | |
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. | |
exists () | |
Call to WikiPage function for backwards compatibility. | |
fetchContent () | |
Get text of an article from database Does NOT follow redirects. | |
followRedirect () | |
Call to WikiPage function for backwards compatibility. | |
generateReason (&$hasHistory) | |
getActionOverrides () | |
Call to WikiPage function for backwards compatibility. | |
getAutoDeleteReason (&$hasHistory) | |
Call to WikiPage function for backwards compatibility. | |
getCategories () | |
Call to WikiPage function for backwards compatibility. | |
getComment ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getContent () | |
Note that getContent does not follow redirects anymore. | |
getContentHandler () | |
Call to WikiPage function for backwards compatibility. | |
getContentModel () | |
Call to WikiPage function for backwards compatibility. | |
getContext () | |
Gets the context this Article is executed in. | |
getContributors () | |
Call to WikiPage function for backwards compatibility. | |
getCreator ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getDeletionUpdates (Content $content=null) | |
Call to WikiPage function for backwards compatibility. | |
getHiddenCategories () | |
Call to WikiPage function for backwards compatibility. | |
getId () | |
Call to WikiPage function for backwards compatibility. | |
getLastPurgeTimestamp () | |
Call to WikiPage function for backwards compatibility. | |
getLatest () | |
Call to WikiPage function for backwards compatibility. | |
getLinksTimestamp () | |
Call to WikiPage function for backwards compatibility. | |
getMinorEdit () | |
Call to WikiPage function for backwards compatibility. | |
getOldestRevision () | |
Call to WikiPage function for backwards compatibility. | |
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 () | |
Call to WikiPage function for backwards compatibility. | |
getRedirectURL ( $rt) | |
Call to WikiPage function for backwards compatibility. | |
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, $pOutput=null) | |
Get the robot policy to be used for the current view. | |
getText ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getTimestamp () | |
Call to WikiPage function for backwards compatibility. | |
getTitle () | |
Get the title object of the article. | |
getTouched () | |
Call to WikiPage function for backwards compatibility. | |
getUndoContent (Revision $undo, Revision $undoafter=null) | |
Call to WikiPage function for backwards compatibility. | |
getUser ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
getUserText ( $audience=Revision::FOR_PUBLIC, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
hasViewableContent () | |
Call to WikiPage function for backwards compatibility. | |
insertOn ( $dbw, $pageId=null) | |
Call to WikiPage function for backwards compatibility. | |
insertProtectNullRevision ( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user=null) | |
Call to WikiPage function for backwards compatibility. | |
insertRedirect () | |
Call to WikiPage function for backwards compatibility. | |
insertRedirectEntry (Title $rt, $oldLatest=null) | |
Call to WikiPage function for backwards compatibility. | |
isCountable ( $editInfo=false) | |
Call to WikiPage function for backwards compatibility. | |
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 () | |
Call to WikiPage function for backwards compatibility. | |
loadFromRow ( $data, $from) | |
Call to WikiPage function for backwards compatibility. | |
loadPageData ( $from='fromdb') | |
Call to WikiPage function for backwards compatibility. | |
lockAndGetLatest () | |
Call to WikiPage function for backwards compatibility. | |
makeParserOptions ( $context) | |
Call to WikiPage function for backwards compatibility. | |
pageDataFromId ( $dbr, $id, $options=[]) | |
Call to WikiPage function for backwards compatibility. | |
pageDataFromTitle ( $dbr, $title, $options=[]) | |
Call to WikiPage function for backwards compatibility. | |
prepareContentForEdit (Content $content, $revision=null, User $user=null, $serialFormat=null, $useCache=true) | |
Call to WikiPage function for backwards compatibility. | |
prepareTextForEdit ( $text, $revid=null, User $user=null) | |
Call to WikiPage function for backwards compatibility. | |
protect () | |
action=protect handler | |
protectDescription (array $limit, array $expiry) | |
Call to WikiPage function for backwards compatibility. | |
protectDescriptionLog (array $limit, array $expiry) | |
Call to WikiPage function for backwards compatibility. | |
replaceSectionAtRev ( $sectionId, Content $sectionContent, $sectionTitle='', $baseRevId=null) | |
Call to WikiPage function for backwards compatibility. | |
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) | |
Call to WikiPage function for backwards compatibility. | |
shouldCheckParserCache (ParserOptions $parserOptions, $oldId) | |
Call to WikiPage function for backwards compatibility. | |
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 () | |
Call to WikiPage function for backwards compatibility. | |
triggerOpportunisticLinksUpdate (ParserOutput $parserOutput) | |
Call to WikiPage function for backwards compatibility. | |
unprotect () | |
action=unprotect handler (alias) | |
updateCategoryCounts (array $added, array $deleted, $id=0) | |
Call to WikiPage function for backwards compatibility. | |
updateIfNewerOn ( $dbw, $revision) | |
Call to WikiPage function for backwards compatibility. | |
updateRedirectOn ( $dbw, $redirectTitle, $lastRevIsRedirect=null) | |
Call to WikiPage function for backwards compatibility. | |
updateRestrictions ( $limit=[], $reason='', &$cascade=0, $expiry=[]) | |
updateRevisionOn ( $dbw, $revision, $lastRevision=null, $lastRevIsRedirect=null) | |
Call to WikiPage function for backwards compatibility. | |
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, $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 Member Functions inherited from Article | |
fetchContentObject () | |
Get text content object Does NOT follow redirects. | |
showCssOrJsPage ( $showCacheHint=true) | |
Show a page view for a page formatted as CSS or JavaScript. | |
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 |
WikiFilePage | $mPage |
Protected Attributes inherited from Article | |
IContextSource | $mContext |
The context this Article is executed in. | |
WikiPage | $mPage |
The WikiPage object of this instance. | |
Private Member Functions | |
getThumbPrevText ( $params, $sizeLinkBigImagePreview) | |
Make the text under the image to say what size preview. | |
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 |
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 | getAutosummary ( $oldtext, $newtext, $flags) |
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 | onArticleCreate ( $title) |
static | onArticleDelete ( $title) |
static | onArticleEdit ( $title) |
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. | |
static | selectFields () |
Public Attributes inherited from Article | |
string | $mContent |
Text of the revision we are working on. | |
bool | $mContentLoaded = false |
Is the content ($mContent) already loaded? | |
Content | $mContentObject |
Content of the revision we are working on. | |
int null | $mOldId |
The oldid of the article that is to be shown, 0 for the current revision. | |
ParserOptions | $mParserOptions |
ParserOptions object for $wgUser articles. | |
ParserOutput | $mParserOutput |
Title | $mRedirectedFrom = null |
Title from which we were redirected here. | |
string bool | $mRedirectUrl = false |
URL to redirect to or false if none. | |
int | $mRevIdFetched = 0 |
Revision ID of revision we are working on. | |
Revision | $mRevision = null |
Revision we are working on. | |
Class for viewing MediaWiki file description pages.
Definition at line 28 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 1016 of file ImagePage.php.
ImagePage::delete | ( | ) |
Delete the file, or an earlier version of it.
Reimplemented from Article.
Definition at line 982 of file ImagePage.php.
|
protected |
Output a drop-down box for language options for the file.
array | $langChoices | Array of string language codes |
string | $curLang | Language code file is being viewed in. |
string | $defaultLang | Language code that image is rendered in by default |
Definition at line 1060 of file ImagePage.php.
References $code, $lang, $name, $wgScript, as, Article\getContext(), Article\getTitle(), global, Xml\option(), Xml\submitButton(), text, and wfBCP47().
Referenced by openShowImage().
ImagePage::getContentObject | ( | ) |
Overloading Article's getContentObject method.
Omit noarticletext if sharedupload; text will be fetched from the shared upload server if possible.
Reimplemented from Article.
Definition at line 289 of file ImagePage.php.
References loadFile().
ImagePage::getDisplayedFile | ( | ) |
Definition at line 224 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 1142 of file ImagePage.php.
Referenced by openShowImage().
ImagePage::getDuplicates | ( | ) |
Definition at line 1224 of file ImagePage.php.
ImagePage::getFile | ( | ) |
ImagePage::getForeignCategories | ( | ) |
Definition at line 1232 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 1032 of file ImagePage.php.
References $user, $wgImageLimits, and global.
Referenced by getThumbSizes(), and openShowImage().
|
private |
Make the text under the image to say what size preview.
$params | array parameters for thumbnail |
$sizeLinkBigImagePreview | HTML for the current size |
Definition at line 634 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 1178 of file ImagePage.php.
References $wgImageLimits, Article\getContext(), getImageLimitsFromOption(), Article\getUser(), and global.
Referenced by openShowImage().
ImagePage::getUploadUrl | ( | ) |
Definition at line 724 of file ImagePage.php.
References SpecialPage\getTitleFor(), and loadFile().
Referenced by uploadLinksBox().
|
protected |
Definition at line 944 of file ImagePage.php.
References $link, $out, as, 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 782 of file ImagePage.php.
References $out, Article\getContext(), loadFile(), and uploadLinksBox().
Referenced by view().
|
protected |
Definition at line 815 of file ImagePage.php.
References $count, $limit, $link, $out, $query, $res, $ul, as, Article\getContext(), Article\getTitle(), Linker\linkKnown(), NS_FILE, object, and queryImageLinks().
Referenced by view().
ImagePage::isLocal | ( | ) |
|
protected |
Definition at line 65 of file ImagePage.php.
References Article\getTitle(), wfFindFile(), and wfLocalFile().
Referenced by getContentObject(), getDisplayedFile(), 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 261 of file ImagePage.php.
References $type, as, and Article\getContext().
Referenced by view().
|
private |
Creates an thumbnail of specified size and returns an HTML link to it.
array | $params | Scaler parameters |
int | $width | |
int | $height |
Definition at line 672 of file ImagePage.php.
References $params.
Referenced by openShowImage().
|
protected |
Title | $title |
Reimplemented from Article.
Definition at line 50 of file ImagePage.php.
References $title.
|
protected |
Definition at line 297 of file ImagePage.php.
References $count, $ext, $handler, $lang, $link, $options, $out, $output, $page, $params, $request, $user, $wgEnableUploads, $wgScript, $wgSend404Code, $wgSVGMaxSize, ParserOutput\addJsConfigVars(), ParserOutput\addModules(), as, Xml\closeElement(), doRenderLangOpt(), Article\getContext(), getDisplayWidthHeight(), Article\getId(), getImageLimitsFromOption(), ContextSource\getRequest(), getThumbPrevText(), getThumbSizes(), Article\getTitle(), SpecialPage\getTitleFor(), global, Linker\linkKnown(), list, loadFile(), makeSizeLink(), Linker\makeThumbLinkObj(), Xml\openElement(), Xml\option(), printSharedImageText(), Linker\processResponsiveImages(), LogEventsList\showLogExtract(), Xml\submitButton(), Xml\tags(), text, wfEscapeWikiText(), and wfMessageFallback().
Referenced by view().
|
protected |
Show a notice that the file is from a shared repository.
Definition at line 691 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 803 of file ImagePage.php.
References $dbr, $limit, DB_REPLICA, and wfGetDB().
Referenced by imageLinks().
ImagePage::render | ( | ) |
Handler for action=render Include body text only; none of the image extras.
Reimplemented from Article.
Definition at line 90 of file ImagePage.php.
References Article\getContext().
ImagePage::setFile | ( | $file | ) |
ImagePage::showError | ( | $description | ) |
Display an error with a wikitext description.
string | $description |
Definition at line 999 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 235 of file ImagePage.php.
References Article\getContext().
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 737 of file ImagePage.php.
References $out, $wgEnableUploads, Article\getContext(), Article\getTitle(), getUploadUrl(), Article\getUser(), global, loadFile(), Linker\makeExternalLink(), text, and UploadBase\userCanReUpload().
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 95 of file ImagePage.php.
References $css, $html, $out, $request, $wgShowEXIF, Xml\closeElement(), closeShowImage(), Xml\element(), Article\getContext(), Article\getOldID(), ContextSource\getRequest(), Article\getTitle(), Article\getUser(), global, imageDupes(), imageHistory(), imageLinks(), loadFile(), makeMetadataTable(), NS_FILE, Xml\openElement(), openShowImage(), showTOC(), text, and Article\viewRedirect().
|
private |
Definition at line 30 of file ImagePage.php.
Referenced by getDisplayedFile().
|
private |
Definition at line 36 of file ImagePage.php.
|
protected |
Definition at line 39 of file ImagePage.php.
|
protected |
Definition at line 44 of file ImagePage.php.
|
private |
Definition at line 33 of file ImagePage.php.
Referenced by printSharedImageText().