MediaWiki REL1_33
|
This class should be covered by a general architecture document which does not exist as of January 2011. More...
Public Member Functions | |
__construct (IContextSource $context) | |
Constructor for OutputPage. | |
adaptCdnTTL ( $mtime, $minTTL=0, $maxTTL=0) | |
Get TTL in [$minTTL,$maxTTL] in pass it to lowerCdnMaxage() | |
addBacklinkSubtitle (Title $title, $query=[]) | |
Add a subtitle containing a backlink to a page. | |
addBodyClasses ( $classes) | |
Add a class to the <body> element. | |
addCategoryLinks (array $categories) | |
Add an array of categories, with names in the keys. | |
addContentOverride (LinkTarget $target, Content $content) | |
Add a mapping from a LinkTarget to a Content, for things like page preview. | |
addContentOverrideCallback (callable $callback) | |
Add a callback for mapping from a Title to a Content object, for things like page preview. | |
addElement ( $element, array $attribs=[], $contents='') | |
Shortcut for adding an Html::element via addHTML. | |
addFeedLink ( $format, $href) | |
Add a feed link to the page header. | |
addHeadItem ( $name, $value) | |
Add or replace a head item to the output. | |
addHeadItems ( $values) | |
Add one or more head items to the output. | |
addHelpLink ( $to, $overrideBaseUrl=false) | |
Adds help link with an icon via page indicators. | |
addHTML ( $text) | |
Append $text to the body HTML. | |
addInlineScript ( $script) | |
Add a self-contained script tag with the given contents Internal use only. | |
addInlineStyle ( $style_css, $flip='noflip') | |
Adds inline CSS styles Internal use only. | |
addJsConfigVars ( $keys, $value=null) | |
Add one or more variables to be set in mw.config in JavaScript. | |
addLanguageLinks (array $newLinkArray) | |
Add new language links. | |
addLink (array $linkarr) | |
Add a new \<link\> tag to the page header. | |
addLinkHeader ( $header) | |
Add an HTTP Link: header. | |
addMeta ( $name, $val) | |
Add a new "<meta>" tag To add an http-equiv meta tag, precede the name with "http:". | |
addModules ( $modules) | |
Load one or more ResourceLoader modules on this page. | |
addModuleStyles ( $modules) | |
Load the styles of one or more ResourceLoader modules on this page. | |
addParserOutput (ParserOutput $parserOutput, $poOptions=[]) | |
Add everything from a ParserOutput object. | |
addParserOutputContent (ParserOutput $parserOutput, $poOptions=[]) | |
Add the HTML and enhancements for it (like ResourceLoader modules) associated with a ParserOutput object, without any other metadata. | |
addParserOutputMetadata (ParserOutput $parserOutput) | |
Add all metadata associated with a ParserOutput object, but without the actual HTML. | |
addParserOutputText (ParserOutput $parserOutput, $poOptions=[]) | |
Add the HTML associated with a ParserOutput object, without any metadata. | |
addReturnTo ( $title, array $query=[], $text=null, $options=[]) | |
Add a "return to" link pointing to a specified title. | |
addScript ( $script) | |
Add raw HTML to the list of scripts (including \<script\> tag, etc.) Internal use only. | |
addScriptFile ( $file, $unused=null) | |
Add a JavaScript file to be loaded as <script> on this page. | |
addStyle ( $style, $media='', $condition='', $dir='') | |
Add a local or specified stylesheet, with the given media options. | |
addSubtitle ( $str) | |
Add $str to the subtitle. | |
addTemplate (&$template) | |
Add the output of a QuickTemplate to the output buffer. | |
addVaryHeader ( $header, array $option=null) | |
Add an HTTP header that will influence on the cache. | |
addWikiMsg () | |
Add a wikitext-formatted message to the output. | |
addWikiMsgArray ( $name, $args) | |
Add a wikitext-formatted message to the output. | |
addWikiText ( $text, $linestart=true, $interface=true) | |
Convert wikitext to HTML and add it to the buffer Default assumes that the current page title will be used. | |
addWikiTextAsContent ( $text, $linestart=true, Title $title=null) | |
Convert wikitext in the page content language to HTML and add it to the buffer. | |
addWikiTextAsInterface ( $text, $linestart=true, Title $title=null) | |
Convert wikitext in the user interface language to HTML and add it to the buffer. | |
addWikiTextTidy ( $text, $linestart=true) | |
Add wikitext in content language. | |
addWikiTextTitle ( $text, Title $title, $linestart, $tidy=false, $interface=false) | |
Add wikitext with a custom Title object. | |
addWikiTextTitleTidy ( $text, Title $title, $linestart=true) | |
Add wikitext in content language with a custom Title object. | |
addWikiTextWithTitle ( $text, Title $title, $linestart=true) | |
Add wikitext with a custom Title object. | |
allowClickjacking () | |
Turn off frame-breaking. | |
buildCssLinksArray () | |
checkLastModified ( $timestamp) | |
checkLastModified tells the client to use the client-cached page if possible. | |
clearHTML () | |
Clear the body HTML. | |
clearSubtitle () | |
Clear the subtitles. | |
disable () | |
Disable output completely, i.e. | |
disallowUserJs () | |
Do not allow scripts which can be modified by wiki users to load on this page; only allow scripts bundled with, or generated by, the software. | |
enableClientCache ( $state) | |
Use enableClientCache(false) to force it to send nocache headers. | |
enableOOUI () | |
Add ResourceLoader module styles for OOUI and set up the PHP implementation of it for use with MediaWiki and this OutputPage instance. | |
enableSectionEditLinks ( $flag=true) | |
Enables/disables section edit links, doesn't override NOEDITSECTION | |
forceHideNewSectionLink () | |
Forcibly hide the new section link? | |
formatPermissionsErrorMessage (array $errors, $action=null) | |
Format a list of error messages. | |
getAllowedModules ( $type) | |
Show what level of JavaScript / CSS untrustworthiness is allowed on this page. | |
getArticleBodyOnly () | |
Return whether the output will contain only the body of the article. | |
getBottomScripts () | |
JS stuff to put at the bottom of the <body> . | |
getCacheVaryCookies () | |
Get the list of cookie names that will influence the cache. | |
getCanonicalUrl () | |
Returns the URL to be used for the <link rel=canonical>> if one is set. | |
getCategories ( $type='all') | |
Get the list of category names this page belongs to. | |
getCategoryLinks () | |
Get the list of category links, in a 2-D array with the following format: $arr[$type][] = $link, where $type is either "normal" or "hidden" (for hidden categories) and $link a HTML fragment with a link to the category page. | |
getCSPNonce () | |
Get (and set if not yet set) the CSP nonce. | |
getDisplayTitle () | |
Returns page display title. | |
getFeedAppendQuery () | |
Will currently always return null. | |
getFileSearchOptions () | |
Get the files used on this page. | |
getFileVersion () | |
Get the displayed file version. | |
getFrameOptions () | |
Get the X-Frame-Options header value (without the name part), or false if there isn't one. | |
getHeadItemsArray () | |
Get an array of head items. | |
getHeadLinksArray () | |
getHTML () | |
Get the body HTML. | |
getHTMLTitle () | |
Return the "HTML title", i.e. | |
getIndicators () | |
Get the indicators associated with this page. | |
getJsConfigVars () | |
Get the javascript config vars to include on this page. | |
getJSVars () | |
Get an array containing the variables to be set in mw.config in JavaScript. | |
getKeyHeader () | |
Get a complete Key header. | |
getLanguageLinks () | |
Get the list of language links. | |
getLinkHeader () | |
Return a Link: header. | |
getLinkTags () | |
Returns the current <link> tags. | |
getMetaTags () | |
Returns the current <meta> tags. | |
getModules ( $filter=false, $position=null, $param='mModules', $type=ResourceLoaderModule::TYPE_COMBINED) | |
Get the list of modules to include on this page. | |
getModuleScripts () | |
getModuleStyles ( $filter=false, $position=null) | |
Get the list of style-only modules to load on this page. | |
getPageTitle () | |
Return the "page title", i.e. | |
getPreventClickjacking () | |
Get the prevent-clickjacking flag. | |
getProperty ( $name) | |
Get an additional output property. | |
getRedirect () | |
Get the URL to redirect to, or an empty string if not redirect URL set. | |
getResourceLoader () | |
Get a ResourceLoader object associated with this OutputPage. | |
getRevisionId () | |
Get the displayed revision ID. | |
getRevisionTimestamp () | |
Get the timestamp of displayed revision. | |
getRlClient () | |
Call this to freeze the module queue and JS config and create a formatter. | |
getSubtitle () | |
Get the subtitle. | |
getSyndicationLinks () | |
Return URLs for each supported syndication format for this page. | |
getTarget () | |
getTemplateIds () | |
Get the templates used on this page. | |
getUnprefixedDisplayTitle () | |
Returns page display title without namespace prefix if possible. | |
getVaryHeader () | |
Return a Vary: header on which to vary caches. | |
hasHeadItem ( $name) | |
Check if the header item $name is already set. | |
haveCacheVaryCookies () | |
Check if the request has a cache-varying cookie header If it does, it's very important that we don't allow public caching. | |
headElement (Skin $sk, $includeStyle=true) | |
isArticle () | |
Return whether the content displayed page is related to the source of the corresponding article on the wiki. | |
isArticleRelated () | |
Return whether this page is related an article on the wiki. | |
isDisabled () | |
Return whether the output will be completely disabled. | |
isPrintable () | |
Return whether the page is "printable". | |
isSyndicated () | |
Should we output feed links for this page? | |
isTOCEnabled () | |
Whether the output has a table of contents. | |
loadSkinModules ( $sk) | |
Transfer styles and JavaScript modules from skin. | |
lowerCdnMaxage ( $maxage) | |
Set the value of the "s-maxage" part of the "Cache-control" HTTP header to $maxage if that is lower than the current s-maxage. | |
makeResourceLoaderLink ( $modules, $only, array $extraQuery=[]) | |
Explicily load or embed modules on a page. | |
output ( $return=false) | |
Finally, all the text has been munged and accumulated into the object, let's actually output it: | |
parse ( $text, $linestart=true, $interface=false, $language=null) | |
Parse wikitext and return the HTML. | |
parseAsContent ( $text, $linestart=true) | |
Parse wikitext in the page content language and return the HTML. | |
parseAsInterface ( $text, $linestart=true) | |
Parse wikitext in the user interface language and return the HTML. | |
parseInline ( $text, $linestart=true, $interface=false) | |
Parse wikitext, strip paragraph wrapper, and return the HTML. | |
parseInlineAsInterface ( $text, $linestart=true) | |
Parse wikitext in the user interface language, strip paragraph wrapper, and return the HTML. | |
parserOptions ( $options=null) | |
Get/set the ParserOptions object to use for wikitext parsing. | |
prepareErrorPage ( $pageTitle, $htmlTitle=false) | |
Prepare this object to display an error page; disable caching and indexing, clear the current text and redirect, set the page's title and optionally an custom HTML title (content of the "<title>" tag). | |
prependHTML ( $text) | |
Prepend $text to the body HTML. | |
preventClickjacking ( $enable=true) | |
Set a flag which will cause an X-Frame-Options header appropriate for edit pages to be sent. | |
redirect ( $url, $responsecode='302') | |
Redirect to $url rather than displaying the normal page. | |
reduceAllowedModules ( $type, $level) | |
Limit the highest level of CSS/JS untrustworthiness allowed. | |
returnToMain ( $unused=null, $returnto=null, $returntoquery=null) | |
Add a "return to" link pointing to a specified title, or the title indicated in the request, or else the main page. | |
sectionEditLinksEnabled () | |
sendCacheControl () | |
Send cache control HTTP headers. | |
setArticleBodyOnly ( $only) | |
Set whether the output should only contain the body of the article, without any skin, sidebar, etc. | |
setArticleFlag ( $newVal) | |
Set whether the displayed content is related to the source of the corresponding article on the wiki Setting true will cause the change "article related" toggle to true. | |
setArticleRelated ( $newVal) | |
Set whether this page is related an article on the wiki Setting false will cause the change of "article flag" toggle to false. | |
setCanonicalUrl ( $url) | |
Set the URL to be used for the <link rel=canonical>>. | |
setCategoryLinks (array $categories) | |
Reset the category links (but not the category list) and add $categories. | |
setCdnMaxage ( $maxage) | |
Set the value of the "s-maxage" part of the "Cache-control" HTTP header. | |
setCopyright ( $hasCopyright) | |
Set whether the standard copyright should be shown for the current page. | |
setCopyrightUrl ( $url) | |
Set the copyright URL to send with the output. | |
setDisplayTitle ( $html) | |
Same as page title but only contains name of the page, not any other text. | |
setFeedAppendQuery ( $val) | |
Add default feeds to the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version. | |
setFileVersion ( $file) | |
Set the displayed file version. | |
setFollowPolicy ( $policy) | |
Set the follow policy for the page, but leave the index policy un- touched. | |
setHTMLTitle ( $name) | |
"HTML title" means the contents of "<title>". | |
setIndexPolicy ( $policy) | |
Set the index policy for the page, but leave the follow policy un- touched. | |
setIndicators (array $indicators) | |
Add an array of indicators, with their identifiers as array keys and HTML contents as values. | |
setLanguageLinks (array $newLinkArray) | |
Reset the language links and add new language links. | |
setLastModified ( $timestamp) | |
Override the last modified timestamp. | |
setPageTitle ( $name) | |
"Page title" means the contents of \<h1\>. | |
setPrintable () | |
Set the page as printable, i.e. | |
setProperty ( $name, $value) | |
Set an additional output property. | |
setRedirectedFrom ( $t) | |
Set $mRedirectedFrom, the Title of the page which redirected us to the current page. | |
setRevisionId ( $revid) | |
Set the revision ID which will be seen by the wiki text parser for things such as embedded {{REVISIONID}} variable use. | |
setRevisionTimestamp ( $timestamp) | |
Set the timestamp of the revision which will be displayed. | |
setRobotPolicy ( $policy) | |
Set the robot policy for the page: http://www.robotstxt.org/meta.html | |
setStatusCode ( $statusCode) | |
Set the HTTP status code to send with the output. | |
setSubtitle ( $str) | |
Replace the subtitle with $str. | |
setSyndicated ( $show=true) | |
Add or remove feed links in the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version. | |
setTarget ( $target) | |
Sets ResourceLoader target for load.php links. | |
setTitle (Title $t) | |
Set the Title object to use. | |
showErrorPage ( $title, $msg, $params=[]) | |
Output a standard error page. | |
showFatalError ( $message) | |
Output an error page. | |
showFileCopyError ( $old, $new) | |
showFileDeleteError ( $name) | |
showFileNotFoundError ( $name) | |
showFileRenameError ( $old, $new) | |
showLagWarning ( $lag) | |
Show a warning about replica DB lag. | |
showNewSectionLink () | |
Show an "add new section" link? | |
showPermissionsErrorPage (array $errors, $action=null) | |
Output a standard permission error page. | |
showsCopyright () | |
Return whether the standard copyright should be shown for the current page. | |
showUnexpectedValueError ( $name, $val) | |
userCanPreview () | |
To make it harder for someone to slip a user a fake JavaScript or CSS preview, a random token is associated with the login session. | |
versionRequired ( $version) | |
Display an error page indicating that a given version of MediaWiki is required to use it. | |
wrapWikiMsg ( $wrap) | |
This function takes a number of message/argument specifications, wraps them in some overall structure, and then parses the result and adds it to the output. | |
wrapWikiTextAsInterface ( $wrapperClass, $text) | |
Convert wikitext in the user interface language to HTML and add it to the buffer with a <div class="$wrapperClass"> wrapper. | |
Public Member Functions inherited from ContextSource | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. | |
getConfig () | |
getContext () | |
Get the base IContextSource object. | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getStats () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key) | |
Get a Message object with context set Parameters are the same as wfMessage() | |
setContext (IContextSource $context) | |
Static Public Member Functions | |
static | buildBacklinkSubtitle (Title $title, $query=[]) |
Build message object for a subtitle containing a backlink to a page. | |
static | setupOOUI ( $skinName='default', $dir='ltr') |
Helper function to setup the PHP implementation of OOUI to use in this request. | |
static | transformCssMedia ( $media) |
Transform "media" attribute based on request parameters. | |
static | transformFilePath ( $remotePathPrefix, $localPath, $file) |
Utility method for transformResourceFilePath(). | |
static | transformResourcePath (Config $config, $path) |
Transform path to web-accessible static resource. | |
Public Attributes | |
string | $mBodytext = '' |
Contains all of the "<body>" content. | |
bool | $mNoGallery = false |
Comes from the parser. | |
string | $mPageLinkTitle = '' |
Used by skin template. | |
string | $mRedirect = '' |
string | $mRedirectCode = '' |
Protected Member Functions | |
addCategoryLinksToLBAndGetResult (array $categories) | |
buildExemptModules () | |
Build exempt modules and legacy non-ResourceLoader styles. | |
filterModules (array $modules, $position=null, $type=ResourceLoaderModule::TYPE_COMBINED) | |
Filter an array of modules to remove insufficiently trustworthy members, and modules which are no longer registered (eg a page is cached before an extension is disabled) | |
getAdvertisedFeedTypes () | |
Return effective list of advertised feed types. | |
styleLink ( $style, array $options) | |
Generate \<link\> tags for stylesheets. | |
Static Protected Member Functions | |
static | combineWrappedStrings (array $chunks) |
Combine WrappedString chunks and filter out empty ones. | |
Protected Attributes | |
array | $mAdditionalBodyClasses = [] |
Additional <body> classes; there are also <body> classes from other sources. | |
array | $mAllowedModules |
What level of 'untrustworthiness' is allowed in CSS/JS modules loaded on this page? | |
bool | $mCanonicalUrl = false |
array | $mCategories |
array | $mCategoryLinks = [] |
int | $mCdnMaxage = 0 |
Cache stuff. | |
int | $mCdnMaxageLimit = INF |
Upper limit on mCdnMaxage. | |
int | $mContainsNewMagic = 0 |
bool | $mDoNothing = false |
Whether output is disabled. | |
$mEnableClientCache = true | |
$mFeedLinksAppendQuery = null | |
array | $mFileVersion = null |
array | $mHeadItems = [] |
Array of elements in "<head>". | |
bool | $mHideNewSectionLink = false |
array | $mImageTimeKeys = [] |
array | $mIndicators = [] |
string | $mInlineStyles = '' |
Inline CSS styles. | |
array | $mJsConfigVars = [] |
string | $mLastModified = '' |
Used for sending cache control. | |
array | $mLinktags = [] |
array | $mMetatags = [] |
Should be private. | |
array | $mModules = [] |
array | $mModuleStyles = [] |
bool | $mNewSectionLink = false |
ParserOptions | $mParserOptions = null |
lazy initialised, use parserOptions() | |
bool | $mPreventClickjacking = true |
Controls if anti-clickjacking / frame-breaking headers will be sent. | |
ResourceLoader | $mResourceLoader |
int | $mStatusCode |
array | $mTemplateIds = [] |
array | $styles = [] |
An array of stylesheet filenames (relative from skins path), with options for CSS media, IE conditions, and RTL/LTR direction. | |
Private Member Functions | |
addAcceptLanguage () | |
T23672: Add Accept-Language to Vary and Key headers if there's no 'variant' parameter in GET. | |
addWikiTextTitleInternal ( $text, Title $title, $linestart, $tidy, $interface, $wrapperClass=null) | |
Add wikitext with a custom Title object. | |
feedLink ( $type, $url, $text) | |
Generate a "<link rel/>" for a feed. | |
getCdnCacheEpoch ( $reqTime, $maxAge) | |
getOriginTrials () | |
Get the Origin-Trial header values. | |
getRlClientContext () | |
parseInternal ( $text, $title, $linestart, $tidy, $interface, $language) | |
Parse wikitext and return the HTML (internal implementation helper) | |
warnModuleTargetFilter ( $moduleName) | |
Private Attributes | |
callable[] | $contentOverrideCallbacks = [] |
array | $contentOverrides = [] |
Map Title to Content. | |
string null | $copyrightUrl |
The URL to send in a <link> element with rel=license. | |
string | $CSPNonce |
The nonce for Content-Security-Policy. | |
string | $displayTitle |
The displayed title of the page. | |
array | $limitReportJSData = [] |
Profiling data. | |
bool | $mArticleBodyOnly = false |
Flag if output should only contain the body of the article. | |
bool | $mEnableTOC = false |
Whether parser output contains a table of contents. | |
$mFeedLinks = [] | |
Handles the Atom / RSS links. | |
$mFollowPolicy = 'follow' | |
bool | $mHasCopyright = false |
Is the content subject to copyright. | |
string | $mHTMLtitle = '' |
Stores contents of "<title>" tag. | |
$mIndexPolicy = 'index' | |
bool | $mIsArticle = false |
Is the displayed content related to the source of the corresponding wiki article. | |
bool | $mIsArticleRelated = true |
Stores "article flag" toggle. | |
array | $mLanguageLinks = [] |
Array of Interwiki Prefixed (non DB key) Titles (e.g. | |
$mLinkHeader = [] | |
Link: header contents. | |
string | $mPageTitle = '' |
The contents of. | |
bool | $mPrintable = false |
We have to set isPrintable(). | |
$mProperties = [] | |
Additional key => value data. | |
Title | $mRedirectedFrom = null |
If the current page was reached through a redirect, $mRedirectedFrom contains the Title of the redirect. | |
int | $mRevisionId = null |
To include the variable {{REVISIONID}}. | |
string | $mRevisionTimestamp = null |
$mScripts = '' | |
Used for JavaScript (predates ResourceLoader) | |
array | $mSubtitle = [] |
Contains the page subtitle. | |
string null | $mTarget = null |
ResourceLoader target for load.php links. | |
array | $mVaryHeader |
Headers that cause the cache to vary. | |
ResourceLoaderClientHtml | $rlClient |
ResourceLoaderContext | $rlClientContext |
array | $rlExemptStyleModules |
Static Private Attributes | |
static array | $cacheVaryCookies = null |
A cache of the names of the cookies that will influence the cache. | |
This class should be covered by a general architecture document which does not exist as of January 2011.
This is one of the Core classes and should be read at least once by any new developers.
This class is used to prepare the final rendering. A skin is then applied to the output parameters (links, javascript, html, categories ...).
Some comments comes from a pairing session between Zak Greant and Antoine Musso in November 2010.
Definition at line 46 of file OutputPage.php.
OutputPage::__construct | ( | IContextSource | $context | ) |
Constructor for OutputPage.
This should not be called directly. Instead a new RequestContext should be created and it will implicitly create a OutputPage tied to that context.
IContextSource | $context |
Definition at line 333 of file OutputPage.php.
References $context, and ContextSource\setContext().
OutputPage::adaptCdnTTL | ( | $mtime, | |
$minTTL = 0, | |||
$maxTTL = 0 ) |
Get TTL in [$minTTL,$maxTTL] in pass it to lowerCdnMaxage()
This sets and returns $minTTL if $mtime is false or null. Otherwise, the TTL is higher the older the $mtime timestamp is. Essentially, the TTL is 90% of the age of the object, subject to the min and max.
string | int | float | bool | null | $mtime | Last-Modified timestamp |
int | $minTTL | Minimum TTL in seconds [default: 1 minute] |
int | $maxTTL | Maximum TTL in seconds [default: $wgSquidMaxage] |
Definition at line 2265 of file OutputPage.php.
References and(), ContextSource\getConfig(), lowerCdnMaxage(), and wfTimestamp().
|
private |
T23672: Add Accept-Language to Vary and Key headers if there's no 'variant' parameter in GET.
For example: /w/index.php?title=Main_page will vary based on Accept-Language; but /w/index.php?title=Main_page&variant=zh-cn will not.
Definition at line 2430 of file OutputPage.php.
References $lang, addVaryHeader(), ContextSource\getRequest(), and ContextSource\getTitle().
Referenced by sendCacheControl().
OutputPage::addBacklinkSubtitle | ( | Title | $title, |
$query = [] ) |
Add a subtitle containing a backlink to a page.
Title | $title | Title to link to |
array | $query | Array of additional parameters to include in the link |
Definition at line 1061 of file OutputPage.php.
References $query, and addSubtitle().
OutputPage::addBodyClasses | ( | $classes | ) |
Add a class to the <body> element.
string | string[] | $classes | One or more classes to add |
Definition at line 684 of file OutputPage.php.
OutputPage::addCategoryLinks | ( | array | $categories | ) |
Add an array of categories, with names in the keys.
array | $categories | Mapping category name => sort key |
Definition at line 1322 of file OutputPage.php.
References $linkRenderer, $res, $services, $type, addCategoryLinksToLBAndGetResult(), and(), NS_CATEGORY, and string.
Referenced by addParserOutputMetadata(), and setCategoryLinks().
|
protected |
array | $categories |
Definition at line 1371 of file OutputPage.php.
References $dbr, $res, and(), DB_REPLICA, NS_CATEGORY, LinkBatch\setArray(), and wfGetDB().
Referenced by addCategoryLinks().
OutputPage::addContentOverride | ( | LinkTarget | $target, |
Content | $content ) |
Add a mapping from a LinkTarget to a Content, for things like page preview.
LinkTarget | $target | |
Content | $content |
Definition at line 609 of file OutputPage.php.
References $content, addContentOverrideCallback(), MediaWiki\Linker\LinkTarget\getDBkey(), and MediaWiki\Linker\LinkTarget\getNamespace().
OutputPage::addContentOverrideCallback | ( | callable | $callback | ) |
Add a callback for mapping from a Title to a Content object, for things like page preview.
callable | $callback |
Definition at line 629 of file OutputPage.php.
Referenced by addContentOverride().
OutputPage::addElement | ( | $element, | |
array | $attribs = [], | ||
$contents = '' ) |
Shortcut for adding an Html::element via addHTML.
string | $element | |
array | $attribs | |
string | $contents |
Definition at line 1587 of file OutputPage.php.
OutputPage::addFeedLink | ( | $format, | |
$href ) |
Add a feed link to the page header.
string | $format | Feed type, should be a key of $wgFeedClasses |
string | $href | URL |
Definition at line 1189 of file OutputPage.php.
References and(), and getAdvertisedFeedTypes().
OutputPage::addHeadItem | ( | $name, | |
$value ) |
Add or replace a head item to the output.
Whenever possible, use more specific options like ResourceLoader modules, OutputPage::addLink(), OutputPage::addMetaLink() and OutputPage::addFeedLink() Fallback options for those are: OutputPage::addStyle, OutputPage::addScript(), OutputPage::addInlineScript() and OutputPage::addInlineStyle() This would be your very LAST fallback.
string | $name | Item name |
string | $value | Raw HTML |
Definition at line 654 of file OutputPage.php.
OutputPage::addHeadItems | ( | $values | ) |
Add one or more head items to the output.
string | string[] | $values | Raw HTML |
Definition at line 664 of file OutputPage.php.
OutputPage::addHelpLink | ( | $to, | |
$overrideBaseUrl = false ) |
Adds help link with an icon via page indicators.
Link target can be overridden by a local message containing a wikilink: the message key is: lowercase action or special page name + '-helppage'.
string | $to | Target MediaWiki.org page title or encoded URL. |
bool | $overrideBaseUrl | Whether $url is a full URL, to avoid MW.o. |
Definition at line 1482 of file OutputPage.php.
References $link, addModuleStyles(), and(), ContextSource\msg(), setIndicators(), and wfUrlencode().
OutputPage::addHTML | ( | $text | ) |
Append $text to the body HTML.
string | $text | HTML |
Definition at line 1574 of file OutputPage.php.
Referenced by addElement(), addParserOutputText(), addReturnTo(), addTemplate(), addWikiMsgArray(), showErrorPage(), showFatalError(), showPermissionsErrorPage(), and ArticleViewTest\testArticleRevisionViewCustomHook().
OutputPage::addInlineScript | ( | $script | ) |
Add a self-contained script tag with the given contents Internal use only.
Use OutputPage::addModules() if possible.
string | $script | JavaScript text, no script tags |
Definition at line 477 of file OutputPage.php.
References getCSPNonce().
OutputPage::addInlineStyle | ( | $style_css, | |
$flip = 'noflip' ) |
Adds inline CSS styles Internal use only.
Use OutputPage::addModuleStyles() if possible.
mixed | $style_css | Inline CSS |
string | $flip | Set to 'flip' to flip the CSS if needed |
Definition at line 3875 of file OutputPage.php.
References ContextSource\getLanguage().
OutputPage::addJsConfigVars | ( | $keys, | |
$value = null ) |
Add one or more variables to be set in mw.config in JavaScript.
string | array | $keys | Key or array of key/value pairs |
mixed | null | $value | [optional] Value of the configuration variable |
Definition at line 3370 of file OutputPage.php.
References $keys, $value, and and().
Referenced by addParserOutputContent(), and addParserOutputMetadata().
OutputPage::addLanguageLinks | ( | array | $newLinkArray | ) |
Add new language links.
string[] | $newLinkArray | Array of interwiki-prefixed (non DB key) titles (e.g. 'fr:Test page') |
Definition at line 1294 of file OutputPage.php.
References and().
OutputPage::addLink | ( | array | $linkarr | ) |
Add a new \<link\> tag to the page header.
Note: use setCanonicalUrl() for rel=canonical.
array | $linkarr | Associative array of attributes. |
Definition at line 407 of file OutputPage.php.
References and().
OutputPage::addLinkHeader | ( | $header | ) |
Add an HTTP Link: header.
string | $header | Header value |
Definition at line 2371 of file OutputPage.php.
References $header.
OutputPage::addMeta | ( | $name, | |
$val ) |
Add a new "<meta>" tag To add an http-equiv meta tag, precede the name with "http:".
string | $name | Name of the meta tag |
string | $val | Value of the meta tag |
Definition at line 386 of file OutputPage.php.
References and().
OutputPage::addModules | ( | $modules | ) |
Load one or more ResourceLoader modules on this page.
string | array | $modules | Module name (string) or array of module names |
Definition at line 547 of file OutputPage.php.
References $modules, and(), and array().
Referenced by ListToggle\__construct(), addParserOutputContent(), addParserOutputMetadata(), getRlClient(), and loadSkinModules().
OutputPage::addModuleStyles | ( | $modules | ) |
Load the styles of one or more ResourceLoader modules on this page.
Module styles added through this function will be loaded as a stylesheet, using a standard <link rel=stylesheet>
HTML tag, rather than as a combined Javascript and CSS package. Thus, they will even load when JavaScript is disabled.
string | array | $modules | Module name (string) or array of module names |
Definition at line 582 of file OutputPage.php.
References $modules, and(), and array().
Referenced by ListToggle\__construct(), addHelpLink(), addParserOutputContent(), addParserOutputMetadata(), enableOOUI(), getRlClient(), and loadSkinModules().
OutputPage::addParserOutput | ( | ParserOutput | $parserOutput, |
$poOptions = [] ) |
Add everything from a ParserOutput object.
ParserOutput | $parserOutput | |
array | $poOptions | Options to ParserOutput::getText() |
Definition at line 2060 of file OutputPage.php.
References addParserOutputMetadata(), and addParserOutputText().
Referenced by addWikiTextTitleInternal().
OutputPage::addParserOutputContent | ( | ParserOutput | $parserOutput, |
$poOptions = [] ) |
Add the HTML and enhancements for it (like ResourceLoader modules) associated with a ParserOutput object, without any other metadata.
ParserOutput | $parserOutput | |
array | $poOptions | Options to ParserOutput::getText() |
Definition at line 2030 of file OutputPage.php.
References addJsConfigVars(), addModules(), addModuleStyles(), addParserOutputText(), ParserOutput\getJsConfigVars(), ParserOutput\getModules(), and ParserOutput\getModuleStyles().
OutputPage::addParserOutputMetadata | ( | ParserOutput | $parserOutput | ) |
Add all metadata associated with a ParserOutput object, but without the actual HTML.
This includes categories, language links, ResourceLoader modules, effects of certain magic words, and so on.
ParserOutput | $parserOutput |
Definition at line 1954 of file OutputPage.php.
References $data, addCategoryLinks(), addJsConfigVars(), addModules(), addModuleStyles(), and(), array(), enableClientCache(), enableOOUI(), ParserOutput\getCategories(), ContextSource\getConfig(), ParserOutput\getEnableOOUI(), ParserOutput\getFileSearchOptions(), ParserOutput\getHeadItems(), ParserOutput\getHideNewSection(), ParserOutput\getIndicators(), ParserOutput\getJsConfigVars(), ParserOutput\getLanguageLinks(), ParserOutput\getLimitReportJSData(), ParserOutput\getModules(), ParserOutput\getModuleStyles(), ParserOutput\getNewSection(), ParserOutput\getNoGallery(), ParserOutput\getOutputHooks(), ParserOutput\getTemplateIds(), ContextSource\getTitle(), ParserOutput\getTOCHTML(), CacheTime\isCacheable(), list, ParserOutput\preventClickjacking(), and setIndicators().
Referenced by addParserOutput().
OutputPage::addParserOutputText | ( | ParserOutput | $parserOutput, |
$poOptions = [] ) |
Add the HTML associated with a ParserOutput object, without any metadata.
ParserOutput | $parserOutput | |
array | $poOptions | Options to ParserOutput::getText() |
Definition at line 2046 of file OutputPage.php.
References addHTML(), and(), and ParserOutput\getText().
Referenced by addParserOutput(), and addParserOutputContent().
Add a "return to" link pointing to a specified title.
Title | $title | Title to link |
array | $query | Query string parameters |
string | null | $text | Text of the link (input is not escaped) |
array | $options | Options array to pass to Linker |
Definition at line 3014 of file OutputPage.php.
References $link, $linkRenderer, $options, $query, addHTML(), and ContextSource\msg().
Referenced by returnToMain().
OutputPage::addScript | ( | $script | ) |
Add raw HTML to the list of scripts (including \<script\> tag, etc.) Internal use only.
Use OutputPage::addModules() or OutputPage::addJsConfigVars() if possible.
string | $script | Raw HTML |
Definition at line 448 of file OutputPage.php.
Referenced by addScriptFile().
OutputPage::addScriptFile | ( | $file, | |
$unused = null ) |
Add a JavaScript file to be loaded as <script>
on this page.
Internal use only. Use OutputPage::addModules() if possible.
string | $file | URL to file (absolute path, protocol-relative, or full url) |
string | null | $unused | Previously used to change the cache-busting query parameter |
Definition at line 460 of file OutputPage.php.
References addScript(), and(), getCSPNonce(), and wfDeprecated().
OutputPage::addStyle | ( | $style, | |
$media = '', | |||
$condition = '', | |||
$dir = '' ) |
Add a local or specified stylesheet, with the given media options.
Internal use only. Use OutputPage::addModuleStyles() if possible.
string | $style | URL to the file |
string | $media | To specify a media type, 'screen', 'printable', 'handheld' or any. |
string | $condition | For IE conditional comments, specifying an IE version |
string | $dir | Set to 'rtl' or 'ltr' for direction-specific sheets |
Definition at line 3854 of file OutputPage.php.
OutputPage::addSubtitle | ( | $str | ) |
Add $str to the subtitle.
string | Message | $str | String or Message to add to the subtitle. String should be safe HTML. |
Definition at line 1030 of file OutputPage.php.
References getContext().
Referenced by addBacklinkSubtitle(), and setSubtitle().
OutputPage::addTemplate | ( | & | $template | ) |
Add the output of a QuickTemplate to the output buffer.
QuickTemplate | &$template |
Definition at line 2070 of file OutputPage.php.
Add an HTTP header that will influence on the cache.
string | $header | Header name |
string[] | null | $option | Options for the Key header. See https://datatracker.ietf.org/doc/draft-fielding-http-key/ for the list of valid options. |
Definition at line 2337 of file OutputPage.php.
References $header, and and().
Referenced by addAcceptLanguage(), getKeyHeader(), getVaryHeader(), output(), and sendCacheControl().
OutputPage::addWikiMsg | ( | ) |
Add a wikitext-formatted message to the output.
This is equivalent to:
$wgOut->addWikiText( wfMessage( ... )->plain() )
Definition at line 4111 of file OutputPage.php.
References $args, addWikiMsgArray(), and and().
Referenced by versionRequired().
OutputPage::addWikiMsgArray | ( | $name, | |
$args ) |
Add a wikitext-formatted message to the output.
Like addWikiMsg() except the parameters are taken as an array instead of a variable argument list.
string | $name | |
array | $args |
Definition at line 4125 of file OutputPage.php.
References $args, addHTML(), and ContextSource\msg().
Referenced by addWikiMsg(), and showErrorPage().
Convert wikitext to HTML and add it to the buffer Default assumes that the current page title will be used.
string | $text | |
bool | $linestart | Is this the start of a line? |
bool | $interface | Is this text in the user interface language? |
MWException |
Definition at line 1754 of file OutputPage.php.
References addWikiTextTitleInternal(), ContextSource\getTitle(), and wfDeprecated().
Convert wikitext in the page content language to HTML and add it to the buffer.
The result with be language-converted to the user's preferred variant. Assumes that the current page title will be used if optional $title is not provided. Output will be tidy.
string | $text | Wikitext in the page content language |
bool | $linestart | Is this the start of a line? (Defaults to true) |
Title | null | $title | Optional title to use; default of null means use current page title. |
MWException | if $title is not provided and OutputPage::getTitle() is null |
Definition at line 1829 of file OutputPage.php.
References addWikiTextTitleInternal(), and ContextSource\getTitle().
Convert wikitext in the user interface language to HTML and add it to the buffer.
The result will not be language-converted, as user interface messages are already localized into a specific variant. Assumes that the current page title will be used if optional $title is not provided. Output will be tidy.
string | $text | Wikitext in the user interface language |
bool | $linestart | Is this the start of a line? (Defaults to true) |
Title | null | $title | Optional title to use; default of null means use current page title. |
MWException | if $title is not provided and OutputPage::getTitle() is null |
Definition at line 1779 of file OutputPage.php.
References addWikiTextTitleInternal(), and ContextSource\getTitle().
Referenced by showPermissionsErrorPage(), and wrapWikiMsg().
OutputPage::addWikiTextTidy | ( | $text, | |
$linestart = true ) |
Add wikitext in content language.
Output will be tidy.
string | $text | Wikitext in content language |
bool | $linestart | Is this the start of a line? |
Definition at line 1878 of file OutputPage.php.
References addWikiTextTitleInternal(), ContextSource\getTitle(), and wfDeprecated().
OutputPage::addWikiTextTitle | ( | $text, | |
Title | $title, | ||
$linestart, | |||
$tidy = false, | |||
$interface = false ) |
Add wikitext with a custom Title object.
Output is unwrapped.
string | $text | Wikitext |
Title | $title | |
bool | $linestart | Is this the start of a line? |
bool | $tidy | Whether to use tidy. Setting this to false (or omitting it) is deprecated since 1.32; all wikitext should be tidied. For backwards-compatibility with prior MW releases, you may wish to invoke this method but set $tidy=true; this will result in equivalent output to the non-deprecated addWikiTextAsContent()/addWikiTextAsInterface() methods. |
bool | $interface | Whether it is an interface message (for example disables conversion) |
Definition at line 1906 of file OutputPage.php.
References addWikiTextTitleInternal(), and wfDeprecated().
|
private |
Add wikitext with a custom Title object.
Output is unwrapped.
string | $text | Wikitext |
Title | $title | |
bool | $linestart | Is this the start of a line? |
bool | $tidy | Whether to use tidy. Setting this to false (or omitting it) is deprecated since 1.32; all wikitext should be tidied. |
bool | $interface | Whether it is an interface message (for example disables conversion) |
string | $wrapperClass | if not empty, wraps the output in a <div class="$wrapperClass"> |
Definition at line 1929 of file OutputPage.php.
References addParserOutput(), parseInternal(), and wfDeprecated().
Referenced by addWikiText(), addWikiTextAsContent(), addWikiTextAsInterface(), addWikiTextTidy(), addWikiTextTitle(), addWikiTextTitleTidy(), addWikiTextWithTitle(), and wrapWikiTextAsInterface().
Add wikitext in content language with a custom Title object.
Output will be tidy.
string | $text | Wikitext in content language |
Title | $title | |
bool | $linestart | Is this the start of a line? |
Definition at line 1865 of file OutputPage.php.
References addWikiTextTitleInternal(), and wfDeprecated().
Add wikitext with a custom Title object.
string | $text | Wikitext |
Title | $title | |
bool | $linestart | Is this the start of a line? |
Definition at line 1850 of file OutputPage.php.
References addWikiTextTitleInternal(), and wfDeprecated().
OutputPage::allowClickjacking | ( | ) |
Turn off frame-breaking.
Alias for $this->preventClickjacking(false). This can be called from pages which do not contain any CSRF-protected HTML form.
Definition at line 2487 of file OutputPage.php.
|
static |
Build message object for a subtitle containing a backlink to a page.
Title | $title | Title to link to |
array | $query | Array of additional parameters to include in the link |
Definition at line 1046 of file OutputPage.php.
References $linkRenderer, $query, and wfMessage().
OutputPage::buildCssLinksArray | ( | ) |
Definition at line 3932 of file OutputPage.php.
References $file, $link, $options, and styleLink().
Referenced by buildExemptModules().
|
protected |
Build exempt modules and legacy non-ResourceLoader styles.
Definition at line 3888 of file OutputPage.php.
References and(), buildCssLinksArray(), makeResourceLoaderLink(), and ResourceLoaderModule\TYPE_STYLES.
Referenced by headElement().
OutputPage::checkLastModified | ( | $timestamp | ) |
checkLastModified tells the client to use the client-cached page if possible.
If successful, the OutputPage is disabled so that any future call to OutputPage->output() have no effect.
Side effect: sets mLastModified for Last-Modified header
string | $timestamp |
Definition at line 741 of file OutputPage.php.
References $value, and(), disable(), getCdnCacheEpoch(), ContextSource\getConfig(), ContextSource\getRequest(), ContextSource\getUser(), sendCacheControl(), wfClearOutputBuffers(), wfDebug(), and wfTimestamp().
OutputPage::clearHTML | ( | ) |
Clear the body HTML.
Definition at line 1594 of file OutputPage.php.
Referenced by prepareErrorPage().
OutputPage::clearSubtitle | ( | ) |
Clear the subtitles.
Definition at line 1068 of file OutputPage.php.
Referenced by prepareErrorPage(), and setSubtitle().
|
staticprotected |
Combine WrappedString chunks and filter out empty ones.
array | $chunks |
Definition at line 3323 of file OutputPage.php.
References and().
OutputPage::disable | ( | ) |
Disable output completely, i.e.
calling output() will have no effect
Definition at line 1101 of file OutputPage.php.
Referenced by checkLastModified().
OutputPage::disallowUserJs | ( | ) |
Do not allow scripts which can be modified by wiki users to load on this page; only allow scripts bundled with, or generated by, the software.
Site-wide styles are controlled by a config setting, since they can be used to create a custom skin/theme, but not user-specific ones.
Definition at line 1514 of file OutputPage.php.
References ContextSource\getConfig(), ResourceLoaderModule\ORIGIN_CORE_INDIVIDUAL, ResourceLoaderModule\ORIGIN_USER_SITEWIDE, reduceAllowedModules(), ResourceLoaderModule\TYPE_SCRIPTS, and ResourceLoaderModule\TYPE_STYLES.
Referenced by output().
OutputPage::enableClientCache | ( | $state | ) |
Use enableClientCache(false) to force it to send nocache headers.
bool | null | $state | New value, or null to not set the value |
Definition at line 2287 of file OutputPage.php.
References wfSetVar().
Referenced by addParserOutputMetadata(), and prepareErrorPage().
OutputPage::enableOOUI | ( | ) |
Add ResourceLoader module styles for OOUI and set up the PHP implementation of it for use with MediaWiki and this OutputPage instance.
Definition at line 4230 of file OutputPage.php.
References addModuleStyles(), and(), ContextSource\getLanguage(), and ContextSource\getSkin().
Referenced by addParserOutputMetadata().
OutputPage::enableSectionEditLinks | ( | $flag = true | ) |
Enables/disables section edit links, doesn't override NOEDITSECTION
bool | $flag |
Definition at line 4194 of file OutputPage.php.
References wfDeprecated().
|
private |
Generate a "<link rel/>" for a feed.
string | $type | Feed type |
string | $url | URL to the feed |
string | $text | Value of the "title" attribute |
Definition at line 3836 of file OutputPage.php.
Referenced by getHeadLinksArray().
|
protected |
Filter an array of modules to remove insufficiently trustworthy members, and modules which are no longer registered (eg a page is cached before an extension is disabled)
array | $modules | |
string | null | $position | Unused |
string | $type |
Definition at line 489 of file OutputPage.php.
References $modules, $resourceLoader, $type, and(), ResourceLoaderModule\getOrigin(), getResourceLoader(), and warnModuleTargetFilter().
Referenced by getModules(), and makeResourceLoaderLink().
OutputPage::forceHideNewSectionLink | ( | ) |
Format a list of error messages.
array | $errors | Array of arrays returned by Title::getUserPermissionsErrors |
string | null | $action | Action that was denied or null if unknown |
Definition at line 2903 of file OutputPage.php.
References ContextSource\msg().
Referenced by showPermissionsErrorPage().
|
protected |
Return effective list of advertised feed types.
Definition at line 1154 of file OutputPage.php.
References ContextSource\getConfig().
Referenced by addFeedLink(), getHeadLinksArray(), and setFeedAppendQuery().
OutputPage::getAllowedModules | ( | $type | ) |
Show what level of JavaScript / CSS untrustworthiness is allowed on this page.
string | $type | ResourceLoaderModule TYPE_ constant |
Definition at line 1539 of file OutputPage.php.
References $type, and(), ResourceLoaderModule\ORIGIN_ALL, and ResourceLoaderModule\TYPE_COMBINED.
Referenced by getRlClient(), and reduceAllowedModules().
OutputPage::getArticleBodyOnly | ( | ) |
Return whether the output will contain only the body of the article.
Definition at line 704 of file OutputPage.php.
OutputPage::getBottomScripts | ( | ) |
JS stuff to put at the bottom of the <body>
.
These are legacy scripts ($this->mScripts), and user JS.
Definition at line 3335 of file OutputPage.php.
References getCSPNonce(), and getRlClient().
OutputPage::getCacheVaryCookies | ( | ) |
Get the list of cookie names that will influence the cache.
Definition at line 2296 of file OutputPage.php.
References and(), and ContextSource\getConfig().
Referenced by getKeyHeader(), getVaryHeader(), and haveCacheVaryCookies().
OutputPage::getCanonicalUrl | ( | ) |
Returns the URL to be used for the <link rel=canonical>> if one is set.
Definition at line 437 of file OutputPage.php.
OutputPage::getCategories | ( | $type = 'all' | ) |
Get the list of category names this page belongs to.
string | $type | The type of categories which should be returned. Possible values:
|
Definition at line 1433 of file OutputPage.php.
Referenced by getJSVars().
OutputPage::getCategoryLinks | ( | ) |
Get the list of category links, in a 2-D array with the following format: $arr[$type][] = $link, where $type is either "normal" or "hidden" (for hidden categories) and $link a HTML fragment with a link to the category page.
Definition at line 1420 of file OutputPage.php.
|
private |
int | $reqTime | Time of request (eg. now) |
int | $maxAge | Cache TTL in seconds |
Definition at line 829 of file OutputPage.php.
References and().
Referenced by checkLastModified().
OutputPage::getCSPNonce | ( | ) |
Get (and set if not yet set) the CSP nonce.
This value needs to be included in any <script> tags on the page.
Definition at line 4255 of file OutputPage.php.
References and(), ContextSource\getConfig(), and ContentSecurityPolicy\isNonceRequired().
Referenced by addInlineScript(), addScriptFile(), getBottomScripts(), getJSVars(), getRlClient(), headElement(), and makeResourceLoaderLink().
OutputPage::getDisplayTitle | ( | ) |
Returns page display title.
Performs some normalization, but this not as strict the magic word.
Definition at line 983 of file OutputPage.php.
References $html, and ContextSource\getTitle().
Referenced by getUnprefixedDisplayTitle().
OutputPage::getFeedAppendQuery | ( | ) |
OutputPage::getFileSearchOptions | ( | ) |
Get the files used on this page.
Definition at line 1738 of file OutputPage.php.
OutputPage::getFileVersion | ( | ) |
Get the displayed file version.
Definition at line 1718 of file OutputPage.php.
OutputPage::getFrameOptions | ( | ) |
Get the X-Frame-Options header value (without the name part), or false if there isn't one.
This is used by Skin to determine whether to enable JavaScript frame-breaking, for clients that don't support X-Frame-Options.
Definition at line 2508 of file OutputPage.php.
References and(), and ContextSource\getConfig().
Referenced by getJSVars(), and output().
OutputPage::getHeadItemsArray | ( | ) |
OutputPage::getHeadLinksArray | ( | ) |
Definition at line 3556 of file OutputPage.php.
References $lang, $link, $query, $type, $wgVersion, and(), array(), feedLink(), getAdvertisedFeedTypes(), ContextSource\getConfig(), getContext(), ContextSource\getRequest(), getSyndicationLinks(), ContextSource\getTitle(), ContextSource\getUser(), isArticleRelated(), messages, ContextSource\msg(), PROTO_CANONICAL, PROTO_RELATIVE, text, wfAppendQuery(), wfExpandUrl(), and wfScript().
Referenced by headElement().
OutputPage::getHTML | ( | ) |
OutputPage::getHTMLTitle | ( | ) |
Return the "HTML title", i.e.
the content of the "<title>" tag.
Definition at line 913 of file OutputPage.php.
Referenced by headElement().
OutputPage::getIndicators | ( | ) |
Get the indicators associated with this page.
The array will be internally ordered by item keys.
Definition at line 1470 of file OutputPage.php.
OutputPage::getJsConfigVars | ( | ) |
Get the javascript config vars to include on this page.
Definition at line 3360 of file OutputPage.php.
Referenced by getJSVars().
OutputPage::getJSVars | ( | ) |
Get an array containing the variables to be set in mw.config in JavaScript.
Do not add things here which can be evaluated in ResourceLoaderStartUpModule
Definition at line 3390 of file OutputPage.php.
References $lang, $services, $type, $vars, and(), ContextSource\canUseWikiPage(), getCategories(), getContext(), getCSPNonce(), getFrameOptions(), getJsConfigVars(), getRevisionId(), ContextSource\getSkin(), ContextSource\getTitle(), ContextSource\getUser(), ContextSource\getWikiPage(), isArticle(), list, NS_SPECIAL, null, and wfTimestamp().
Referenced by getRlClient().
OutputPage::getKeyHeader | ( | ) |
Get a complete Key header.
Definition at line 2395 of file OutputPage.php.
References $header, $options, addVaryHeader(), and(), getCacheVaryCookies(), and wfDeprecated().
Referenced by sendCacheControl().
OutputPage::getLanguageLinks | ( | ) |
Get the list of language links.
Definition at line 1313 of file OutputPage.php.
OutputPage::getLinkHeader | ( | ) |
Return a Link: header.
Based on the values of $mLinkHeader.
Definition at line 2380 of file OutputPage.php.
Referenced by output().
OutputPage::getLinkTags | ( | ) |
Returns the current <link> tags.
Definition at line 417 of file OutputPage.php.
OutputPage::getMetaTags | ( | ) |
Returns the current <meta> tags.
Definition at line 396 of file OutputPage.php.
OutputPage::getModules | ( | $filter = false, | |
$position = null, | |||
$param = 'mModules', | |||
$type = ResourceLoaderModule::TYPE_COMBINED ) |
Get the list of modules to include on this page.
bool | $filter | Whether to filter out insufficiently trustworthy modules |
string | null | $position | Unused |
string | $param | |
string | $type |
Definition at line 533 of file OutputPage.php.
References $filter, $modules, $type, and(), and filterModules().
Referenced by getModuleStyles(), and getRlClient().
OutputPage::getModuleScripts | ( | ) |
Definition at line 555 of file OutputPage.php.
References wfDeprecated().
OutputPage::getModuleStyles | ( | $filter = false, | |
$position = null ) |
Get the list of style-only modules to load on this page.
bool | $filter | |
string | null | $position | Unused |
Definition at line 567 of file OutputPage.php.
References $filter, getModules(), and ResourceLoaderModule\TYPE_STYLES.
Referenced by getRlClient().
|
private |
Get the Origin-Trial header values.
This is used to enable Chrome Origin Trials: https://github.com/GoogleChrome/OriginTrials
Definition at line 2524 of file OutputPage.php.
References ContextSource\getConfig().
Referenced by output().
OutputPage::getPageTitle | ( | ) |
Return the "page title", i.e.
the content of the \<h1\> tag.
Definition at line 960 of file OutputPage.php.
Referenced by headElement().
OutputPage::getPreventClickjacking | ( | ) |
Get the prevent-clickjacking flag.
Definition at line 2497 of file OutputPage.php.
OutputPage::getProperty | ( | $name | ) |
Get an additional output property.
string | $name |
Definition at line 726 of file OutputPage.php.
References $name.
OutputPage::getRedirect | ( | ) |
Get the URL to redirect to, or an empty string if not redirect URL set.
Definition at line 354 of file OutputPage.php.
OutputPage::getResourceLoader | ( | ) |
Get a ResourceLoader object associated with this OutputPage.
Definition at line 3288 of file OutputPage.php.
References and().
Referenced by filterModules(), getRlClient(), getRlClientContext(), headElement(), and warnModuleTargetFilter().
OutputPage::getRevisionId | ( | ) |
Get the displayed revision ID.
Definition at line 1674 of file OutputPage.php.
Referenced by getJSVars().
OutputPage::getRevisionTimestamp | ( | ) |
Get the timestamp of displayed revision.
This will be null if not filled by setRevisionTimestamp().
Definition at line 1695 of file OutputPage.php.
OutputPage::getRlClient | ( | ) |
Call this to freeze the module queue and JS config and create a formatter.
Depending on the Skin, this may get lazy-initialised in either headElement() or getBottomScripts(). See SkinTemplate::prepareQuickTemplate(). Calling this too early may cause unexpected side-effects since disallowUserJs() may be called at any time to change the module filters retroactively. Skins and extension hooks may also add modules until very late in the request lifecycle.
Definition at line 3113 of file OutputPage.php.
References $context, $dbr, $name, addModules(), addModuleStyles(), and(), DB_REPLICA, getAllowedModules(), getCSPNonce(), getJSVars(), getModules(), getModuleStyles(), getResourceLoader(), getRlClientContext(), ContextSource\getSkin(), getTarget(), ResourceLoaderModule\ORIGIN_CORE_INDIVIDUAL, ResourceLoaderClientHtml\setConfig(), ResourceLoaderClientHtml\setExemptStates(), ResourceLoaderClientHtml\setModules(), ResourceLoaderClientHtml\setModuleStyles(), ResourceLoaderModule\TYPE_COMBINED, and wfGetDB().
Referenced by getBottomScripts(), and headElement().
|
private |
Definition at line 3057 of file OutputPage.php.
References $content, $query, and(), ContextSource\getLanguage(), ContextSource\getRequest(), getResourceLoader(), ContextSource\getSkin(), ContextSource\getUser(), and isPrintable().
Referenced by getRlClient(), and makeResourceLoaderLink().
OutputPage::getSubtitle | ( | ) |
OutputPage::getSyndicationLinks | ( | ) |
Return URLs for each supported syndication format for this page.
Definition at line 1207 of file OutputPage.php.
Referenced by getHeadLinksArray().
OutputPage::getTarget | ( | ) |
Definition at line 589 of file OutputPage.php.
Referenced by getRlClient().
OutputPage::getTemplateIds | ( | ) |
Get the templates used on this page.
Definition at line 1728 of file OutputPage.php.
OutputPage::getUnprefixedDisplayTitle | ( | ) |
Returns page display title without namespace prefix if possible.
Definition at line 998 of file OutputPage.php.
References and(), getDisplayTitle(), and ContextSource\getTitle().
OutputPage::getVaryHeader | ( | ) |
Return a Vary: header on which to vary caches.
Based on the keys of $mVaryHeader, such as Accept-Encoding or Cookie
Definition at line 2354 of file OutputPage.php.
References $header, $options, addVaryHeader(), and(), and getCacheVaryCookies().
Referenced by sendCacheControl().
OutputPage::hasHeadItem | ( | $name | ) |
Check if the header item $name is already set.
string | $name | Item name |
Definition at line 674 of file OutputPage.php.
References and().
OutputPage::haveCacheVaryCookies | ( | ) |
Check if the request has a cache-varying cookie header If it does, it's very important that we don't allow public caching.
Definition at line 2317 of file OutputPage.php.
References $request, getCacheVaryCookies(), ContextSource\getRequest(), and wfDebug().
Definition at line 3190 of file OutputPage.php.
References and(), buildExemptModules(), ContextSource\getConfig(), getContext(), getCSPNonce(), getHeadLinksArray(), getHTMLTitle(), ContextSource\getLanguage(), getPageTitle(), getResourceLoader(), getRlClient(), ContextSource\getTitle(), ContextSource\getUser(), ResourceLoaderClientHtml\makeLoad(), ContextSource\msg(), setHTMLTitle(), and ResourceLoaderModule\TYPE_SCRIPTS.
OutputPage::isArticle | ( | ) |
Return whether the content displayed page is related to the source of the corresponding article on the wiki.
Definition at line 1240 of file OutputPage.php.
Referenced by getJSVars(), and showsCopyright().
OutputPage::isArticleRelated | ( | ) |
Return whether this page is related an article on the wiki.
Definition at line 1262 of file OutputPage.php.
Referenced by getHeadLinksArray().
OutputPage::isDisabled | ( | ) |
Return whether the output will be completely disabled.
Definition at line 1110 of file OutputPage.php.
OutputPage::isPrintable | ( | ) |
Return whether the page is "printable".
Definition at line 1094 of file OutputPage.php.
Referenced by getRlClientContext().
OutputPage::isSyndicated | ( | ) |
Should we output feed links for this page?
Definition at line 1199 of file OutputPage.php.
OutputPage::isTOCEnabled | ( | ) |
Whether the output has a table of contents.
Definition at line 4184 of file OutputPage.php.
OutputPage::loadSkinModules | ( | $sk | ) |
Transfer styles and JavaScript modules from skin.
Skin | $sk | to load modules for |
Definition at line 2609 of file OutputPage.php.
References $modules, addModules(), and addModuleStyles().
Referenced by output().
OutputPage::lowerCdnMaxage | ( | $maxage | ) |
Set the value of the "s-maxage" part of the "Cache-control" HTTP header to $maxage if that is lower than the current s-maxage.
Either way, $maxage is now an upper limit on s-maxage, so that future calls to setCdnMaxage() will no longer be able to raise the s-maxage above $maxage.
int | $maxage | Maximum cache time on the CDN, in seconds |
Definition at line 2248 of file OutputPage.php.
References setCdnMaxage().
Referenced by adaptCdnTTL().
OutputPage::makeResourceLoaderLink | ( | $modules, | |
$only, | |||
array | $extraQuery = [] ) |
Explicily load or embed modules on a page.
array | string | $modules | One or more module names |
string | $only | ResourceLoaderModule TYPE_ class constant |
array | $extraQuery | [optional] Array with extra query parameters for the request |
Definition at line 3304 of file OutputPage.php.
References $modules, array(), filterModules(), getCSPNonce(), getRlClientContext(), and ResourceLoaderClientHtml\makeLoad().
Referenced by buildExemptModules().
OutputPage::output | ( | $return = false | ) |
Finally, all the text has been munged and accumulated into the object, let's actually output it:
bool | $return | Set to true to get the result as a string rather than sending it |
Exception | |
FatalError | |
MWException |
Definition at line 2631 of file OutputPage.php.
References $code, $e, $response, addVaryHeader(), and(), disallowUserJs(), ContextSource\getConfig(), getFrameOptions(), getLinkHeader(), getOriginTrials(), ContextSource\getRequest(), ContextSource\getSkin(), loadSkinModules(), print, PROTO_CURRENT, sendCacheControl(), ContentSecurityPolicy\sendHeaders(), wfExpandUrl(), and wfTimestamp().
Parse wikitext and return the HTML.
string | $text | |
bool | $linestart | Is this the start of a line? |
bool | $interface | Use interface language (instead of content language) while parsing language sensitive magic words like GRAMMAR and PLURAL. This also disables LanguageConverter. |
Language | null | $language | Target language object, will override $interface |
MWException |
Definition at line 2092 of file OutputPage.php.
References ContextSource\getTitle(), parseInternal(), and wfDeprecated().
Referenced by showPermissionsErrorPage().
OutputPage::parseAsContent | ( | $text, | |
$linestart = true ) |
Parse wikitext in the page content language and return the HTML.
The result will be language-converted to the user's preferred variant. Output will be tidy.
string | $text | Wikitext in the page content language |
bool | $linestart | Is this the start of a line? (Defaults to true) |
MWException |
Definition at line 2112 of file OutputPage.php.
References ContextSource\getTitle(), and parseInternal().
OutputPage::parseAsInterface | ( | $text, | |
$linestart = true ) |
Parse wikitext in the user interface language and return the HTML.
The result will not be language-converted, as user interface messages are already localized into a specific variant. Output will be tidy.
string | $text | Wikitext in the user interface language |
bool | $linestart | Is this the start of a line? (Defaults to true) |
MWException |
Definition at line 2133 of file OutputPage.php.
References ContextSource\getTitle(), and parseInternal().
Referenced by parseInlineAsInterface().
OutputPage::parseInline | ( | $text, | |
$linestart = true, | |||
$interface = false ) |
Parse wikitext, strip paragraph wrapper, and return the HTML.
string | $text | |
bool | $linestart | Is this the start of a line? |
bool | $interface | Use interface language (instead of content language) while parsing language sensitive magic words like GRAMMAR and PLURAL |
Definition at line 2175 of file OutputPage.php.
References ContextSource\getTitle(), parseInternal(), and wfDeprecated().
OutputPage::parseInlineAsInterface | ( | $text, | |
$linestart = true ) |
Parse wikitext in the user interface language, strip paragraph wrapper, and return the HTML.
The result will not be language-converted, as user interface messages are already localized into a specific variant. Output will be tidy. Outer paragraph wrapper will only be stripped if the result is a single paragraph.
string | $text | Wikitext in the user interface language |
bool | $linestart | Is this the start of a line? (Defaults to true) |
MWException |
Definition at line 2156 of file OutputPage.php.
References parseAsInterface().
|
private |
Parse wikitext and return the HTML (internal implementation helper)
string | $text | |
Title | $title | The title to use |
bool | $linestart | Is this the start of a line? |
bool | $tidy | Whether the output should be tidied |
bool | $interface | Use interface language (instead of content language) while parsing language sensitive magic words like GRAMMAR and PLURAL. This also disables LanguageConverter. |
Language | null | $language | Target language object, will override $interface |
MWException |
Definition at line 2200 of file OutputPage.php.
References $wgParser, and(), and parserOptions().
Referenced by addWikiTextTitleInternal(), parse(), parseAsContent(), parseAsInterface(), and parseInline().
OutputPage::parserOptions | ( | $options = null | ) |
Get/set the ParserOptions object to use for wikitext parsing.
ParserOptions | null | $options | Either the ParserOption to use or null to only get the current ParserOption object. This parameter is deprecated since 1.31. |
Definition at line 1614 of file OutputPage.php.
References $options, and(), getContext(), ContextSource\getUser(), wfDeprecated(), wfGetAllCallers(), wfLogWarning(), and wfSetVar().
Referenced by parseInternal().
OutputPage::prepareErrorPage | ( | $pageTitle, | |
$htmlTitle = false ) |
Prepare this object to display an error page; disable caching and indexing, clear the current text and redirect, set the page's title and optionally an custom HTML title (content of the "<title>" tag).
string | Message | $pageTitle | Will be passed directly to setPageTitle() |
string | Message | $htmlTitle | Will be passed directly to setHTMLTitle(); optional, if not passed the "<title>" attribute will be based on $pageTitle |
Definition at line 2758 of file OutputPage.php.
References clearHTML(), clearSubtitle(), enableClientCache(), setArticleRelated(), setHTMLTitle(), setPageTitle(), and setRobotPolicy().
Referenced by showErrorPage(), showFatalError(), showPermissionsErrorPage(), and versionRequired().
OutputPage::prependHTML | ( | $text | ) |
Prepend $text to the body HTML.
string | $text | HTML |
Definition at line 1565 of file OutputPage.php.
OutputPage::preventClickjacking | ( | $enable = true | ) |
Set a flag which will cause an X-Frame-Options header appropriate for edit pages to be sent.
The header value is controlled by $wgEditPageFrameOptions.
This is the default for special pages. If you display a CSRF-protected form on an ordinary view page, then you need to call this function.
bool | $enable |
Definition at line 2478 of file OutputPage.php.
OutputPage::redirect | ( | $url, | |
$responsecode = '302' ) |
Redirect to $url rather than displaying the normal page.
string | $url | |
string | $responsecode | HTTP status code |
Definition at line 343 of file OutputPage.php.
References and().
OutputPage::reduceAllowedModules | ( | $type, | |
$level ) |
Limit the highest level of CSS/JS untrustworthiness allowed.
If passed the same or a higher level than the current level of untrustworthiness set, the level will remain unchanged.
string | $type | |
int | $level | ResourceLoaderModule class constant |
Definition at line 1556 of file OutputPage.php.
References $type, and getAllowedModules().
Referenced by disallowUserJs().
Add a "return to" link pointing to a specified title, or the title indicated in the request, or else the main page.
mixed | null | $unused | |
Title | string | null | $returnto | Title or String to return to |
string | null | $returntoquery | Query string for the return to link |
Definition at line 3030 of file OutputPage.php.
References addReturnTo(), and(), ContextSource\getRequest(), and wfCgiToArray().
Referenced by showErrorPage(), showPermissionsErrorPage(), and versionRequired().
OutputPage::sectionEditLinksEnabled | ( | ) |
Definition at line 4203 of file OutputPage.php.
References wfDeprecated().
OutputPage::sendCacheControl | ( | ) |
Send cache control HTTP headers.
Definition at line 2533 of file OutputPage.php.
References $response, addAcceptLanguage(), addVaryHeader(), and(), ContextSource\getConfig(), getKeyHeader(), ContextSource\getRequest(), getVaryHeader(), wfDebug(), and wfDeprecated().
Referenced by checkLastModified(), and output().
OutputPage::setArticleBodyOnly | ( | $only | ) |
Set whether the output should only contain the body of the article, without any skin, sidebar, etc.
Used e.g. when calling with "action=render".
bool | $only | Whether to output only the body of the article |
Definition at line 695 of file OutputPage.php.
OutputPage::setArticleFlag | ( | $newVal | ) |
Set whether the displayed content is related to the source of the corresponding article on the wiki Setting true will cause the change "article related" toggle to true.
bool | $newVal |
Definition at line 1227 of file OutputPage.php.
References and().
OutputPage::setArticleRelated | ( | $newVal | ) |
Set whether this page is related an article on the wiki Setting false will cause the change of "article flag" toggle to false.
bool | $newVal |
Definition at line 1250 of file OutputPage.php.
References and().
Referenced by prepareErrorPage().
OutputPage::setCanonicalUrl | ( | $url | ) |
Set the URL to be used for the <link rel=canonical>>.
This should be used in preference to addLink(), to avoid duplicate link tags.
string | $url |
Definition at line 426 of file OutputPage.php.
OutputPage::setCategoryLinks | ( | array | $categories | ) |
Reset the category links (but not the category list) and add $categories.
array | $categories | Mapping category name => sort key |
Definition at line 1407 of file OutputPage.php.
References addCategoryLinks().
OutputPage::setCdnMaxage | ( | $maxage | ) |
Set the value of the "s-maxage" part of the "Cache-control" HTTP header.
int | $maxage | Maximum cache time on the CDN, in seconds. |
Definition at line 2235 of file OutputPage.php.
Referenced by lowerCdnMaxage().
OutputPage::setCopyright | ( | $hasCopyright | ) |
Set whether the standard copyright should be shown for the current page.
bool | $hasCopyright |
Definition at line 1271 of file OutputPage.php.
References and().
OutputPage::setCopyrightUrl | ( | $url | ) |
Set the copyright URL to send with the output.
Empty string to omit, null to reset.
string | null | $url |
Definition at line 366 of file OutputPage.php.
OutputPage::setDisplayTitle | ( | $html | ) |
Same as page title but only contains name of the page, not any other text.
string | $html | Page title text. |
Definition at line 971 of file OutputPage.php.
References $html.
OutputPage::setFeedAppendQuery | ( | $val | ) |
Add default feeds to the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version.
string | $val | Query to append to feed links or false to output default links |
Definition at line 1171 of file OutputPage.php.
References $query, $type, and(), getAdvertisedFeedTypes(), and ContextSource\getTitle().
Referenced by setSyndicated().
OutputPage::setFileVersion | ( | $file | ) |
Set the displayed file version.
File | null | $file |
Definition at line 1705 of file OutputPage.php.
References File\exists(), and wfSetVar().
OutputPage::setFollowPolicy | ( | $policy | ) |
Set the follow policy for the page, but leave the index policy un- touched.
string | $policy | Either 'follow' or 'nofollow'. |
Definition at line 887 of file OutputPage.php.
References and().
Referenced by setRobotPolicy().
OutputPage::setHTMLTitle | ( | $name | ) |
"HTML title" means the contents of "<title>".
It is stored as plain, unescaped text and will be run through htmlspecialchars in the skin file.
string | Message | $name |
Definition at line 900 of file OutputPage.php.
References $name, and getContext().
Referenced by headElement(), prepareErrorPage(), and setPageTitle().
OutputPage::setIndexPolicy | ( | $policy | ) |
Set the index policy for the page, but leave the follow policy un- touched.
string | $policy | Either 'index' or 'noindex'. |
Definition at line 873 of file OutputPage.php.
References and().
Referenced by setRobotPolicy().
OutputPage::setIndicators | ( | array | $indicators | ) |
Add an array of indicators, with their identifiers as array keys and HTML contents as values.
In case of duplicate keys, existing values are overwritten.
array | $indicators |
Definition at line 1456 of file OutputPage.php.
References and().
Referenced by addHelpLink(), and addParserOutputMetadata().
OutputPage::setLanguageLinks | ( | array | $newLinkArray | ) |
Reset the language links and add new language links.
string[] | $newLinkArray | Array of interwiki-prefixed (non DB key) titles (e.g. 'fr:Test page') |
Definition at line 1304 of file OutputPage.php.
References and().
OutputPage::setLastModified | ( | $timestamp | ) |
Override the last modified timestamp.
string | $timestamp | New timestamp, in a format readable by wfTimestamp() |
Definition at line 843 of file OutputPage.php.
References wfTimestamp().
OutputPage::setPageTitle | ( | $name | ) |
"Page title" means the contents of \<h1\>.
It is stored as a valid HTML fragment. This function allows good tags like \<sup\> in the \<h1\> tag, but not bad tags like \<script\>. This function automatically sets \<title\> to the same content as \<h1\> but with all tags removed. Bad tags that were escaped in \<h1\> will still be escaped in \<title\>, and good tags like \<i\> will be dropped entirely.
string | Message | $name | |
-taint | $name | tainted Phan-taint-check gets very confused by $name being either a string or a Message |
Definition at line 938 of file OutputPage.php.
References and(), getContext(), ContextSource\msg(), and setHTMLTitle().
Referenced by prepareErrorPage().
OutputPage::setPrintable | ( | ) |
Set the page as printable, i.e.
it'll be displayed with all print styles included
Definition at line 1085 of file OutputPage.php.
OutputPage::setProperty | ( | $name, | |
$value ) |
Set an additional output property.
string | $name | |
mixed | $value |
Definition at line 715 of file OutputPage.php.
OutputPage::setRedirectedFrom | ( | $t | ) |
Set $mRedirectedFrom, the Title of the page which redirected us to the current page.
Title | $t |
Definition at line 922 of file OutputPage.php.
References $t.
OutputPage::setRevisionId | ( | $revid | ) |
Set the revision ID which will be seen by the wiki text parser for things such as embedded {{REVISIONID}} variable use.
int | null | $revid | A positive integer, or null |
Definition at line 1664 of file OutputPage.php.
References and(), null, and wfSetVar().
OutputPage::setRevisionTimestamp | ( | $timestamp | ) |
Set the timestamp of the revision which will be displayed.
This is used to avoid a extra DB call in Skin::lastModified().
string | null | $timestamp |
Definition at line 1685 of file OutputPage.php.
References wfSetVar().
OutputPage::setRobotPolicy | ( | $policy | ) |
Set the robot policy for the page: http://www.robotstxt.org/meta.html
string | $policy | The literal string to output as the contents of the meta tag. Will be parsed according to the spec and output in standardized form. |
Definition at line 855 of file OutputPage.php.
References and(), Article\formatRobotPolicy(), setFollowPolicy(), and setIndexPolicy().
Referenced by prepareErrorPage().
OutputPage::setStatusCode | ( | $statusCode | ) |
Set the HTTP status code to send with the output.
int | $statusCode |
Definition at line 375 of file OutputPage.php.
References and().
OutputPage::setSubtitle | ( | $str | ) |
Replace the subtitle with $str.
string | Message | $str | New value of the subtitle. String should be safe HTML. |
Definition at line 1020 of file OutputPage.php.
References addSubtitle(), and clearSubtitle().
OutputPage::setSyndicated | ( | $show = true | ) |
Add or remove feed links in the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version.
bool | $show | True: add default feeds, false: remove all feeds |
Definition at line 1140 of file OutputPage.php.
References setFeedAppendQuery().
OutputPage::setTarget | ( | $target | ) |
Sets ResourceLoader target for load.php links.
If null, will be omitted
string | null | $target |
Definition at line 598 of file OutputPage.php.
OutputPage::setTitle | ( | Title | $t | ) |
Set the Title object to use.
Title | $t |
Definition at line 1011 of file OutputPage.php.
References getContext().
|
static |
Helper function to setup the PHP implementation of OOUI to use in this request.
string | $skinName | The Skin name to determine the correct OOUI theme |
string | $dir | Language direction |
Definition at line 4215 of file OutputPage.php.
References and().
OutputPage::showErrorPage | ( | $title, | |
$msg, | |||
$params = [] ) |
Output a standard error page.
showErrorPage( 'titlemsg', 'pagetextmsg' ); showErrorPage( 'titlemsg', 'pagetextmsg', [ 'param1', 'param2' ] ); showErrorPage( 'titlemsg', $messageObject ); showErrorPage( $titleMessageObject, $messageObject );
string | Message | $title | Message key (string) for page title, or a Message object |
string | Message | $msg | Message key (string) for page text, or a Message object |
array | $params | Message parameters; ignored if $msg is a Message object |
Definition at line 2783 of file OutputPage.php.
References $params, addHTML(), addWikiMsgArray(), and(), ContextSource\msg(), prepareErrorPage(), and returnToMain().
OutputPage::showFatalError | ( | $message | ) |
Output an error page.
string | $message | Error to output. Must be escaped for HTML. |
Definition at line 2960 of file OutputPage.php.
References addHTML(), ContextSource\msg(), and prepareErrorPage().
Referenced by showFileCopyError(), showFileDeleteError(), showFileNotFoundError(), showFileRenameError(), and showUnexpectedValueError().
OutputPage::showFileCopyError | ( | $old, | |
$new ) |
Definition at line 2977 of file OutputPage.php.
References ContextSource\msg(), showFatalError(), and wfDeprecated().
OutputPage::showFileDeleteError | ( | $name | ) |
Definition at line 2993 of file OutputPage.php.
References ContextSource\msg(), showFatalError(), and wfDeprecated().
OutputPage::showFileNotFoundError | ( | $name | ) |
Definition at line 3001 of file OutputPage.php.
References ContextSource\msg(), showFatalError(), and wfDeprecated().
OutputPage::showFileRenameError | ( | $old, | |
$new ) |
Definition at line 2985 of file OutputPage.php.
References ContextSource\msg(), showFatalError(), and wfDeprecated().
OutputPage::showLagWarning | ( | $lag | ) |
Show a warning about replica DB lag.
If the lag is higher than $wgSlaveLagCritical seconds, then the warning is a bit more obvious. If the lag is lower than $wgSlaveLagWarning, then no warning is shown.
int | $lag | Replica lag |
Definition at line 2942 of file OutputPage.php.
References and(), ContextSource\getConfig(), ContextSource\getLanguage(), and wrapWikiMsg().
OutputPage::showNewSectionLink | ( | ) |
Output a standard permission error page.
array | $errors | Error message keys or [key, param...] arrays |
string | null | $action | Action that was denied or null if unknown |
Definition at line 2810 of file OutputPage.php.
References $linkRenderer, $query, $request, addHTML(), addWikiTextAsInterface(), and(), array(), formatPermissionsErrorMessage(), ContextSource\getRequest(), ContextSource\getUser(), User\groupHasPermission(), ContextSource\msg(), parse(), prepareErrorPage(), PROTO_RELATIVE, returnToMain(), text, and wfArrayToCgi().
OutputPage::showsCopyright | ( | ) |
Return whether the standard copyright should be shown for the current page.
By default, it is true for all articles but other pages can signal it by using setCopyright( true ).
Used by SkinTemplate to decided whether to show the copyright.
Definition at line 1284 of file OutputPage.php.
References isArticle().
OutputPage::showUnexpectedValueError | ( | $name, | |
$val ) |
Definition at line 2969 of file OutputPage.php.
References ContextSource\msg(), showFatalError(), and wfDeprecated().
|
protected |
Generate \<link\> tags for stylesheets.
string | $style | URL to the file |
array | $options | Option, can contain 'condition', 'dir', 'media' keys |
Definition at line 3951 of file OutputPage.php.
References $link, $options, and(), ContextSource\getConfig(), and ContextSource\getLanguage().
Referenced by buildCssLinksArray().
|
static |
Transform "media" attribute based on request parameters.
string | $media | Current value of the "media" attribute |
Definition at line 4066 of file OutputPage.php.
References $wgRequest, and and().
|
static |
Utility method for transformResourceFilePath().
Caller is responsible for ensuring the file exists. Emits a PHP warning otherwise.
string | $remotePathPrefix | URL path prefix that points to $localPath |
string | $localPath | File directory exposed at $remotePath |
string | $file | Path to target file relative to $localPath |
Definition at line 4050 of file OutputPage.php.
References and(), and wfLogWarning().
|
static |
Transform path to web-accessible static resource.
This is used to add a validation hash as query string. This aids various behaviors:
Avoid using this for urls included in HTML as otherwise clients may get different versions of a resource when navigating the site depending on when the page was cached. If changes to the url propagate, this is not a problem (e.g. if the url is in an external stylesheet).
Config | $config | |
string | $path | Path-absolute URL to file (from document root, must start with "/") |
Definition at line 4008 of file OutputPage.php.
References $IP, $path, and(), and Config\get().
OutputPage::userCanPreview | ( | ) |
To make it harder for someone to slip a user a fake JavaScript or CSS preview, a random token is associated with the login session.
If it's not passed back with the preview request, we won't render the code.
Definition at line 3525 of file OutputPage.php.
References $request, ContextSource\getRequest(), ContextSource\getTitle(), and ContextSource\getUser().
OutputPage::versionRequired | ( | $version | ) |
Display an error page indicating that a given version of MediaWiki is required to use it.
mixed | $version | The version of MediaWiki needed to use the page |
Definition at line 2889 of file OutputPage.php.
References addWikiMsg(), ContextSource\msg(), prepareErrorPage(), and returnToMain().
|
private |
Definition at line 509 of file OutputPage.php.
References and(), and getResourceLoader().
Referenced by filterModules().
OutputPage::wrapWikiMsg | ( | $wrap | ) |
This function takes a number of message/argument specifications, wraps them in some overall structure, and then parses the result and adds it to the output.
In the $wrap, $1 is replaced with the first message, $2 with the second, and so on. The subsequent arguments may be either 1) strings, in which case they are message names, or 2) arrays, in which case, within each array, the first element is the message name, and subsequent elements are the parameters to that message.
Don't use this for messages that are not in the user's interface language.
For example:
$wgOut->wrapWikiMsg( "<div class='error'>\\n$1\\n</div>", 'some-error' );
Is equivalent to:
$wgOut->addWikiTextAsInterface( "<div class='error'>\\n" . wfMessage( 'some-error' )->plain() . "\\n</div>" );
The newline after the opening div is needed in some wikitext. See T21226.
string | $wrap |
Definition at line 4154 of file OutputPage.php.
References $args, $s, addWikiTextAsInterface(), and(), ContextSource\msg(), plain, and wfDeprecated().
Referenced by showLagWarning().
OutputPage::wrapWikiTextAsInterface | ( | $wrapperClass, | |
$text ) |
Convert wikitext in the user interface language to HTML and add it to the buffer with a <div class="$wrapperClass">
wrapper.
The result will not be language-converted, as user interface messages as already localized into a specific variant. The $text will be parsed in start-of-line context. Output will be tidy.
string | $wrapperClass | The class attribute value for the wrapper in the output HTML |
string | $text | Wikitext in the user interface language |
Definition at line 1804 of file OutputPage.php.
References addWikiTextTitleInternal(), and ContextSource\getTitle().
A cache of the names of the cookies that will influence the cache.
Definition at line 325 of file OutputPage.php.
|
private |
Definition at line 310 of file OutputPage.php.
|
private |
Definition at line 307 of file OutputPage.php.
|
private |
The URL to send in a <link> element with rel=license.
Definition at line 301 of file OutputPage.php.
|
private |
The nonce for Content-Security-Policy.
Definition at line 320 of file OutputPage.php.
|
private |
The displayed title of the page.
Different from page title if overridden by display title magic word or hooks. Can contain safe HTML. Different from page title which may contain messages such as "Editing X" which is displayed in h1. This can be used for other places where the page name is referred on the page.
Definition at line 67 of file OutputPage.php.
|
private |
Profiling data.
Definition at line 304 of file OutputPage.php.
|
protected |
Additional <body> classes; there are also <body> classes from other sources.
Definition at line 150 of file OutputPage.php.
|
protected |
What level of 'untrustworthiness' is allowed in CSS/JS modules loaded on this page?
Definition at line 189 of file OutputPage.php.
|
private |
Flag if output should only contain the body of the article.
Definition at line 218 of file OutputPage.php.
string OutputPage::$mBodytext = '' |
Contains all of the "<body>" content.
Should be private we got set/get accessors and the append() method.
Definition at line 73 of file OutputPage.php.
|
protected |
Definition at line 54 of file OutputPage.php.
|
protected |
Definition at line 118 of file OutputPage.php.
|
protected |
Definition at line 115 of file OutputPage.php.
|
protected |
|
protected |
Upper limit on mCdnMaxage.
Definition at line 236 of file OutputPage.php.
|
protected |
Definition at line 199 of file OutputPage.php.
|
protected |
Whether output is disabled.
If this is true, the 'output' method will do nothing.
Definition at line 194 of file OutputPage.php.
|
protected |
Definition at line 215 of file OutputPage.php.
|
private |
Whether parser output contains a table of contents.
Definition at line 296 of file OutputPage.php.
|
private |
Handles the Atom / RSS links.
We probably only support Atom in 2011.
Definition at line 212 of file OutputPage.php.
|
protected |
Definition at line 182 of file OutputPage.php.
Definition at line 252 of file OutputPage.php.
|
private |
Definition at line 265 of file OutputPage.php.
|
private |
Is the content subject to copyright.
Definition at line 88 of file OutputPage.php.
|
protected |
Array of elements in "<head>".
Parser might add its own headers!
Definition at line 147 of file OutputPage.php.
|
protected |
Definition at line 224 of file OutputPage.php.
|
private |
Stores contents of "<title>" tag.
Definition at line 76 of file OutputPage.php.
|
protected |
Definition at line 177 of file OutputPage.php.
|
private |
Definition at line 264 of file OutputPage.php.
|
protected |
Definition at line 124 of file OutputPage.php.
|
protected |
|
private |
Is the displayed content related to the source of the corresponding wiki article.
Definition at line 82 of file OutputPage.php.
|
private |
Stores "article flag" toggle.
Definition at line 85 of file OutputPage.php.
|
protected |
Definition at line 171 of file OutputPage.php.
|
private |
Array of Interwiki Prefixed (non DB key) Titles (e.g.
'fr:Test page')
Definition at line 127 of file OutputPage.php.
|
protected |
Used for sending cache control.
The whole caching system should probably be moved into its own class.
Definition at line 112 of file OutputPage.php.
|
private |
Link: header contents.
Definition at line 315 of file OutputPage.php.
|
protected |
Definition at line 51 of file OutputPage.php.
|
protected |
Should be private.
Used with addMeta() which adds "<meta>"
Definition at line 48 of file OutputPage.php.
|
protected |
Definition at line 153 of file OutputPage.php.
|
protected |
Definition at line 156 of file OutputPage.php.
|
protected |
Definition at line 221 of file OutputPage.php.
bool OutputPage::$mNoGallery = false |
Comes from the parser.
This was probably made to load CSS/JS only if we had "<gallery>". Used directly in CategoryPage.php. Looks like ResourceLoader can replace this.
Definition at line 231 of file OutputPage.php.
string OutputPage::$mPageLinkTitle = '' |
Used by skin template.
Example: $tpl->set( 'displaytitle', $out->mPageLinkTitle );
Definition at line 144 of file OutputPage.php.
|
private |
The contents of.
Definition at line 58 of file OutputPage.php.
|
protected |
lazy initialised, use parserOptions()
Definition at line 205 of file OutputPage.php.
|
protected |
Controls if anti-clickjacking / frame-breaking headers will be sent.
This should be done for pages where edit actions are possible. Setters: $this->preventClickjacking() and $this->allowClickjacking().
Definition at line 243 of file OutputPage.php.
|
private |
We have to set isPrintable().
Some pages should never be printed (ex: redirections).
Definition at line 94 of file OutputPage.php.
|
private |
Additional key => value data.
Definition at line 286 of file OutputPage.php.
string OutputPage::$mRedirect = '' |
Definition at line 103 of file OutputPage.php.
string OutputPage::$mRedirectCode = '' |
Definition at line 180 of file OutputPage.php.
If the current page was reached through a redirect, $mRedirectedFrom contains the Title of the redirect.
Definition at line 281 of file OutputPage.php.
|
protected |
Definition at line 159 of file OutputPage.php.
|
private |
To include the variable {{REVISIONID}}.
Definition at line 246 of file OutputPage.php.
|
private |
Definition at line 249 of file OutputPage.php.
|
private |
Used for JavaScript (predates ResourceLoader)
Definition at line 135 of file OutputPage.php.
|
protected |
Definition at line 106 of file OutputPage.php.
|
private |
Contains the page subtitle.
Special pages usually have some links here. Don't confuse with site subtitle added by skins.
Definition at line 100 of file OutputPage.php.
ResourceLoader target for load.php links.
If null, will be omitted
Definition at line 291 of file OutputPage.php.
|
protected |
Definition at line 174 of file OutputPage.php.
|
private |
Headers that cause the cache to vary.
Key is header name, value is an array of options for the Key header.
Definition at line 271 of file OutputPage.php.
|
private |
Definition at line 162 of file OutputPage.php.
|
private |
Definition at line 165 of file OutputPage.php.
|
private |
Definition at line 168 of file OutputPage.php.
|
protected |
An array of stylesheet filenames (relative from skins path), with options for CSS media, IE conditions, and RTL/LTR direction.
For internal use; add settings in the skin via $this->addStyle()
Style again! This seems like a code duplication since we already have mStyles. This is what makes Open Source amazing.
Definition at line 262 of file OutputPage.php.