MediaWiki  REL1_24
OutputPage Class Reference

This class should be covered by a general architecture document which does not exist as of January 2011. More...

Inheritance diagram for OutputPage:
Collaboration diagram for OutputPage:

List of all members.

Public Member Functions

 __construct (IContextSource $context=null)
 Constructor for OutputPage.
 addAcceptLanguage ()
 bug 21672: Add Accept-Language to Vary and XVO headers if there's no 'variant' parameter existed in GET.
 addBacklinkSubtitle (Title $title, $query=array())
 Add a subtitle containing a backlink to a page.
 addCategoryLinks (array $categories)
 Add an array of categories, with names in the keys.
 addElement ($element, array $attribs=array(), $contents= '')
 Shortcut for adding an Html::element via addHTML.
 addExtensionStyle ($url)
 Register and add a stylesheet from an extension directory.
 addFeedLink ($format, $href)
 Add a feed link to the page header.
 addHeadItem ($name, $value)
 Add or replace an header item to the output.
 addHTML ($text)
 Append $text to the body HTML.
 addInlineScript ($script)
 Add a self-contained script tag with the given contents.
 addInlineStyle ($style_css, $flip= 'noflip')
 Adds inline CSS styles.
 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.
 addMeta ($name, $val)
 Add a new "<meta>" tag To add an http-equiv meta tag, precede the name with "http:".
 addMetadataLink (array $linkarr)
 Add a new <link> with "rel" attribute set to "meta".
 addModuleMessages ($modules)
 Add only messages of one or more modules recognized by the resource loader.
 addModules ($modules)
 Add one or more modules recognized by the resource loader.
 addModuleScripts ($modules)
 Add only JS of one or more modules recognized by the resource loader.
 addModuleStyles ($modules)
 Add only CSS of one or more modules recognized by the resource loader.
 addParserOutput ($parserOutput)
 Add everything from a ParserOutput object.
 addParserOutputContent ($parserOutput)
 Add the HTML and enhancements for it (like ResourceLoader modules) associated with a ParserOutput object, without any other metadata.
 addParserOutputMetadata ($parserOutput)
 Add all metadata associated with a ParserOutput object, but without the actual HTML.
 addParserOutputNoText ($parserOutput)
 Add a ParserOutput object, but without Html.
 addParserOutputText ($parserOutput)
 Add the HTML associated with a ParserOutput object, without any metadata.
 addReturnTo ($title, array $query=array(), $text=null, $options=array())
 Add a "return to" link pointing to a specified title.
 addScript ($script)
 Add raw HTML to the list of scripts (including <script> tag, etc.)
 addScriptFile ($file, $version=null)
 Add a JavaScript file out of skins/common, or a given relative path.
 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, $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.
 addWikiTextTidy ($text, $linestart=true)
 Add wikitext with tidy enabled.
 addWikiTextTitle ($text, Title $title, $linestart, $tidy=false, $interface=false)
 Add wikitext with a custom Title object.
 addWikiTextTitleTidy ($text, &$title, $linestart=true)
 Add wikitext with a custom Title object and tidy enabled.
 addWikiTextWithTitle ($text, &$title, $linestart=true)
 Add wikitext with a custom Title object.
 allowClickjacking ()
 Turn off frame-breaking.
 appendSubtitle ($str)
 Add $str to the subtitle.
 blockedPage ()
 Produce a "user is blocked" page.
 buildCssLinks ()
 Build a set of "<link>" elements for the stylesheets specified in the $this->styles array.
 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 ()
 Restrict the page to loading modules bundled the software.
 enableClientCache ($state)
 Use enableClientCache(false) to force it to send nocache headers.
 enableSectionEditLinks ($flag=true)
 Enables/disables section edit links, doesn't override __NOEDITSECTION__.
 enableTOC ($flag=true)
 Enables/disables TOC, doesn't override __NOTOC__.
 forceHideNewSectionLink ()
 Forcibly hide the new section link?
 formatPermissionsErrorMessage (array $errors, $action=null)
 Format a list of error messages.
 getAllowedModules ($type=null)
 Get the level of JavaScript / CSS untrustworthiness 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 cookies that will influence on the cache.
 getCategories ()
 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.
 getExtStyle ()
 Get all styles added by extensions.
 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.
 getHeadItems ()
 Get all header items in a string.
 getHeadItemsArray ()
 Get an array of head items.
 getHeadLinks ()
 getHeadLinksArray ()
 getHeadScripts ()
 JS stuff to put in the "<head>".
 getHTML ()
 Get the body HTML.
 getHTMLTitle ()
 Return the "HTML title", i.e.
 getJsConfigVars ()
 Get the javascript config vars to include on this page.
 getLanguageLinks ()
 Get the list of language links.
 getMetadataAttribute ()
 Get the value of the "rel" attribute for metadata links.
 getModuleMessages ($filter=false, $position=null)
 Get the list of module messages to include on this page.
 getModules ($filter=false, $position=null, $param= 'mModules')
 Get the list of modules to include on this page.
 getModuleScripts ($filter=false, $position=null)
 Get the list of module JS to include on this page.
 getModuleStyles ($filter=false, $position=null)
 Get the list of module CSS to include on this page.
 getPageTitle ()
 Return the "page title", i.e.
 getPageTitleActionText ()
 Get the value of the "action text".
 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.
 getScript ()
 Get all registered JS and CSS tags for the header.
 getScriptsForBottomQueue ($inHead)
 JS stuff to put at the 'bottom', which can either be the bottom of the "<body>" or the bottom of the "<head>" depending on $wgResourceLoaderExperimentalAsyncLoading: modules marked with position 'bottom', legacy scripts ($this->mScripts), user preferences, site JS and user JS.
 getSubtitle ()
 Get the subtitle.
 getSyndicationLinks ()
 Return URLs for each supported syndication format for this page.
 getTarget ()
 getTemplateIds ()
 Get the templates used on this page.
 getVaryHeader ()
 Return a Vary: header on which to vary caches.
 getXVO ()
 Get a complete X-Vary-Options header.
 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)
 includeJQuery (array $modules=array())
 Include jQuery core.
 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 ()
 loginToUse ()
 Produce the stock "please login to use the wiki" page.
 out ($ins)
 Actually output something with print.
 output ()
 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.
 parseInline ($text, $linestart=true, $interface=false)
 Parse wikitext, strip paragraphs, and return the HTML.
 parserOptions ($options=null)
 Get/set the ParserOptions object to use for wikitext parsing.
 permissionRequired ($permission)
 Display an error page noting that a given permission bit is required.
 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.
 rateLimited ()
 Turn off regular page output and return an error response for when rate limiting has triggered.
 readOnlyPage ($source=null, $protected=false, array $reasons=array(), $action=null)
 Display a page stating that the Wiki is in read-only mode, and optionally show the source of the page that the user was trying to edit.
 redirect ($url, $responsecode= '302')
 Redirect to $url rather than displaying the normal page.
 reduceAllowedModuleOrigin ($level)
 Limit the highest level of CSS/JS untrustworthiness allowed.
 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.
 setAllowedModules ($type, $level)
 Set the highest level of CSS/JS untrustworthiness allowed.
 setArticleBodyOnly ($only)
 Set whether the output should only contain the body of the article, without any skin, sidebar, etc.
 setArticleFlag ($v)
 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 ($v)
 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.
 setETag ($tag)
 Set the value of the ETag HTTP header, only used if $wgUseETag is true.
 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.
 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>.
 setPageTitleActionText ($text)
 Set the new value of the "action text", this will be added to the "HTML title", separated from it with " - ".
 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>
 setSquidMaxage ($maxage)
 Set the value of the "s-maxage" part of the "Cache-control" HTTP header.
 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=array())
 Output a standard error page.
 showFatalError ($message)
 showFileCopyError ($old, $new)
 showFileDeleteError ($name)
 showFileNotFoundError ($name)
 showFileRenameError ($old, $new)
 showLagWarning ($lag)
 Show a warning about slave lag.
 showNewSectionLink ()
 Show an "add new section" link?
 showPermissionsErrorPage (array $errors, $action=null)
 Output a standard permission error page.
 showUnexpectedValueError ($name, $val)
 userCanPreview ()
 To make it harder for someone to slip a user a fake user-JavaScript or user-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.

Static Public Member Functions

static transformCssMedia ($media)
 Transform "media" attribute based on request parameters.

Public Attributes

 $mBodytext = ''
 $mDebugtext = ''
 Holds the debug lines that will be output as comments in page source if $wgDebugComments is enabled.
 $mNoGallery = false
string $mPageLinkTitle = ''
 Used by skin template.
string $mPagetitle = ''
 Should be private - has getter and setter.
string $mRedirect = ''
 *
string $mRedirectCode = ''
 *

Protected Member Functions

 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)
 makeResourceLoaderLink ($modules, $only, $useESI=false, array $extraQuery=array(), $loadCall=false)
 styleLink ($style, array $options)
 Generate <link> tags for stylesheets.

Static Protected Member Functions

static getHtmlFromLoaderLinks (array $links)
 Build html output from an array of links from makeResourceLoaderLink.

Protected Attributes

int $mAllowedModuleOrigin = ResourceLoaderModule::ORIGIN_ALL
 The level of 'untrustworthiness' allowed for modules loaded on this page.
bool $mCanonicalUrl = false
 *
array $mCategories = array()
 *
array $mCategoryLinks = array()
 *
int $mContainsNewMagic = 0
 *
bool $mDoNothing = false
 Whether output is disabled.
 $mEnableClientCache = true
array $mExtStyles = array()
 Additional stylesheets.
 $mFeedLinksAppendQuery = null
array $mFileVersion = null
 *
array $mHeadItems = array()
 Array of elements in "<head>".
bool $mHideNewSectionLink = false
 *
array $mImageTimeKeys = array()
 *
string $mInlineStyles = ''
 Inline CSS styles.
 $mJQueryDone = false
 Whether jQuery is already handled.
array $mJsConfigVars = array()
 *
string $mLastModified = ''
 Variable mLastModified and mEtag are used for sending cache control.
array $mLinktags = array()
 *
array $mMetatags = array()
 Should be private.
array $mModuleMessages = array()
 *
array $mModules = array()
 *
array $mModuleScripts = array()
 *
array $mModuleStyles = array()
 *
bool $mNewSectionLink = false
 *
ParserOptions $mParserOptions = null
 lazy initialised, use parserOptions()
bool $mPreventClickjacking = true
ResourceLoader $mResourceLoader
 *
int $mSquidMaxage = 0
 Cache stuff.
int $mStatusCode
 *
array $mTemplateIds = array()
 *
 $styles = array()

Private Member Functions

 feedLink ($type, $url, $text)
 Generate a "<link rel/>" for a feed.
 getJSVars ()
 Get an array containing the variables to be set in mw.config in JavaScript.

Private Attributes

bool $mArticleBodyOnly = false
 Flag if output should only contain the body of the article.
int $mContainsOldMagic = 0
bool $mEnableSectionEditLinks = true
 Whether parser output should contain section edit links.
bool $mEnableTOC = true
 Whether parser output should contain table of contents.
 $mETag = false
 Contains an HTTP Entity Tags (see RFC 2616 section 3.13) which is used as a unique identifier for the content.
 $mFeedLinks = array()
 Handles the Atom / RSS links.
 $mFollowPolicy = 'follow'
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()
 Array of Interwiki Prefixed (non DB key) Titles (e.g.
 $mLinkColours
string $mPageTitleActionText = ''
 *
array $mParseWarnings = array()
 *
bool $mPrintable = false
 We have to set isPrintable().
 $mProperties = array()
 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 (pre resource loader)
array $mSubtitle = array()
 Contains the page subtitle.
string null $mTarget = null
 ResourceLoader target for load.php links.
 $mVaryHeader

Detailed Description

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 ...).

Todo:
FIXME: Another class handles sending the whole page to the client.

Some comments comes from a pairing session between Zak Greant and Antoine Musso in November 2010.

Todo:
document

Definition at line 38 of file OutputPage.php.


Constructor & Destructor Documentation

OutputPage::__construct ( IContextSource context = null)

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.

Parameters:
IContextSource | null$context

Definition at line 267 of file OutputPage.php.


Member Function Documentation

bug 21672: Add Accept-Language to Vary and XVO headers if there's no 'variant' parameter existed in GET.

For example: /w/index.php?title=Main_page should always be served; but /w/index.php?title=Main_page&variant=zh-cn should never be served.

Definition at line 1888 of file OutputPage.php.

OutputPage::addBacklinkSubtitle ( Title title,
query = array() 
)

Add a subtitle containing a backlink to a page.

Parameters:
Title$titleTitle to link to
array$queryArray of additional parameters to include in the link

Definition at line 958 of file OutputPage.php.

Add an array of categories, with names in the keys.

Parameters:
array$categoriesMapping category name => sort key

Definition at line 1187 of file OutputPage.php.

OutputPage::addElement ( element,
array attribs = array(),
contents = '' 
)

Shortcut for adding an Html::element via addHTML.

Since:
1.19
Parameters:
string$element
array$attribs
string$contents

Definition at line 1374 of file OutputPage.php.

Register and add a stylesheet from an extension directory.

Parameters:
string$urlPath to sheet. Provide either a full url (beginning with 'http', etc) or a relative path from the document root (beginning with '/'). Otherwise it behaves identically to addStyle() and draws from the /skins folder.

Definition at line 382 of file OutputPage.php.

References addLink(), and getMetadataAttribute().

OutputPage::addFeedLink ( format,
href 
)

Add a feed link to the page header.

Parameters:
string$formatFeed type, should be a key of $wgFeedClasses
string$hrefURL

Definition at line 1076 of file OutputPage.php.

OutputPage::addHeadItem ( name,
value 
)

Add or replace an header item to the output.

Parameters:
string$nameItem name
string$valueRaw HTML

Definition at line 605 of file OutputPage.php.

OutputPage::addHTML ( text)

Append $text to the body HTML.

Parameters:
string$textHTML

Definition at line 1361 of file OutputPage.php.

Add a self-contained script tag with the given contents.

Parameters:
string$scriptJavaScript text, no "<script>" tags

Definition at line 420 of file OutputPage.php.

OutputPage::addInlineStyle ( style_css,
flip = 'noflip' 
)

Adds inline CSS styles.

Parameters:
mixed$style_cssInline CSS
string$flipSet to 'flip' to flip the CSS if needed

Definition at line 3487 of file OutputPage.php.

OutputPage::addJsConfigVars ( keys,
value = null 
)

Add one or more variables to be set in mw.config in JavaScript.

Parameters:
string | array$keysKey or array of key/value pairs
mixed$value[optional] Value of the configuration variable

Definition at line 3049 of file OutputPage.php.

OutputPage::addLanguageLinks ( array newLinkArray)

Add new language links.

Parameters:
array$newLinkArrayAssociative array mapping language code to the page name

Definition at line 1159 of file OutputPage.php.

OutputPage::addLink ( array linkarr)

Add a new <link> tag to the page header.

Note: use setCanonicalUrl() for rel=canonical.

Parameters:
array$linkarrAssociative array of attributes.

Definition at line 324 of file OutputPage.php.

Referenced by addExtensionStyle().

OutputPage::addMeta ( name,
val 
)

Add a new "<meta>" tag To add an http-equiv meta tag, precede the name with "http:".

Parameters:
string$nameTag name
string$valTag value

Definition at line 313 of file OutputPage.php.

Add a new <link> with "rel" attribute set to "meta".

Parameters:
array$linkarrAssociative array mapping attribute names to their values, both keys and values will be escaped, and the "rel" attribute will be automatically added

Definition at line 335 of file OutputPage.php.

Add only messages of one or more modules recognized by the resource loader.

Module messages added through this function will be loaded by the resource loader when the page loads.

Parameters:
string | array$modulesModule name (string) or array of module names

Definition at line 554 of file OutputPage.php.

OutputPage::addModules ( modules)

Add one or more modules recognized by the resource loader.

Modules added through this function will be loaded by the resource loader when the page loads.

Parameters:
string | array$modulesModule name (string) or array of module names

Definition at line 483 of file OutputPage.php.

Referenced by MWDebug\addModules().

Add only JS of one or more modules recognized by the resource loader.

Module scripts added through this function will be loaded by the resource loader when the page loads.

Parameters:
string | array$modulesModule name (string) or array of module names

Definition at line 506 of file OutputPage.php.

Add only CSS of one or more modules recognized by the resource loader.

Module styles added through this function will be added using standard link CSS tags, rather than as a combined Javascript and CSS package. Thus, they will load when JavaScript is disabled (unless CSS also happens to be disabled).

Parameters:
string | array$modulesModule name (string) or array of module names

Definition at line 531 of file OutputPage.php.

Referenced by SkinFallback\setupSkinUserCss().

OutputPage::addParserOutput ( parserOutput)

Add everything from a ParserOutput object.

Parameters:
ParserOutput$parserOutput

Definition at line 1678 of file OutputPage.php.

Add the HTML and enhancements for it (like ResourceLoader modules) associated with a ParserOutput object, without any other metadata.

Since:
1.24
Parameters:
ParserOutput$parserOutput

Definition at line 1650 of file OutputPage.php.

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.

Since:
1.24
Parameters:
ParserOutput$parserOutput

Definition at line 1594 of file OutputPage.php.

OutputPage::addParserOutputNoText ( parserOutput)

Add a ParserOutput object, but without Html.

Deprecated:
since 1.24, use addParserOutputMetadata() instead.
Parameters:
ParserOutput$parserOutput

Definition at line 1582 of file OutputPage.php.

OutputPage::addParserOutputText ( parserOutput)

Add the HTML associated with a ParserOutput object, without any metadata.

Since:
1.24
Parameters:
ParserOutput$parserOutput

Definition at line 1667 of file OutputPage.php.

OutputPage::addReturnTo ( title,
array query = array(),
text = null,
options = array() 
)

Add a "return to" link pointing to a specified title.

Parameters:
Title$titleTitle to link
array$queryQuery string parameters
string$textText of the link (input is not escaped)
array$optionsOptions array to pass to Linker

Definition at line 2511 of file OutputPage.php.

OutputPage::addScript ( script)

Add raw HTML to the list of scripts (including <script> tag, etc.)

Parameters:
string$scriptRaw HTML

Definition at line 370 of file OutputPage.php.

OutputPage::addScriptFile ( file,
version = null 
)

Add a JavaScript file out of skins/common, or a given relative path.

Parameters:
string$fileFilename in skins/common or complete on-server path (/foo/bar.js)
string$versionStyle version of the file. Defaults to $wgStyleVersion

Definition at line 402 of file OutputPage.php.

OutputPage::addStyle ( style,
media = '',
condition = '',
dir = '' 
)

Add a local or specified stylesheet, with the given media options.

Meant primarily for internal use...

Parameters:
string$styleURL to the file
string$mediaTo specify a media type, 'screen', 'printable', 'handheld' or any.
string$conditionFor IE conditional comments, specifying an IE version
string$dirSet to 'rtl' or 'ltr' for direction-specific sheets

Definition at line 3466 of file OutputPage.php.

Add $str to the subtitle.

Parameters:
string | Message$strString or Message to add to the subtitle. String should be safe HTML.

Definition at line 944 of file OutputPage.php.

OutputPage::addTemplate ( &$  template)

Add the output of a QuickTemplate to the output buffer.

Parameters:
QuickTemplate$template

Definition at line 1695 of file OutputPage.php.

OutputPage::addVaryHeader ( header,
option = null 
)

Add an HTTP header that will influence on the cache.

Parameters:
string$headerHeader name
array | null$option
Todo:
FIXME: Document the $option parameter; it appears to be for X-Vary-Options but what format is acceptable?

Definition at line 1830 of file OutputPage.php.

References $cookies, array(), ContextSource\getConfig(), and wfRunHooks().

Add a wikitext-formatted message to the output.

This is equivalent to:

$wgOut->addWikiText( wfMessage( ... )->plain() )

Definition at line 3703 of file OutputPage.php.

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.

Parameters:
string$name
array$args

Definition at line 3717 of file OutputPage.php.

OutputPage::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.

Parameters:
string$text
bool$linestartIs this the start of a line?
bool$interfaceIs this text in the user interface language?

Definition at line 1502 of file OutputPage.php.

OutputPage::addWikiTextTidy ( text,
linestart = true 
)

Add wikitext with tidy enabled.

Parameters:
string$textWikitext
bool$linestartIs this the start of a line?

Definition at line 1538 of file OutputPage.php.

OutputPage::addWikiTextTitle ( text,
Title title,
linestart,
tidy = false,
interface = false 
)

Add wikitext with a custom Title object.

Parameters:
string$textWikitext
Title$title
bool$linestartIs this the start of a line?
bool$tidyWhether to use tidy
bool$interfaceWhether it is an interface message (for example disables conversion)

Definition at line 1553 of file OutputPage.php.

OutputPage::addWikiTextTitleTidy ( text,
&$  title,
linestart = true 
)

Add wikitext with a custom Title object and tidy enabled.

Parameters:
string$textWikitext
Title$title
bool$linestartIs this the start of a line?

Definition at line 1528 of file OutputPage.php.

OutputPage::addWikiTextWithTitle ( text,
&$  title,
linestart = true 
)

Add wikitext with a custom Title object.

Parameters:
string$textWikitext
Title$title
bool$linestartIs this the start of a line?

Definition at line 1517 of file OutputPage.php.

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 1936 of file OutputPage.php.

Add $str to the subtitle.

Deprecated:
since 1.19; use addSubtitle() instead
Parameters:
string | Message$strString or Message to add to the subtitle

Definition at line 935 of file OutputPage.php.

Produce a "user is blocked" page.

Deprecated:
since 1.18

Definition at line 2168 of file OutputPage.php.

Build a set of "<link>" elements for the stylesheets specified in the $this->styles array.

These will be applied to various media & IE conditionals.

Returns:
string

Definition at line 3501 of file OutputPage.php.

Returns:
array

Definition at line 3593 of file OutputPage.php.

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

Parameters:
string$timestamp
Returns:
bool True if cache-ok headers was sent.

Definition at line 685 of file OutputPage.php.

Clear the body HTML.

Definition at line 1381 of file OutputPage.php.

Clear the subtitles.

Definition at line 969 of file OutputPage.php.

Disable output completely, i.e.

calling output() will have no effect

Definition at line 1002 of file OutputPage.php.

Restrict the page to loading modules bundled the software.

Disallows the queue to contain any modules which can be modified by wiki users to load on this page.

Definition at line 1291 of file OutputPage.php.

Use enableClientCache(false) to force it to send nocache headers.

Parameters:
bool$state
Returns:
bool

Definition at line 1772 of file OutputPage.php.

Referenced by SkinFallback\initPage().

Enables/disables section edit links, doesn't override __NOEDITSECTION__.

Parameters:
bool$flag
Since:
1.23

Definition at line 3805 of file OutputPage.php.

OutputPage::enableTOC ( flag = true)

Enables/disables TOC, doesn't override __NOTOC__.

Parameters:
bool$flag
Since:
1.22

Definition at line 3788 of file OutputPage.php.

OutputPage::feedLink ( type,
url,
text 
) [private]

Generate a "<link rel/>" for a feed.

Parameters:
string$typeFeed type
string$urlURL to the feed
string$textValue of the "title" attribute
Returns:
string HTML fragment

Definition at line 3448 of file OutputPage.php.

Referenced by getHeadLinks().

OutputPage::filterModules ( array modules,
position = null,
type = ResourceLoaderModule::TYPE_COMBINED 
) [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)

Parameters:
array$modules
string | null$positionIf not null, only return modules with this position
string$type
Returns:
array

Definition at line 443 of file OutputPage.php.

Forcibly hide the new section link?

Returns:
bool

Definition at line 1029 of file OutputPage.php.

OutputPage::formatPermissionsErrorMessage ( array errors,
action = null 
)

Format a list of error messages.

Parameters:
array$errorsArray of arrays returned by Title::getUserPermissionsErrors
string$actionAction that was denied or null if unknown
Returns:
string The wikitext error-messages, formatted into a list.

Definition at line 2339 of file OutputPage.php.

OutputPage::getAllowedModules ( type = null)

Get the level of JavaScript / CSS untrustworthiness allowed on this page.

See also:
ResourceLoaderModule::$origin
Parameters:
string$typeUnused: Module origin allowance used to be fragmented by ResourceLoaderModule TYPE_ constants.
Returns:
int ResourceLoaderModule ORIGIN_ class constant

Definition at line 1303 of file OutputPage.php.

Referenced by getModuleScripts().

Return whether the output will contain only the body of the article.

Returns:
bool

Definition at line 644 of file OutputPage.php.

JS stuff to put at the bottom of the "<body>".

Returns:
string

Definition at line 3019 of file OutputPage.php.

Get the list of cookies that will influence on the cache.

Returns:
array

Definition at line 1781 of file OutputPage.php.

Get the list of category names this page belongs to.

Returns:
array Array of strings

Definition at line 1281 of file OutputPage.php.

References $type, as, and Title\makeTitleSafe().

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.

Returns:
array

Definition at line 1272 of file OutputPage.php.

Get all styles added by extensions.

Returns:
array

Definition at line 391 of file OutputPage.php.

Will currently always return null.

Returns:
null

Definition at line 1103 of file OutputPage.php.

Get the files used on this page.

Returns:
array (dbKey => array('time' => MW timestamp or null, 'sha1' => sha1 or ''))
Since:
1.18

Definition at line 1490 of file OutputPage.php.

Get the displayed file version.

Returns:
array|null ('time' => MW timestamp, 'sha1' => sha1)

Definition at line 1470 of file OutputPage.php.

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.

Returns:
string

Definition at line 1957 of file OutputPage.php.

Get all header items in a string.

Returns:
string
Deprecated:
since 1.24 Use OutputPage::headElement or if absolutely necessary use OutputPage::getHeadItemsArray

Definition at line 590 of file OutputPage.php.

References getModules().

Get an array of head items.

Returns:
array

Definition at line 579 of file OutputPage.php.

Referenced by ParserOutput\addOutputPageMetadata().

Returns:
string HTML tag links to be put in the header.
Deprecated:
since 1.24 Use OutputPage::headElement or if you have to, OutputPage::getHeadLinksArray directly.

Definition at line 3435 of file OutputPage.php.

References $type, as, feedLink(), ContextSource\msg(), and text.

Returns:
array Array in format "link name or number => 'link html'".

Definition at line 3212 of file OutputPage.php.

JS stuff to put in the "<head>".

This is the startup module, config vars and modules marked with position 'top'

Returns:
string HTML fragment

Definition at line 2889 of file OutputPage.php.

Get the body HTML.

Returns:
string HTML

Definition at line 1390 of file OutputPage.php.

static OutputPage::getHtmlFromLoaderLinks ( array links) [static, protected]

Build html output from an array of links from makeResourceLoaderLink.

Parameters:
array$links
Returns:
string HTML

Definition at line 2860 of file OutputPage.php.

Return the "HTML title", i.e.

the content of the "<title>" tag.

Returns:
string

Definition at line 861 of file OutputPage.php.

Get the javascript config vars to include on this page.

Returns:
array Array of javascript config vars
Since:
1.23

Definition at line 3039 of file OutputPage.php.

Referenced by ParserOutput\addOutputPageMetadata().

OutputPage::getJSVars ( ) [private]

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

  • in other words, page-independent/site-wide variables (without state). You will only be adding bloat to the html page and causing page caches to have to be purged on configuration changes.
    Returns:
    array

Definition at line 3069 of file OutputPage.php.

Get the list of language links.

Returns:
array Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page')

Definition at line 1178 of file OutputPage.php.

Get the value of the "rel" attribute for metadata links.

Returns:
string

Definition at line 354 of file OutputPage.php.

Referenced by addExtensionStyle().

OutputPage::getModuleMessages ( filter = false,
position = null 
)

Get the list of module messages to include on this page.

Parameters:
bool$filter
string | null$position
Returns:
array Array of module names

Definition at line 543 of file OutputPage.php.

Referenced by ParserOutput\addOutputPageMetadata().

OutputPage::getModules ( filter = false,
position = null,
param = 'mModules' 
)

Get the list of modules to include on this page.

Parameters:
bool$filterWhether to filter out insufficiently trustworthy modules
string | null$positionIf not null, only return modules with this position
string$param
Returns:
array Array of module names

Definition at line 469 of file OutputPage.php.

Referenced by ParserOutput\addOutputPageMetadata(), and getHeadItems().

OutputPage::getModuleScripts ( filter = false,
position = null 
)

Get the list of module JS to include on this page.

Parameters:
bool$filter
string | null$position
Returns:
array Array of module names

Definition at line 495 of file OutputPage.php.

References $resourceLoader, $type, getAllowedModules(), and ResourceLoaderModule\getOrigin().

Referenced by ParserOutput\addOutputPageMetadata().

OutputPage::getModuleStyles ( filter = false,
position = null 
)

Get the list of module CSS to include on this page.

Parameters:
bool$filter
string | null$position
Returns:
array Array of module names

Definition at line 518 of file OutputPage.php.

Referenced by ParserOutput\addOutputPageMetadata().

Return the "page title", i.e.

the content of the <h1> tag.

Returns:
string

Definition at line 906 of file OutputPage.php.

Get the value of the "action text".

Returns:
string

Definition at line 838 of file OutputPage.php.

Get the prevent-clickjacking flag.

Since:
1.24
Returns:
bool

Definition at line 1946 of file OutputPage.php.

Referenced by ParserOutput\addOutputPageMetadata().

Get an additional output property.

Since:
1.21
Parameters:
string$name
Returns:
mixed Property value or null if not found

Definition at line 666 of file OutputPage.php.

Get the URL to redirect to, or an empty string if not redirect URL set.

Returns:
string

Definition at line 293 of file OutputPage.php.

Get a ResourceLoader object associated with this OutputPage.

Returns:
ResourceLoader

Definition at line 2641 of file OutputPage.php.

References $ret.

Get the displayed revision ID.

Returns:
int

Definition at line 1426 of file OutputPage.php.

Get the timestamp of displayed revision.

This will be null if not filled by setRevisionTimestamp().

Returns:
string|null

Definition at line 1447 of file OutputPage.php.

Get all registered JS and CSS tags for the header.

Returns:
string
Deprecated:
since 1.24 Use OutputPage::headElement to build the full header.

Definition at line 430 of file OutputPage.php.

JS stuff to put at the 'bottom', which can either be the bottom of the "<body>" or the bottom of the "<head>" depending on $wgResourceLoaderExperimentalAsyncLoading: modules marked with position 'bottom', legacy scripts ($this->mScripts), user preferences, site JS and user JS.

Parameters:
bool$inHeadIf true, this HTML goes into the "<head>", if false it goes into the "<body>".
Returns:
string

Definition at line 2947 of file OutputPage.php.

Get the subtitle.

Returns:
string

Definition at line 978 of file OutputPage.php.

Return URLs for each supported syndication format for this page.

Returns:
array Associating format keys with URLs

Definition at line 1094 of file OutputPage.php.

Returns:
null|string ResourceLoader target

Definition at line 561 of file OutputPage.php.

Get the templates used on this page.

Returns:
array (namespace => dbKey => revId)
Since:
1.18

Definition at line 1480 of file OutputPage.php.

Return a Vary: header on which to vary caches.

Based on the keys of $mVaryHeader, such as Accept-Encoding or Cookie

Returns:
string

Definition at line 1849 of file OutputPage.php.

Get a complete X-Vary-Options header.

Returns:
string

Definition at line 1858 of file OutputPage.php.

References wfDebug().

Check if the header item $name is already set.

Parameters:
string$nameItem name
Returns:
bool

Definition at line 615 of file OutputPage.php.

Check if the request has a cache-varying cookie header If it does, it's very important that we don't allow public caching.

Returns:
bool

Definition at line 1805 of file OutputPage.php.

OutputPage::headElement ( Skin sk,
includeStyle = true 
)
Parameters:
Skin$skThe given Skin
bool$includeStyleUnused
Returns:
string The doctype, opening "<html>", and head element.

Definition at line 2555 of file OutputPage.php.

Include jQuery core.

Use this to avoid loading it multiple times before we get a usable script loader.

Parameters:
array$modulesList of jQuery modules which should be loaded
Returns:
array The list of modules which were not loaded.
Since:
1.16
Deprecated:
since 1.17

Definition at line 3779 of file OutputPage.php.

Return whether the content displayed page is related to the source of the corresponding article on the wiki.

Returns:
bool

Definition at line 1127 of file OutputPage.php.

Return whether this page is related an article on the wiki.

Returns:
bool

Definition at line 1149 of file OutputPage.php.

Return whether the output will be completely disabled.

Returns:
bool

Definition at line 1011 of file OutputPage.php.

Return whether the page is "printable".

Returns:
bool

Definition at line 995 of file OutputPage.php.

Should we output feed links for this page?

Returns:
bool

Definition at line 1086 of file OutputPage.php.

Returns:
bool
Since:
1.22

Definition at line 3796 of file OutputPage.php.

References wfDeprecated().

Produce the stock "please login to use the wiki" page.

Deprecated:
since 1.19; throw the exception directly

Definition at line 2328 of file OutputPage.php.

OutputPage::makeResourceLoaderLink ( modules,
only,
useESI = false,
array extraQuery = array(),
loadCall = false 
) [protected]
Todo:
Document
Parameters:
array | string$modulesOne or more module names
string$onlyResourceLoaderModule TYPE_ class constant
bool$useESI
array$extraQueryArray with extra query parameters to add to each request. array( param => value ).
bool$loadCallIf true, output an (asynchronous) mw.loader.load() call rather than a "<script src='...'>" tag.
Returns:
string The html "<script>", "<link>" and "<style>" tags

Definition at line 2659 of file OutputPage.php.

Referenced by styleLink().

OutputPage::out ( ins)

Actually output something with print.

Parameters:
string$insThe string to output
Deprecated:
since 1.22 Use echo yourself.

Definition at line 2159 of file OutputPage.php.

Finally, all the text has been munged and accumulated into the object, let's actually output it:

Definition at line 2040 of file OutputPage.php.

References $response, and wfDebug().

OutputPage::parse ( text,
linestart = true,
interface = false,
language = null 
)

Parse wikitext and return the HTML.

Parameters:
string$text
bool$linestartIs this the start of a line?
bool$interfaceUse interface language ($wgLang instead of $wgContLang) while parsing language sensitive magic words like GRAMMAR and PLURAL. This also disables LanguageConverter.
Language$languageTarget language object, will override $interface
Exceptions:
MWException
Returns:
string HTML

Definition at line 1711 of file OutputPage.php.

OutputPage::parseInline ( text,
linestart = true,
interface = false 
)

Parse wikitext, strip paragraphs, and return the HTML.

Parameters:
string$text
bool$linestartIs this the start of a line?
bool$interfaceUse interface language ($wgLang instead of $wgContLang) while parsing language sensitive magic words like GRAMMAR and PLURAL
Returns:
string HTML

Definition at line 1751 of file OutputPage.php.

OutputPage::parserOptions ( options = null)

Get/set the ParserOptions object to use for wikitext parsing.

Parameters:
ParserOptions | null$optionsEither the ParserOption to use or null to only get the current ParserOption object
Returns:
ParserOptions

Definition at line 1401 of file OutputPage.php.

OutputPage::permissionRequired ( permission)

Display an error page noting that a given permission bit is required.

Deprecated:
since 1.18, just throw the exception directly
Parameters:
string$permissionKey required
Exceptions:
PermissionsError

Definition at line 2319 of file OutputPage.php.

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).

Parameters:
string | Message$pageTitleWill be passed directly to setPageTitle()
string | Message$htmlTitleWill be passed directly to setHTMLTitle(); optional, if not passed the "<title>" attribute will be based on $pageTitle

Definition at line 2182 of file OutputPage.php.

Prepend $text to the body HTML.

Parameters:
string$textHTML

Definition at line 1352 of file OutputPage.php.

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.

Parameters:
bool$enable

Definition at line 1927 of file OutputPage.php.

Turn off regular page output and return an error response for when rate limiting has triggered.

Definition at line 2453 of file OutputPage.php.

OutputPage::readOnlyPage ( source = null,
protected = false,
array reasons = array(),
action = null 
)

Display a page stating that the Wiki is in read-only mode, and optionally show the source of the page that the user was trying to edit.

Should only be called (for this purpose) after wfReadOnly() has returned true.

For historical reasons, this function is _also_ used to show the error message when a user tries to edit a page they are not allowed to edit. (Unless it's because they're blocked, then we show blockedPage() instead.) In this case, the second parameter should be set to true and a list of reasons supplied as the third parameter.

Todo:
Needs to be split into multiple functions.
Parameters:
string$sourceSource code to show (or null).
bool$protectedIs this a permissions error?
array$reasonsList of reasons for this error, as returned by Title::getUserPermissionsErrors().
string$actionAction that was denied or null if unknown
Exceptions:
ReadOnlyError

Definition at line 2391 of file OutputPage.php.

OutputPage::redirect ( url,
responsecode = '302' 
)

Redirect to $url rather than displaying the normal page.

Parameters:
string$urlURL
string$responsecodeHTTP status code

Definition at line 282 of file OutputPage.php.

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.

Parameters:
int$levelResourceLoaderModule class constant

Definition at line 1343 of file OutputPage.php.

OutputPage::reduceAllowedModules ( type,
level 
)

Limit the highest level of CSS/JS untrustworthiness allowed.

Deprecated:
since 1.24 Module allowance is no longer fragmented by content type. Use reduceAllowedModuleOrigin() instead.
Parameters:
string$typeResourceLoaderModule TYPE_ constant
int$levelResourceLoaderModule ORIGIN_ class constant

Definition at line 1330 of file OutputPage.php.

OutputPage::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.

Parameters:
mixed$unused
Title | string$returntoTitle or String to return to
string$returntoqueryQuery string for the return to link

Definition at line 2525 of file OutputPage.php.

Referenced by showFileRenameError().

Returns:
bool
Since:
1.23

Definition at line 3813 of file OutputPage.php.

Send cache control HTTP headers.

Definition at line 1970 of file OutputPage.php.

OutputPage::setAllowedModules ( type,
level 
)

Set the highest level of CSS/JS untrustworthiness allowed.

Deprecated:
since 1.24 Raising level of allowed untrusted content is no longer supported. Use reduceAllowedModuleOrigin() instead.
Parameters:
string$typeResourceLoaderModule TYPE_ constant
int$levelResourceLoaderModule ORIGIN_ constant

Definition at line 1316 of file OutputPage.php.

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".

Parameters:
bool$onlyWhether to output only the body of the article

Definition at line 635 of file OutputPage.php.

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.

Parameters:
bool$v

Definition at line 1114 of file OutputPage.php.

Set whether this page is related an article on the wiki Setting false will cause the change of "article flag" toggle to false.

Parameters:
bool$v

Definition at line 1137 of file OutputPage.php.

Set the URL to be used for the <link rel="canonical">.

This should be used in preference to addLink(), to avoid duplicate link tags.

Parameters:
string$url

Definition at line 345 of file OutputPage.php.

Reset the category links (but not the category list) and add $categories.

Parameters:
array$categoriesMapping category name => sort key

Definition at line 1259 of file OutputPage.php.

OutputPage::setETag ( tag)

Set the value of the ETag HTTP header, only used if $wgUseETag is true.

Parameters:
string$tagValue of "ETag" header

Definition at line 624 of file OutputPage.php.

Add default feeds to the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version.

See also:
addFeedLink()
Parameters:
string$valQuery to append to feed links or false to output default links

Definition at line 1058 of file OutputPage.php.

Set the displayed file version.

Parameters:
File | bool$file
Returns:
mixed Previous value

Definition at line 1457 of file OutputPage.php.

Set the follow policy for the page, but leave the index policy un- touched.

Parameters:
string$policyEither 'follow' or 'nofollow'.
Returns:
null

Definition at line 816 of file OutputPage.php.

"HTML title" means the contents of "<title>".

It is stored as plain, unescaped text and will be run through htmlspecialchars in the skin file.

Parameters:
string | Message$name

Definition at line 848 of file OutputPage.php.

Set the index policy for the page, but leave the follow policy un- touched.

Parameters:
string$policyEither 'index' or 'noindex'.
Returns:
null

Definition at line 802 of file OutputPage.php.

OutputPage::setLanguageLinks ( array newLinkArray)

Reset the language links and add new language links.

Parameters:
array$newLinkArrayAssociative array mapping language code to the page name

Definition at line 1169 of file OutputPage.php.

OutputPage::setLastModified ( timestamp)

Override the last modified timestamp.

Parameters:
string$timestampNew timestamp, in a format readable by wfTimestamp()

Definition at line 772 of file OutputPage.php.

References wfDebug().

"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.

Parameters:
string | Message$name

Definition at line 884 of file OutputPage.php.

Set the new value of the "action text", this will be added to the "HTML title", separated from it with " - ".

Parameters:
string$textNew value of the "action text"

Definition at line 829 of file OutputPage.php.

Set the page as printable, i.e.

it'll be displayed with with all print styles included

Definition at line 986 of file OutputPage.php.

OutputPage::setProperty ( name,
value 
)

Set an additional output property.

Since:
1.21
Parameters:
string$name
mixed$value

Definition at line 655 of file OutputPage.php.

References $name.

Set $mRedirectedFrom, the Title of the page which redirected us to the current page.

Parameters:
Title$t

Definition at line 870 of file OutputPage.php.

Set the revision ID which will be seen by the wiki text parser for things such as embedded {{REVISIONID}} variable use.

Parameters:
int | null$revidAn positive integer, or null
Returns:
mixed Previous value

Definition at line 1416 of file OutputPage.php.

Set the timestamp of the revision which will be displayed.

This is used to avoid a extra DB call in Skin::lastModified().

Parameters:
string | null$timestamp
Returns:
mixed Previous value

Definition at line 1437 of file OutputPage.php.

Set the robot policy for the page: <http://www.robotstxt.org/meta.html>

Parameters:
string$policyThe literal string to output as the contents of the meta tag. Will be parsed according to the spec and output in standardized form.
Returns:
null

Definition at line 784 of file OutputPage.php.

Set the value of the "s-maxage" part of the "Cache-control" HTTP header.

Parameters:
int$maxageMaximum cache time on the Squid, in seconds.

Definition at line 1761 of file OutputPage.php.

OutputPage::setStatusCode ( statusCode)

Set the HTTP status code to send with the output.

Parameters:
int$statusCode

Definition at line 302 of file OutputPage.php.

References ContextSource\$context, ContextSource\setContext(), and wfDeprecated().

Replace the subtitle with $str.

Parameters:
string | Message$strNew value of the subtitle. String should be safe HTML.

Definition at line 924 of file OutputPage.php.

Add or remove feed links in the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version.

See also:
addFeedLink()
Parameters:
bool$showTrue: add default feeds, false: remove all feeds

Definition at line 1041 of file OutputPage.php.

OutputPage::setTarget ( target)

Sets ResourceLoader target for load.php links.

If null, will be omitted

Parameters:
string | null$target

Definition at line 570 of file OutputPage.php.

Set the Title object to use.

Parameters:
Title$t

Definition at line 915 of file OutputPage.php.

OutputPage::showErrorPage ( title,
msg,
params = array() 
)

Output a standard error page.

showErrorPage( 'titlemsg', 'pagetextmsg' ); showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) ); showErrorPage( 'titlemsg', $messageObject ); showErrorPage( $titleMessageObject, $messageObject );

Parameters:
string | Message$titleMessage key (string) for page title, or a Message object
string | Message$msgMessage key (string) for page text, or a Message object
array$paramsMessage parameters; ignored if $msg is a Message object

Definition at line 2207 of file OutputPage.php.

Definition at line 2477 of file OutputPage.php.

OutputPage::showFileCopyError ( old,
new 
)

Definition at line 2487 of file OutputPage.php.

Definition at line 2495 of file OutputPage.php.

Definition at line 2499 of file OutputPage.php.

OutputPage::showFileRenameError ( old,
new 
)

Definition at line 2491 of file OutputPage.php.

References ContextSource\getTitle(), and returnToMain().

Show a warning about slave 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.

Parameters:
int$lagSlave lag

Definition at line 2466 of file OutputPage.php.

Show an "add new section" link?

Returns:
bool

Definition at line 1020 of file OutputPage.php.

OutputPage::showPermissionsErrorPage ( array errors,
action = null 
)

Output a standard permission error page.

Parameters:
array$errorsError message keys
string$actionAction that was denied or null if unknown

Definition at line 2234 of file OutputPage.php.

OutputPage::showUnexpectedValueError ( name,
val 
)

Definition at line 2483 of file OutputPage.php.

OutputPage::styleLink ( style,
array options 
) [protected]

Generate <link> tags for stylesheets.

Parameters:
string$styleURL to the file
array$optionsOption, can contain 'condition', 'dir', 'media' keys
Returns:
string HTML fragment

Definition at line 3618 of file OutputPage.php.

References $styles, makeResourceLoaderLink(), and ResourceLoaderModule\TYPE_STYLES.

static OutputPage::transformCssMedia ( media) [static]

Transform "media" attribute based on request parameters.

Parameters:
string$mediaCurrent value of the "media" attribute
Returns:
string Modified value of the "media" attribute, or null to skip this stylesheet

Definition at line 3659 of file OutputPage.php.

Referenced by OutputPageTest\assertTransformCssMediaCase().

To make it harder for someone to slip a user a fake user-JavaScript or user-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.

Returns:
bool

Definition at line 3194 of file OutputPage.php.

Display an error page indicating that a given version of MediaWiki is required to use it.

Parameters:
mixed$versionThe version of MediaWiki needed to use the page

Definition at line 2306 of file OutputPage.php.

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 either be strings, in which case they are the message names, or arrays, in which case 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 users interface language.

For example:

$wgOut->wrapWikiMsg( "<div class='error'>\n$1\n</div>", 'some-error' );

Is equivalent to:

$wgOut->addWikiText( "<div class='error'>\n" . wfMessage( 'some-error' )->plain() . "\n</div>" );

The newline after opening div is needed in some wikitext. See bug 19226.

Parameters:
string$wrap

Definition at line 3745 of file OutputPage.php.


Member Data Documentation

int OutputPage::$mAllowedModuleOrigin = ResourceLoaderModule::ORIGIN_ALL [protected]

The level of 'untrustworthiness' allowed for modules loaded on this page.

See also:
ResourceLoaderModule::$origin

Definition at line 158 of file OutputPage.php.

bool OutputPage::$mArticleBodyOnly = false [private]

Flag if output should only contain the body of the article.

*

Definition at line 186 of file OutputPage.php.

OutputPage::$mBodytext = ''

Definition at line 58 of file OutputPage.php.

bool OutputPage::$mCanonicalUrl = false [protected]

*

Definition at line 43 of file OutputPage.php.

array OutputPage::$mCategories = array() [protected]

*

Definition at line 108 of file OutputPage.php.

array OutputPage::$mCategoryLinks = array() [protected]

*

Definition at line 106 of file OutputPage.php.

int OutputPage::$mContainsNewMagic = 0 [protected]

*

Definition at line 169 of file OutputPage.php.

int OutputPage::$mContainsOldMagic = 0 [private]
Todo:
Unused?

Definition at line 167 of file OutputPage.php.

OutputPage::$mDebugtext = ''

Holds the debug lines that will be output as comments in page source if $wgDebugComments is enabled.

See also $wgShowDebug.

Deprecated:
since 1.20; use MWDebug class instead.

Definition at line 65 of file OutputPage.php.

bool OutputPage::$mDoNothing = false [protected]

Whether output is disabled.

If this is true, the 'output' method will do nothing. *

Definition at line 160 of file OutputPage.php.

OutputPage::$mEnableClientCache = true [protected]

Definition at line 184 of file OutputPage.php.

bool OutputPage::$mEnableSectionEditLinks = true [private]

Whether parser output should contain section edit links.

Definition at line 259 of file OutputPage.php.

bool OutputPage::$mEnableTOC = true [private]

Whether parser output should contain table of contents.

Definition at line 255 of file OutputPage.php.

OutputPage::$mETag = false [private]

Contains an HTTP Entity Tags (see RFC 2616 section 3.13) which is used as a unique identifier for the content.

It is later used by the client to compare its cached version with the server version. Client sends headers If-Match and If-None-Match containing its locally cached ETAG value.

To get more information, you will have to look at HTTP/1.1 protocol which is properly described in RFC 2616 : http://tools.ietf.org/html/rfc2616

Definition at line 104 of file OutputPage.php.

array OutputPage::$mExtStyles = array() [protected]

Additional stylesheets.

Looks like this is for extensions. Might be replaced by resource loader.

Definition at line 48 of file OutputPage.php.

OutputPage::$mFeedLinks = array() [private]

Handles the Atom / RSS links.

We probably only support Atom in 2011.

See also:
$wgAdvertisedFeedTypes

Definition at line 181 of file OutputPage.php.

OutputPage::$mFeedLinksAppendQuery = null [protected]

Definition at line 152 of file OutputPage.php.

array OutputPage::$mFileVersion = null [protected]

*

Definition at line 214 of file OutputPage.php.

OutputPage::$mFollowPolicy = 'follow' [private]

Definition at line 232 of file OutputPage.php.

array OutputPage::$mHeadItems = array() [protected]

Array of elements in "<head>".

Parser might add its own headers! *

Definition at line 130 of file OutputPage.php.

bool OutputPage::$mHideNewSectionLink = false [protected]

*

Definition at line 190 of file OutputPage.php.

string OutputPage::$mHTMLtitle = '' [private]

Stores contents of "<title>" tag *.

Definition at line 67 of file OutputPage.php.

array OutputPage::$mImageTimeKeys = array() [protected]

*

Definition at line 148 of file OutputPage.php.

OutputPage::$mIndexPolicy = 'index' [private]

Definition at line 231 of file OutputPage.php.

string OutputPage::$mInlineStyles = '' [protected]

Inline CSS styles.

Use addInlineStyle() sparingly *

Definition at line 120 of file OutputPage.php.

bool OutputPage::$mIsarticle = false [private]

Is the displayed content related to the source of the corresponding wiki article.

Definition at line 72 of file OutputPage.php.

bool OutputPage::$mIsArticleRelated = true [private]

Stores "article flag" toggle.

*

Definition at line 74 of file OutputPage.php.

OutputPage::$mJQueryDone = false [protected]

Whether jQuery is already handled.

Definition at line 229 of file OutputPage.php.

array OutputPage::$mJsConfigVars = array() [protected]

*

Definition at line 144 of file OutputPage.php.

array OutputPage::$mLanguageLinks = array() [private]

Array of Interwiki Prefixed (non DB key) Titles (e.g.

'fr:Test page') *

Definition at line 110 of file OutputPage.php.

string OutputPage::$mLastModified = '' [protected]

Variable mLastModified and mEtag are used for sending cache control.

The whole caching system should probably be moved into its own class.

Definition at line 93 of file OutputPage.php.

OutputPage::$mLinkColours [private]
Todo:
Unused?

Definition at line 123 of file OutputPage.php.

array OutputPage::$mLinktags = array() [protected]

*

Definition at line 41 of file OutputPage.php.

array OutputPage::$mMetatags = array() [protected]

Should be private.

Used with addMeta() which adds "<meta>" *

Definition at line 39 of file OutputPage.php.

array OutputPage::$mModuleMessages = array() [protected]

*

Definition at line 140 of file OutputPage.php.

array OutputPage::$mModules = array() [protected]

*

Definition at line 134 of file OutputPage.php.

array OutputPage::$mModuleScripts = array() [protected]

*

Definition at line 136 of file OutputPage.php.

array OutputPage::$mModuleStyles = array() [protected]

*

Definition at line 138 of file OutputPage.php.

bool OutputPage::$mNewSectionLink = false [protected]

*

Definition at line 188 of file OutputPage.php.

OutputPage::$mNoGallery = false

Definition at line 197 of file OutputPage.php.

string OutputPage::$mPageLinkTitle = ''

Used by skin template.

Example: $tpl->set( 'displaytitle', $out->mPageLinkTitle );

Definition at line 128 of file OutputPage.php.

string OutputPage::$mPagetitle = ''

Should be private - has getter and setter.

Contains the HTML title *

Definition at line 52 of file OutputPage.php.

string OutputPage::$mPageTitleActionText = '' [private]

*

Definition at line 199 of file OutputPage.php.

ParserOptions OutputPage::$mParserOptions = null [protected]

lazy initialised, use parserOptions()

Definition at line 174 of file OutputPage.php.

array OutputPage::$mParseWarnings = array() [private]

*

Definition at line 201 of file OutputPage.php.

bool OutputPage::$mPreventClickjacking = true [protected]
Todo:
Document

Definition at line 208 of file OutputPage.php.

bool OutputPage::$mPrintable = false [private]

We have to set isPrintable().

Some pages should never be printed (ex: redirections).

Definition at line 79 of file OutputPage.php.

OutputPage::$mProperties = array() [private]

Additional key => value data.

Definition at line 247 of file OutputPage.php.

string OutputPage::$mRedirect = ''

*

Definition at line 86 of file OutputPage.php.

string OutputPage::$mRedirectCode = ''

*

Definition at line 150 of file OutputPage.php.

Title OutputPage::$mRedirectedFrom = null [private]

If the current page was reached through a redirect, $mRedirectedFrom contains the Title of the redirect.

Definition at line 242 of file OutputPage.php.

ResourceLoader OutputPage::$mResourceLoader [protected]

*

Definition at line 142 of file OutputPage.php.

int OutputPage::$mRevisionId = null [private]

To include the variable {{REVISIONID}} *.

Definition at line 210 of file OutputPage.php.

string OutputPage::$mRevisionTimestamp = null [private]

*

Definition at line 212 of file OutputPage.php.

OutputPage::$mScripts = '' [private]

Used for JavaScript (pre resource loader)

Todo:
We should split JS / CSS.

mScripts content is inserted as is in "<head>" by Skin. This might contain either a link to a stylesheet or inline CSS.

Definition at line 118 of file OutputPage.php.

int OutputPage::$mSquidMaxage = 0 [protected]

Cache stuff.

Looks like mEnableClientCache *

Definition at line 203 of file OutputPage.php.

int OutputPage::$mStatusCode [protected]

*

Definition at line 88 of file OutputPage.php.

array OutputPage::$mSubtitle = array() [private]

Contains the page subtitle.

Special pages usually have some links here. Don't confuse with site subtitle added by skins.

Definition at line 84 of file OutputPage.php.

string null OutputPage::$mTarget = null [private]

ResourceLoader target for load.php links.

If null, will be omitted

Definition at line 251 of file OutputPage.php.

array OutputPage::$mTemplateIds = array() [protected]

*

Definition at line 146 of file OutputPage.php.

OutputPage::$mVaryHeader [private]
Initial value:
 array(
        'Accept-Encoding' => array( 'list-contains=gzip' ),
    )

Definition at line 233 of file OutputPage.php.

OutputPage::$styles = array() [protected]

Definition at line 224 of file OutputPage.php.

Referenced by styleLink().


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