MediaWiki  1.23.2
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:

Public Member Functions

 __construct (IContextSource $context=null)
 Constructor for OutputPage. More...
 
 addAcceptLanguage ()
 bug 21672: Add Accept-Language to Vary and XVO headers if there's no 'variant' parameter existed in GET. More...
 
 addBacklinkSubtitle (Title $title)
 Add a subtitle containing a backlink to a page. More...
 
 addCategoryLinks ( $categories)
 Add an array of categories, with names in the keys. More...
 
 addElement ( $element, $attribs=array(), $contents='')
 Shortcut for adding an Html::element via addHTML. More...
 
 addExtensionStyle ( $url)
 Register and add a stylesheet from an extension directory. More...
 
 addFeedLink ( $format, $href)
 Add a feed link to the page header. More...
 
 addHeadItem ( $name, $value)
 Add or replace an header item to the output. More...
 
 addHTML ( $text)
 Append $text to the body HTML. More...
 
 addInlineScript ( $script)
 Add a self-contained script tag with the given contents. More...
 
 addInlineStyle ( $style_css, $flip='noflip')
 Adds inline CSS styles. More...
 
 addJsConfigVars ( $keys, $value=null)
 Add one or more variables to be set in mw.config in JavaScript. More...
 
 addLanguageLinks ( $newLinkArray)
 Add new language links. More...
 
 addLink ( $linkarr)
 Add a new <link> tag to the page header. More...
 
 addMeta ( $name, $val)
 Add a new "<meta>" tag To add an http-equiv meta tag, precede the name with "http:". More...
 
 addMetadataLink ( $linkarr)
 Add a new <link> with "rel" attribute set to "meta". More...
 
 addModuleMessages ( $modules)
 Add only messages of one or more modules recognized by the resource loader. More...
 
 addModules ( $modules)
 Add one or more modules recognized by the resource loader. More...
 
 addModuleScripts ( $modules)
 Add only JS of one or more modules recognized by the resource loader. More...
 
 addModuleStyles ( $modules)
 Add only CSS of one or more modules recognized by the resource loader. More...
 
 addParserOutput (&$parserOutput)
 Add a ParserOutput object. More...
 
 addParserOutputNoText (&$parserOutput)
 Add a ParserOutput object, but without Html. More...
 
 addReturnTo ( $title, $query=array(), $text=null, $options=array())
 Add a "return to" link pointing to a specified title. More...
 
 addScript ( $script)
 Add raw HTML to the list of scripts (including <script> tag, etc.) More...
 
 addScriptFile ( $file, $version=null)
 Add a JavaScript file out of skins/common, or a given relative path. More...
 
 addStyle ( $style, $media='', $condition='', $dir='')
 Add a local or specified stylesheet, with the given media options. More...
 
 addSubtitle ( $str)
 Add $str to the subtitle. More...
 
 addTemplate (&$template)
 Add the output of a QuickTemplate to the output buffer. More...
 
 addVaryHeader ( $header, $option=null)
 Add an HTTP header that will influence on the cache. More...
 
 addWikiMsg ()
 Add a wikitext-formatted message to the output. More...
 
 addWikiMsgArray ( $name, $args)
 Add a wikitext-formatted message to the output. More...
 
 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. More...
 
 addWikiTextTidy ( $text, $linestart=true)
 Add wikitext with tidy enabled. More...
 
 addWikiTextTitle ( $text, Title $title, $linestart, $tidy=false, $interface=false)
 Add wikitext with a custom Title object. More...
 
 addWikiTextTitleTidy ( $text, &$title, $linestart=true)
 Add wikitext with a custom Title object and tidy enabled. More...
 
 addWikiTextWithTitle ( $text, &$title, $linestart=true)
 Add wikitext with a custom Title object. More...
 
 allowClickjacking ()
 Turn off frame-breaking. More...
 
 appendSubtitle ( $str)
 Add $str to the subtitle. More...
 
 blockedPage ()
 Produce a "user is blocked" page. More...
 
 buildCssLinks ()
 Build a set of "<link>" elements for the stylesheets specified in the $this->styles array. More...
 
 buildCssLinksArray ()
 
 checkLastModified ( $timestamp)
 checkLastModified tells the client to use the client-cached page if possible. More...
 
 clearHTML ()
 Clear the body HTML. More...
 
 clearSubtitle ()
 Clear the subtitles. More...
 
 disable ()
 Disable output completely, i.e. More...
 
 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. More...
 
 enableClientCache ( $state)
 Use enableClientCache(false) to force it to send nocache headers. More...
 
 enableSectionEditLinks ( $flag=true)
 Enables/disables section edit links, doesn't override NOEDITSECTION More...
 
 enableTOC ( $flag=true)
 Enables/disables TOC, doesn't override NOTOC More...
 
 forceHideNewSectionLink ()
 Forcibly hide the new section link? More...
 
 formatPermissionsErrorMessage ( $errors, $action=null)
 Format a list of error messages. More...
 
 getAllowedModules ( $type)
 Show what level of JavaScript / CSS untrustworthiness is allowed on this page. More...
 
 getArticleBodyOnly ()
 Return whether the output will contain only the body of the article. More...
 
 getBottomScripts ()
 JS stuff to put at the bottom of the "<body>". More...
 
 getCacheVaryCookies ()
 Get the list of cookies that will influence on the cache. More...
 
 getCategories ()
 Get the list of category names this page belongs to. More...
 
 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. More...
 
 getExtStyle ()
 Get all styles added by extensions. More...
 
 getFeedAppendQuery ()
 Will currently always return null. More...
 
 getFileSearchOptions ()
 Get the files used on this page. More...
 
 getFileVersion ()
 Get the displayed file version. More...
 
 getFrameOptions ()
 Get the X-Frame-Options header value (without the name part), or false if there isn't one. More...
 
 getHeadItems ()
 Get all header items in a string. More...
 
 getHeadItemsArray ()
 Get an array of head items. More...
 
 getHeadLinks ()
 
 getHeadLinksArray ()
 
 getHeadScripts ()
 JS stuff to put in the "<head>". More...
 
 getHTML ()
 Get the body HTML. More...
 
 getHTMLTitle ()
 Return the "HTML title", i.e. More...
 
 getJsConfigVars ()
 Get the javascript config vars to include on this page. More...
 
 getJSVars ()
 Get an array containing the variables to be set in mw.config in JavaScript. More...
 
 getLanguageLinks ()
 Get the list of language links. More...
 
 getMetadataAttribute ()
 Get the value of the "rel" attribute for metadata links. More...
 
 getModuleMessages ( $filter=false, $position=null)
 Get the list of module messages to include on this page. More...
 
 getModules ( $filter=false, $position=null, $param='mModules')
 Get the list of modules to include on this page. More...
 
 getModuleScripts ( $filter=false, $position=null)
 Get the list of module JS to include on this page. More...
 
 getModuleStyles ( $filter=false, $position=null)
 Get the list of module CSS to include on this page. More...
 
 getPageTitle ()
 Return the "page title", i.e. More...
 
 getPageTitleActionText ()
 Get the value of the "action text". More...
 
 getPreventClickjacking ()
 Get the prevent-clickjacking flag. More...
 
 getProperty ( $name)
 Get an additional output property. More...
 
 getRedirect ()
 Get the URL to redirect to, or an empty string if not redirect URL set. More...
 
 getResourceLoader ()
 Get a ResourceLoader object associated with this OutputPage. More...
 
 getRevisionId ()
 Get the displayed revision ID. More...
 
 getRevisionTimestamp ()
 Get the timestamp of displayed revision. More...
 
 getScript ()
 Get all registered JS and CSS tags for the header. More...
 
 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. More...
 
 getSubtitle ()
 Get the subtitle. More...
 
 getSyndicationLinks ()
 Return URLs for each supported syndication format for this page. More...
 
 getTarget ()
 
 getTemplateIds ()
 Get the templates used on this page. More...
 
 getVaryHeader ()
 Return a Vary: header on which to vary caches. More...
 
 getXVO ()
 Get a complete X-Vary-Options header. More...
 
 hasHeadItem ( $name)
 Check if the header item $name is already set. More...
 
 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. More...
 
 headElement (Skin $sk, $includeStyle=true)
 
 includeJQuery ( $modules=array())
 Include jQuery core. More...
 
 isArticle ()
 Return whether the content displayed page is related to the source of the corresponding article on the wiki. More...
 
 isArticleRelated ()
 Return whether this page is related an article on the wiki. More...
 
 isDisabled ()
 Return whether the output will be completely disabled. More...
 
 isPrintable ()
 Return whether the page is "printable". More...
 
 isSyndicated ()
 Should we output feed links for this page? More...
 
 isTOCEnabled ()
 
 isUserJsAllowed ()
 Return whether user JavaScript is allowed for this page. More...
 
 loginToUse ()
 Produce the stock "please login to use the wiki" page. More...
 
 out ( $ins)
 Actually output something with print. More...
 
 output ()
 Finally, all the text has been munged and accumulated into the object, let's actually output it: More...
 
 parse ( $text, $linestart=true, $interface=false, $language=null)
 Parse wikitext and return the HTML. More...
 
 parseInline ( $text, $linestart=true, $interface=false)
 Parse wikitext, strip paragraphs, and return the HTML. More...
 
 parserOptions ( $options=null)
 Get/set the ParserOptions object to use for wikitext parsing. More...
 
 permissionRequired ( $permission)
 Display an error page noting that a given permission bit is required. More...
 
 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). More...
 
 prependHTML ( $text)
 Prepend $text to the body HTML. More...
 
 preventClickjacking ( $enable=true)
 Set a flag which will cause an X-Frame-Options header appropriate for edit pages to be sent. More...
 
 rateLimited ()
 Turn off regular page output and return an error response for when rate limiting has triggered. More...
 
 readOnlyPage ( $source=null, $protected=false, $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. More...
 
 redirect ( $url, $responsecode='302')
 Redirect to $url rather than displaying the normal page. More...
 
 reduceAllowedModules ( $type, $level)
 As for setAllowedModules(), but don't inadvertently make the page more accessible. More...
 
 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. More...
 
 sectionEditLinksEnabled ()
 
 sendCacheControl ()
 Send cache control HTTP headers. More...
 
 setAllowedModules ( $type, $level)
 Set the highest level of CSS/JS untrustworthiness allowed. More...
 
 setArticleBodyOnly ( $only)
 Set whether the output should only contain the body of the article, without any skin, sidebar, etc. More...
 
 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. More...
 
 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. More...
 
 setCanonicalUrl ( $url)
 Set the URL to be used for the <link rel="canonical">. More...
 
 setCategoryLinks ( $categories)
 Reset the category links (but not the category list) and add $categories. More...
 
 setETag ( $tag)
 Set the value of the ETag HTTP header, only used if $wgUseETag is true. More...
 
 setFeedAppendQuery ( $val)
 Add default feeds to the page header This is mainly kept for backward compatibility, see OutputPage::addFeedLink() for the new version. More...
 
 setFileVersion ( $file)
 Set the displayed file version. More...
 
 setFollowPolicy ( $policy)
 Set the follow policy for the page, but leave the index policy un- touched. More...
 
 setHTMLTitle ( $name)
 "HTML title" means the contents of "<title>". More...
 
 setIndexPolicy ( $policy)
 Set the index policy for the page, but leave the follow policy un- touched. More...
 
 setLanguageLinks ( $newLinkArray)
 Reset the language links and add new language links. More...
 
 setLastModified ( $timestamp)
 Override the last modified timestamp. More...
 
 setPageTitle ( $name)
 "Page title" means the contents of <h1>. More...
 
 setPageTitleActionText ( $text)
 Set the new value of the "action text", this will be added to the "HTML title", separated from it with " - ". More...
 
 setPrintable ()
 Set the page as printable, i.e. More...
 
 setProperty ( $name, $value)
 Set an additional output property. More...
 
 setRedirectedFrom ( $t)
 Set $mRedirectedFrom, the Title of the page which redirected us to the current page. More...
 
 setRevisionId ( $revid)
 Set the revision ID which will be seen by the wiki text parser for things such as embedded {{REVISIONID}} variable use. More...
 
 setRevisionTimestamp ( $timestamp)
 Set the timestamp of the revision which will be displayed. More...
 
 setRobotPolicy ( $policy)
 Set the robot policy for the page: http://www.robotstxt.org/meta.html More...
 
 setSquidMaxage ( $maxage)
 Set the value of the "s-maxage" part of the "Cache-control" HTTP header. More...
 
 setStatusCode ( $statusCode)
 Set the HTTP status code to send with the output. More...
 
 setSubtitle ( $str)
 Replace the subtitle with $str. More...
 
 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. More...
 
 setTarget ( $target)
 Sets ResourceLoader target for load.php links. More...
 
 setTitle (Title $t)
 Set the Title object to use. More...
 
 showErrorPage ( $title, $msg, $params=array())
 Output a standard error page. More...
 
 showFatalError ( $message)
 
 showFileCopyError ( $old, $new)
 
 showFileDeleteError ( $name)
 
 showFileNotFoundError ( $name)
 
 showFileRenameError ( $old, $new)
 
 showLagWarning ( $lag)
 Show a warning about slave lag. More...
 
 showNewSectionLink ()
 Show an "add new section" link? More...
 
 showPermissionsErrorPage ( $errors, $action=null)
 Output a standard permission error page. More...
 
 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. More...
 
 versionRequired ( $version)
 Display an error page indicating that a given version of MediaWiki is required to use it. More...
 
 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. More...
 
- Public Member Functions inherited from ContextSource
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage(). More...
 
 exportSession ()
 Export the resolved user IP, HTTP headers, user ID, and session ID. More...
 
 getConfig ()
 Get the Config object. More...
 
 getContext ()
 Get the RequestContext object. More...
 
 getLang ()
 Get the Language object. More...
 
 getLanguage ()
 Get the Language object. More...
 
 getOutput ()
 Get the OutputPage object. More...
 
 getRequest ()
 Get the WebRequest object. More...
 
 getSkin ()
 Get the Skin object. More...
 
 getTitle ()
 Get the Title object. More...
 
 getUser ()
 Get the User object. More...
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ()
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 Set the IContextSource object. More...
 

Static Public Member Functions

static getStatusMessage ( $code)
 Get the message associated with the HTTP response code $code. More...
 
static transformCssMedia ( $media)
 Transform "media" attribute based on request parameters. More...
 

Public Attributes

 $mArticleBodyOnly = false
 Flag if output should only contain the body of the article. More...
 
 $mBodytext = ''
 Contains all of the "<body>" content. Should be private we got set/get accessors and the append() method. More...
 
 $mCanonicalUrl = false
 
 $mCategories = array()
 
 $mCategoryLinks = array()
 
 $mContainsNewMagic = 0
 
 $mContainsOldMagic = 0
 
 $mDebugtext = ''
 Holds the debug lines that will be output as comments in page source if $wgDebugComments is enabled. More...
 
bool $mDoNothing = false
 Whether output is disabled. More...
 
 $mEnableClientCache = true
 
 $mETag = false
 Should be private. More...
 
 $mExtStyles = array()
 Additional stylesheets. Looks like this is for extensions. Might be replaced by resource loader. More...
 
 $mFeedLinks = array()
 Handles the atom / rss links. More...
 
 $mFeedLinksAppendQuery = null
 
 $mFileVersion = null
 
 $mHeadItems = array()
 Array of elements in "<head>". Parser might add its own headers! More...
 
 $mHideNewSectionLink = false
 
 $mHTMLtitle = ''
 Should be private. Stores contents of "<title>" tag. More...
 
 $mImageTimeKeys = array()
 
 $mInlineMsg = array()
 
 $mInlineStyles = ''
 Inline CSS styles. More...
 
 $mIsarticle = false
 Should be private. Is the displayed content related to the source of the corresponding wiki article. More...
 
 $mIsArticleRelated = true
 Should be private. More...
 
 $mJsConfigVars = array()
 
 $mLanguageLinks = array()
 Should be private. Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page') More...
 
 $mLastModified = ''
 mLastModified and mEtag are used for sending cache control. More...
 
 $mLinkColours
 
 $mLinktags = array()
 
 $mMetatags = array()
 Should be private. Used with addMeta() which adds "<meta>". More...
 
 $mModuleMessages = array()
 
 $mModules = array()
 
 $mModuleScripts = array()
 
 $mModuleStyles = array()
 
 $mNewSectionLink = false
 
 $mNoGallery = false
 Comes from the parser. More...
 
 $mPageLinkTitle = ''
 Used by skin template. More...
 
 $mPagetitle = ''
 Should be private - has getter and setter. Contains the HTML title. More...
 
 $mPageTitleActionText = ''
 
 $mParseWarnings = array()
 
 $mPreventClickjacking = true
 
 $mPrintable = false
 Should be private. More...
 
 $mRedirect = ''
 
 $mRedirectCode = ''
 
 $mResourceLoader
 
 $mRevisionId = null
 should be private. To include the variable {{REVISIONID}} More...
 
 $mScripts = ''
 Should be private. More...
 
 $mSquidMaxage = 0
 
 $mStatusCode
 
 $mTemplateIds = array()
 
 $styles = array()
 An array of stylesheet filenames (relative from skins path), with options for CSS media, IE conditions, and RTL/LTR direction. More...
 

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

 $mAllowedModules
 
 $mJQueryDone = false
 Whether jQuery is already handled. More...
 
ParserOptions $mParserOptions = null
 lazy initialised, use parserOptions() More...
 

Private Member Functions

 feedLink ( $type, $url, $text)
 Generate a "<link rel/>" for a feed. More...
 

Private Attributes

bool $mEnableSectionEditLinks = true
 Whether parser output should contain section edit links. More...
 
bool $mEnableTOC = true
 Whether parser output should contain table of contents. More...
 
 $mFollowPolicy = 'follow'
 
 $mIndexPolicy = 'index'
 
 $mProperties = array()
 Additional key => value data. More...
 
Title $mRedirectedFrom = null
 If the current page was reached through a redirect, $mRedirectedFrom contains the Title of the redirect. More...
 
 $mRevisionTimestamp = null
 
 $mSubtitle = array()
 Should be private. More...
 
string null $mTarget = null
 ResourceLoader target for load.php links. More...
 
 $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

◆ __construct()

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.

Definition at line 268 of file OutputPage.php.

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

Member Function Documentation

◆ addAcceptLanguage()

OutputPage::addAcceptLanguage ( )

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

References addVaryHeader(), array(), as, ContextSource\getRequest(), ContextSource\getTitle(), and wfBCP47().

Referenced by sendCacheControl().

◆ addBacklinkSubtitle()

OutputPage::addBacklinkSubtitle ( Title  $title)

Add a subtitle containing a backlink to a page.

Parameters
Title$titleTitle to link to

Definition at line 952 of file OutputPage.php.

References $query, $title, addSubtitle(), array(), Linker\link(), and ContextSource\msg().

Referenced by readOnlyPage().

◆ addCategoryLinks()

OutputPage::addCategoryLinks (   $categories)

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

Parameters
array$categoriesmapping category name => sort key

Definition at line 1185 of file OutputPage.php.

References $dbr, $lb, $res, $title, $type, $wgContLang, array(), as, DB_SLAVE, global, Linker\link(), Title\makeTitleSafe(), NS_CATEGORY, LinkCache\singleton(), wfGetDB(), and wfRunHooks().

Referenced by addParserOutputNoText(), and setCategoryLinks().

◆ addElement()

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

Shortcut for adding an Html::element via addHTML.

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

Definition at line 1355 of file OutputPage.php.

References $attribs, addHTML(), and Html\element().

◆ addExtensionStyle()

OutputPage::addExtensionStyle (   $url)

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.

◆ addFeedLink()

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

References global.

◆ addHeadItem()

OutputPage::addHeadItem (   $name,
  $value 
)

Add or replace an header item to the output.

Parameters
string$nameitem name
string$valueraw HTML

Definition at line 599 of file OutputPage.php.

References $name, and $value.

Referenced by SkinVector\initPage().

◆ addHTML()

◆ addInlineScript()

OutputPage::addInlineScript (   $script)

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

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

Definition at line 421 of file OutputPage.php.

References Html\inlineScript().

◆ addInlineStyle()

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

References ContextSource\getLanguage(), Html\inlineStyle(), and CSSJanus\transform().

◆ addJsConfigVars()

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

References $keys, $value, and as.

Referenced by addParserOutputNoText().

◆ addLanguageLinks()

OutputPage::addLanguageLinks (   $newLinkArray)

Add new language links.

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

Definition at line 1157 of file OutputPage.php.

◆ addLink()

OutputPage::addLink (   $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 325 of file OutputPage.php.

Referenced by addMetadataLink().

◆ addMeta()

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

References $name, and array().

◆ addMetadataLink()

OutputPage::addMetadataLink (   $linkarr)

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

References addLink(), and getMetadataAttribute().

◆ addModuleMessages()

OutputPage::addModuleMessages (   $modules)

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

References array().

Referenced by addParserOutputNoText().

◆ addModules()

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

References array().

Referenced by addParserOutputNoText(), and output().

◆ addModuleScripts()

OutputPage::addModuleScripts (   $modules)

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

References array().

Referenced by addParserOutputNoText().

◆ addModuleStyles()

OutputPage::addModuleStyles (   $modules)

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

References array().

Referenced by addParserOutputNoText().

◆ addParserOutput()

OutputPage::addParserOutput ( $parserOutput)

Add a ParserOutput object.

Parameters
ParserOutput$parserOutput

Definition at line 1614 of file OutputPage.php.

References addHTML(), addParserOutputNoText(), array(), and wfRunHooks().

Referenced by addWikiTextTitle().

◆ addParserOutputNoText()

OutputPage::addParserOutputNoText ( $parserOutput)

◆ addReturnTo()

OutputPage::addReturnTo (   $title,
  $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 2456 of file OutputPage.php.

References $link, $options, $query, $title, addHTML(), array(), Linker\link(), and ContextSource\msg().

Referenced by returnToMain().

◆ addScript()

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.

Referenced by addScriptFile().

◆ addScriptFile()

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.

References $file, $path, $version, addScript(), global, Html\linkedScript(), and wfAppendQuery().

◆ addStyle()

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

References $dir, $options, and array().

Referenced by buildCssLinksArray().

◆ addSubtitle()

OutputPage::addSubtitle (   $str)

Add $str to the subtitle.

Parameters
string | Message$strto add to the subtitle. String should be safe HTML.

Definition at line 939 of file OutputPage.php.

References ContextSource\getContext().

Referenced by addBacklinkSubtitle(), appendSubtitle(), and setSubtitle().

◆ addTemplate()

OutputPage::addTemplate ( $template)

Add the output of a QuickTemplate to the output buffer.

Parameters
QuickTemplate$template

Definition at line 1632 of file OutputPage.php.

References addHTML().

◆ addVaryHeader()

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

References array().

Referenced by addAcceptLanguage(), getXVO(), output(), and sendCacheControl().

◆ addWikiMsg()

OutputPage::addWikiMsg ( )

Add a wikitext-formatted message to the output.

This is equivalent to:

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

Definition at line 3602 of file OutputPage.php.

References $args, $name, and addWikiMsgArray().

Referenced by readOnlyPage(), and versionRequired().

◆ addWikiMsgArray()

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

References $args, $name, addHTML(), and ContextSource\msg().

Referenced by addWikiMsg(), and showErrorPage().

◆ addWikiText()

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

References $title, addWikiTextTitle(), and ContextSource\getTitle().

Referenced by readOnlyPage(), showPermissionsErrorPage(), and wrapWikiMsg().

◆ addWikiTextTidy()

OutputPage::addWikiTextTidy (   $text,
  $linestart = true 
)

Add wikitext with tidy enabled.

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

Definition at line 1519 of file OutputPage.php.

References $title, addWikiTextTitleTidy(), and ContextSource\getTitle().

◆ addWikiTextTitle()

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

References $title, $wgParser, addParserOutput(), global, parserOptions(), wfProfileIn(), and wfProfileOut().

Referenced by addWikiText(), addWikiTextTitleTidy(), and addWikiTextWithTitle().

◆ addWikiTextTitleTidy()

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

References $title, and addWikiTextTitle().

Referenced by addWikiTextTidy().

◆ addWikiTextWithTitle()

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

References $title, and addWikiTextTitle().

◆ allowClickjacking()

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

◆ appendSubtitle()

OutputPage::appendSubtitle (   $str)

Add $str to the subtitle.

Deprecated:
in 1.19; use addSubtitle() instead
Parameters
string | Message$strto add to the subtitle

Definition at line 930 of file OutputPage.php.

References addSubtitle().

◆ blockedPage()

OutputPage::blockedPage ( )

Produce a "user is blocked" page.

Deprecated:
since 1.18

Definition at line 2118 of file OutputPage.php.

References ContextSource\getUser().

◆ buildCssLinks()

OutputPage::buildCssLinks ( )

◆ buildCssLinksArray()

OutputPage::buildCssLinksArray ( )
Returns
array

Definition at line 3494 of file OutputPage.php.

References $file, $link, $options, addStyle(), array(), as, and styleLink().

Referenced by buildCssLinks().

◆ checkLastModified()

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

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

Definition at line 679 of file OutputPage.php.

References $name, $timestamp, $value, array(), as, disable(), ContextSource\getRequest(), ContextSource\getUser(), global, sendCacheControl(), TS_ISO_8601, TS_MW, TS_RFC2822, wfClearOutputBuffers(), wfDebug(), wfRestoreWarnings(), wfRunHooks(), wfSuppressWarnings(), and wfTimestamp().

◆ clearHTML()

OutputPage::clearHTML ( )

Clear the body HTML.

Definition at line 1362 of file OutputPage.php.

Referenced by prepareErrorPage().

◆ clearSubtitle()

OutputPage::clearSubtitle ( )

Clear the subtitles.

Definition at line 963 of file OutputPage.php.

References array().

Referenced by prepareErrorPage(), and setSubtitle().

◆ disable()

OutputPage::disable ( )

Disable output completely, i.e.

calling output() will have no effect

Definition at line 996 of file OutputPage.php.

Referenced by checkLastModified().

◆ disallowUserJs()

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.

Definition at line 1276 of file OutputPage.php.

References ResourceLoaderModule\ORIGIN_CORE_INDIVIDUAL, reduceAllowedModules(), and ResourceLoaderModule\TYPE_SCRIPTS.

◆ enableClientCache()

OutputPage::enableClientCache (   $state)

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

Parameters
bool$state
Returns
bool

Definition at line 1715 of file OutputPage.php.

References wfSetVar().

Referenced by addParserOutputNoText(), and prepareErrorPage().

◆ enableSectionEditLinks()

OutputPage::enableSectionEditLinks (   $flag = true)

Enables/disables section edit links, doesn't override NOEDITSECTION

Parameters
bool$flag
Since
1.23

Definition at line 3703 of file OutputPage.php.

◆ enableTOC()

OutputPage::enableTOC (   $flag = true)

Enables/disables TOC, doesn't override NOTOC

Parameters
bool$flag
Since
1.22

Definition at line 3686 of file OutputPage.php.

◆ feedLink()

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

References array(), and Html\element().

Referenced by getHeadLinksArray().

◆ filterModules()

OutputPage::filterModules (   $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 442 of file OutputPage.php.

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

Referenced by getModules().

◆ forceHideNewSectionLink()

OutputPage::forceHideNewSectionLink ( )

Forcibly hide the new section link?

Returns
bool

Definition at line 1023 of file OutputPage.php.

References $mHideNewSectionLink.

◆ formatPermissionsErrorMessage()

OutputPage::formatPermissionsErrorMessage (   $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 2287 of file OutputPage.php.

References $error, array(), as, and ContextSource\msg().

Referenced by readOnlyPage(), and showPermissionsErrorPage().

◆ getAllowedModules()

OutputPage::getAllowedModules (   $type)

Show what level of JavaScript / CSS untrustworthiness is allowed on this page.

See also
ResourceLoaderModule::$origin
Parameters
string$typeResourceLoaderModule TYPE_ constant
Returns
int ResourceLoaderModule ORIGIN_ class constant

Definition at line 1300 of file OutputPage.php.

References $type, ResourceLoaderModule\ORIGIN_ALL, and ResourceLoaderModule\TYPE_COMBINED.

Referenced by filterModules(), isUserJsAllowed(), makeResourceLoaderLink(), and reduceAllowedModules().

◆ getArticleBodyOnly()

OutputPage::getArticleBodyOnly ( )

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

Returns
bool

Definition at line 638 of file OutputPage.php.

References $mArticleBodyOnly.

◆ getBottomScripts()

OutputPage::getBottomScripts ( )

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

Returns
string

Definition at line 2944 of file OutputPage.php.

References $html, getScriptsForBottomQueue(), global, and Html\inlineScript().

◆ getCacheVaryCookies()

OutputPage::getCacheVaryCookies ( )

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

Returns
array

Definition at line 1724 of file OutputPage.php.

References $cookies, $wgCookiePrefix, array(), global, and wfRunHooks().

Referenced by getXVO(), and haveCacheVaryCookies().

◆ getCategories()

OutputPage::getCategories ( )

Get the list of category names this page belongs to.

Returns
array Array of strings

Definition at line 1268 of file OutputPage.php.

References $mCategories.

Referenced by getJSVars().

◆ getCategoryLinks()

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.

Returns
array

Definition at line 1259 of file OutputPage.php.

References $mCategoryLinks.

◆ getExtStyle()

OutputPage::getExtStyle ( )

Get all styles added by extensions.

Returns
array

Definition at line 391 of file OutputPage.php.

References $mExtStyles.

◆ getFeedAppendQuery()

OutputPage::getFeedAppendQuery ( )

Will currently always return null.

Returns
null

Definition at line 1101 of file OutputPage.php.

References $mFeedLinksAppendQuery.

◆ getFileSearchOptions()

OutputPage::getFileSearchOptions ( )

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

References $mImageTimeKeys.

◆ getFileVersion()

OutputPage::getFileVersion ( )

Get the displayed file version.

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

Definition at line 1451 of file OutputPage.php.

References $mFileVersion.

◆ getFrameOptions()

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.

Returns
string

Definition at line 1895 of file OutputPage.php.

References global.

Referenced by getJSVars(), and output().

◆ getHeadItems()

OutputPage::getHeadItems ( )

Get all header items in a string.

Returns
string

Definition at line 585 of file OutputPage.php.

References $s, and as.

Referenced by getScript(), and headElement().

◆ getHeadItemsArray()

OutputPage::getHeadItemsArray ( )

Get an array of head items.

Returns
array

Definition at line 576 of file OutputPage.php.

References $mHeadItems.

◆ getHeadLinks()

OutputPage::getHeadLinks ( )
Returns
string HTML tag links to be put in the header.

Definition at line 3347 of file OutputPage.php.

References getHeadLinksArray().

Referenced by headElement().

◆ getHeadLinksArray()

◆ getHeadScripts()

OutputPage::getHeadScripts ( )

◆ getHTML()

OutputPage::getHTML ( )

Get the body HTML.

Returns
string HTML

Definition at line 1371 of file OutputPage.php.

References $mBodytext.

◆ getHtmlFromLoaderLinks()

static OutputPage::getHtmlFromLoaderLinks ( Array  $links)
staticprotected

Build html output from an array of links from makeResourceLoaderLink.

Parameters
array$links
Returns
string HTML

Definition at line 2795 of file OutputPage.php.

References $html, $link, array(), as, Html\inlineScript(), ResourceLoader\makeLoaderConditionalScript(), and ResourceLoader\makeLoaderStateScript().

Referenced by buildCssLinks(), getHeadScripts(), and getScriptsForBottomQueue().

◆ getHTMLTitle()

OutputPage::getHTMLTitle ( )

Return the "HTML title", i.e.

the content of the "<title>" tag.

Returns
string

Definition at line 858 of file OutputPage.php.

References $mHTMLtitle.

Referenced by headElement().

◆ getJsConfigVars()

OutputPage::getJsConfigVars ( )

Get the javascript config vars to include on this page.

Returns
array Array of javascript config vars
Since
1.23

Definition at line 2966 of file OutputPage.php.

References $mJsConfigVars.

Referenced by getJSVars().

◆ getJSVars()

OutputPage::getJSVars ( )

Get an array containing the variables to be set in mw.config in JavaScript.

DO NOT CALL THIS FROM OUTSIDE OF THIS CLASS OR Skin::makeGlobalVariablesScript(). This is only public until that function is removed. You have been warned.

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

References $title, $type, $user, $vars, $wgContLang, array(), as, ContextSource\canUseWikiPage(), MWNamespace\exists(), Action\getActionName(), MWNamespace\getCanonicalName(), getCategories(), ContextSource\getContext(), getFrameOptions(), getJsConfigVars(), getRevisionId(), ContextSource\getSkin(), ContextSource\getTitle(), ContextSource\getUser(), ContextSource\getWikiPage(), global, isArticle(), list, NS_SPECIAL, SpecialPageFactory\resolveAlias(), TS_UNIX, wfRunHooks(), and wfTimestampOrNull().

Referenced by getHeadScripts().

◆ getLanguageLinks()

OutputPage::getLanguageLinks ( )

Get the list of language links.

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

Definition at line 1176 of file OutputPage.php.

References $mLanguageLinks.

◆ getMetadataAttribute()

OutputPage::getMetadataAttribute ( )

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

Returns
string

Definition at line 354 of file OutputPage.php.

Referenced by addMetadataLink().

◆ getModuleMessages()

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

References getModules().

Referenced by getHeadScripts(), and getScriptsForBottomQueue().

◆ getModules()

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

References filterModules().

Referenced by getHeadScripts(), getModuleMessages(), getModuleScripts(), getModuleStyles(), and getScriptsForBottomQueue().

◆ getModuleScripts()

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

References getModules().

Referenced by getHeadScripts(), and getScriptsForBottomQueue().

◆ getModuleStyles()

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

References getModules().

Referenced by buildCssLinks().

◆ getPageTitle()

OutputPage::getPageTitle ( )

Return the "page title", i.e.

the content of the <h1> tag.

Returns
string

Definition at line 901 of file OutputPage.php.

References $mPagetitle.

Referenced by headElement().

◆ getPageTitleActionText()

OutputPage::getPageTitleActionText ( )

Get the value of the "action text".

Returns
string

Definition at line 832 of file OutputPage.php.

References $mPageTitleActionText.

◆ getPreventClickjacking()

OutputPage::getPreventClickjacking ( )

Get the prevent-clickjacking flag.

Since
1.24
Returns
boolean

Definition at line 1884 of file OutputPage.php.

References $mPreventClickjacking.

◆ getProperty()

OutputPage::getProperty (   $name)

Get an additional output property.

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

Definition at line 660 of file OutputPage.php.

References $name.

◆ getRedirect()

OutputPage::getRedirect ( )

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

Returns
string

Definition at line 294 of file OutputPage.php.

References $mRedirect.

◆ getResourceLoader()

OutputPage::getResourceLoader ( )

Get a ResourceLoader object associated with this OutputPage.

Returns
ResourceLoader

Definition at line 2586 of file OutputPage.php.

References $mResourceLoader.

Referenced by buildCssLinks(), filterModules(), and makeResourceLoaderLink().

◆ getRevisionId()

OutputPage::getRevisionId ( )

Get the displayed revision ID.

Returns
int

Definition at line 1407 of file OutputPage.php.

References $mRevisionId.

Referenced by getJSVars().

◆ getRevisionTimestamp()

OutputPage::getRevisionTimestamp ( )

Get the timestamp of displayed revision.

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

Returns
string|null

Definition at line 1428 of file OutputPage.php.

References $mRevisionTimestamp.

◆ getScript()

OutputPage::getScript ( )

Get all registered JS and CSS tags for the header.

Returns
string

Definition at line 430 of file OutputPage.php.

References getHeadItems().

◆ getScriptsForBottomQueue()

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

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

Definition at line 2876 of file OutputPage.php.

References $mScripts, array(), Xml\encodeJsCall(), getHtmlFromLoaderLinks(), getModuleMessages(), getModules(), getModuleScripts(), ContextSource\getRequest(), ContextSource\getTitle(), ContextSource\getUser(), global, Html\inlineScript(), ResourceLoader\makeLoaderConditionalScript(), makeResourceLoaderLink(), ResourceLoaderModule\TYPE_COMBINED, ResourceLoaderModule\TYPE_MESSAGES, ResourceLoaderModule\TYPE_SCRIPTS, and userCanPreview().

Referenced by getBottomScripts(), and getHeadScripts().

◆ getStatusMessage()

static OutputPage::getStatusMessage (   $code)
static

Get the message associated with the HTTP response code $code.

Parameters
int$codeStatus code
Returns
string|null Message or null if $code is not in the list of messages
Deprecated:
since 1.18 Use HttpStatus::getMessage() instead.

Definition at line 1981 of file OutputPage.php.

References HttpStatus\getMessage(), and wfDeprecated().

◆ getSubtitle()

OutputPage::getSubtitle ( )

Get the subtitle.

Returns
string

Definition at line 972 of file OutputPage.php.

◆ getSyndicationLinks()

OutputPage::getSyndicationLinks ( )

Return URLs for each supported syndication format for this page.

Returns
array associating format keys with URLs

Definition at line 1092 of file OutputPage.php.

References $mFeedLinks.

Referenced by getHeadLinksArray().

◆ getTarget()

OutputPage::getTarget ( )
Returns
null|string ResourceLoader target

Definition at line 558 of file OutputPage.php.

References $mTarget.

◆ getTemplateIds()

OutputPage::getTemplateIds ( )

Get the templates used on this page.

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

Definition at line 1461 of file OutputPage.php.

References $mTemplateIds.

◆ getVaryHeader()

OutputPage::getVaryHeader ( )

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

Referenced by sendCacheControl().

◆ getXVO()

OutputPage::getXVO ( )

Get a complete X-Vary-Options header.

Returns
string

Definition at line 1801 of file OutputPage.php.

References addVaryHeader(), array(), as, and getCacheVaryCookies().

Referenced by sendCacheControl().

◆ hasHeadItem()

OutputPage::hasHeadItem (   $name)

Check if the header item $name is already set.

Parameters
string$nameItem name
Returns
bool

Definition at line 609 of file OutputPage.php.

References $name.

◆ haveCacheVaryCookies()

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.

Returns
bool

Definition at line 1748 of file OutputPage.php.

References as, getCacheVaryCookies(), ContextSource\getRequest(), and wfDebug().

Referenced by sendCacheControl().

◆ headElement()

◆ includeJQuery()

OutputPage::includeJQuery (   $modules = array())

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

References array().

◆ isArticle()

OutputPage::isArticle ( )

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

Returns
bool

Definition at line 1125 of file OutputPage.php.

References $mIsarticle.

Referenced by getJSVars().

◆ isArticleRelated()

OutputPage::isArticleRelated ( )

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

Returns
bool

Definition at line 1147 of file OutputPage.php.

References $mIsArticleRelated.

Referenced by getHeadLinksArray().

◆ isDisabled()

OutputPage::isDisabled ( )

Return whether the output will be completely disabled.

Returns
bool

Definition at line 1005 of file OutputPage.php.

References $mDoNothing.

◆ isPrintable()

OutputPage::isPrintable ( )

Return whether the page is "printable".

Returns
bool

Definition at line 989 of file OutputPage.php.

References $mPrintable.

Referenced by makeResourceLoaderLink(), and sendCacheControl().

◆ isSyndicated()

OutputPage::isSyndicated ( )

Should we output feed links for this page?

Returns
bool

Definition at line 1084 of file OutputPage.php.

◆ isTOCEnabled()

OutputPage::isTOCEnabled ( )
Returns
bool
Since
1.22

Definition at line 3694 of file OutputPage.php.

References $mEnableTOC.

◆ isUserJsAllowed()

OutputPage::isUserJsAllowed ( )

Return whether user JavaScript is allowed for this page.

Deprecated:
since 1.18 Load modules with ResourceLoader, and origin and trustworthiness is identified and enforced automagically.
Returns
bool

Definition at line 1289 of file OutputPage.php.

References getAllowedModules(), ResourceLoaderModule\ORIGIN_USER_INDIVIDUAL, ResourceLoaderModule\TYPE_SCRIPTS, and wfDeprecated().

◆ loginToUse()

OutputPage::loginToUse ( )

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

Deprecated:
in 1.19; throw the exception directly

Definition at line 2276 of file OutputPage.php.

◆ makeResourceLoaderLink()

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

References ContextSource\$context, $link, $mTarget, $name, $query, $resourceLoader, $timestamp, $user, $version, array(), as, Xml\element(), Xml\encodeJsCall(), getAllowedModules(), ContextSource\getLanguage(), ContextSource\getRequest(), getResourceLoader(), ContextSource\getSkin(), ContextSource\getUser(), global, ResourceLoader\inDebugMode(), Html\inlineScript(), Html\inlineStyle(), isPrintable(), Html\linkedScript(), Html\linkedStyle(), ResourceLoader\makeLoaderConditionalScript(), ResourceLoader\makeLoaderQuery(), ResourceLoader\makeLoaderURL(), Html\rawElement(), TS_ISO_8601_BASIC, ResourceLoaderModule\TYPE_COMBINED, ResourceLoaderModule\TYPE_SCRIPTS, ResourceLoaderModule\TYPE_STYLES, and wfTimestamp().

Referenced by buildCssLinks(), getHeadScripts(), and getScriptsForBottomQueue().

◆ out()

OutputPage::out (   $ins)

Actually output something with print.

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

Definition at line 2109 of file OutputPage.php.

References wfDeprecated().

◆ output()

OutputPage::output ( )

◆ parse()

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

References $wgParser, ContextSource\getTitle(), global, and parserOptions().

Referenced by parseInline(), and showPermissionsErrorPage().

◆ parseInline()

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

References array(), and parse().

◆ parserOptions()

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

References $options, ContextSource\getContext(), ParserOptions\newFromContext(), and wfSetVar().

Referenced by addWikiTextTitle(), and parse().

◆ permissionRequired()

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

◆ prepareErrorPage()

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

References clearHTML(), clearSubtitle(), enableClientCache(), setArticleRelated(), setHTMLTitle(), setPageTitle(), and setRobotPolicy().

Referenced by showErrorPage(), showFatalError(), showPermissionsErrorPage(), and versionRequired().

◆ prependHTML()

OutputPage::prependHTML (   $text)

Prepend $text to the body HTML.

Parameters
string$textHTML

Definition at line 1333 of file OutputPage.php.

References $mBodytext.

◆ preventClickjacking()

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.

Parameters
bool$enable

Definition at line 1865 of file OutputPage.php.

◆ rateLimited()

OutputPage::rateLimited ( )

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

Definition at line 2398 of file OutputPage.php.

◆ readOnlyPage()

OutputPage::readOnlyPage (   $source = null,
  $protected = false,
  $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 2338 of file OutputPage.php.

References $params, $source, addBacklinkSubtitle(), addHTML(), addWikiMsg(), addWikiText(), array(), Html\element(), formatPermissionsErrorMessage(), Linker\formatTemplates(), ContextSource\getTitle(), ContextSource\getUser(), ContextSource\msg(), returnToMain(), setArticleRelated(), setPageTitle(), and setRobotPolicy().

◆ redirect()

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

Redirect to $url rather than displaying the normal page.

Parameters
string$urlURL
string$responsecodeHTTP status code

Definition at line 283 of file OutputPage.php.

Referenced by WebInstaller\execute().

◆ reduceAllowedModules()

OutputPage::reduceAllowedModules (   $type,
  $level 
)

As for setAllowedModules(), but don't inadvertently make the page more accessible.

Parameters
string$type
int$levelResourceLoaderModule class constant

Definition at line 1324 of file OutputPage.php.

References $type, and getAllowedModules().

Referenced by disallowUserJs().

◆ returnToMain()

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

References addReturnTo(), ContextSource\getRequest(), Title\newFromText(), Title\newMainPage(), and wfCgiToArray().

Referenced by readOnlyPage(), showErrorPage(), showPermissionsErrorPage(), and versionRequired().

◆ sectionEditLinksEnabled()

OutputPage::sectionEditLinksEnabled ( )
Returns
bool
Since
1.23

Definition at line 3711 of file OutputPage.php.

References $mEnableSectionEditLinks.

◆ sendCacheControl()

OutputPage::sendCacheControl ( )

◆ setAllowedModules()

OutputPage::setAllowedModules (   $type,
  $level 
)

Set the highest level of CSS/JS untrustworthiness allowed.

Parameters
string$typeResourceLoaderModule TYPE_ constant
int$levelResourceLoaderModule class constant

Definition at line 1315 of file OutputPage.php.

References $type.

◆ setArticleBodyOnly()

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

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

Definition at line 629 of file OutputPage.php.

◆ setArticleFlag()

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

Parameters
bool$v

Definition at line 1112 of file OutputPage.php.

◆ setArticleRelated()

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

Parameters
bool$v

Definition at line 1135 of file OutputPage.php.

Referenced by prepareErrorPage(), and readOnlyPage().

◆ setCanonicalUrl()

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.

Definition at line 345 of file OutputPage.php.

◆ setCategoryLinks()

OutputPage::setCategoryLinks (   $categories)

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

Parameters
array$categoriesmapping category name => sort key

Definition at line 1246 of file OutputPage.php.

References addCategoryLinks(), and array().

◆ setETag()

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

◆ setFeedAppendQuery()

OutputPage::setFeedAppendQuery (   $val)

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

References $query, $type, array(), as, ContextSource\getTitle(), and global.

Referenced by setSyndicated().

◆ setFileVersion()

OutputPage::setFileVersion (   $file)

Set the displayed file version.

Parameters
File | bool$file
Returns
mixed Previous value

Definition at line 1438 of file OutputPage.php.

References $file, array(), and wfSetVar().

◆ setFollowPolicy()

OutputPage::setFollowPolicy (   $policy)

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

References array().

Referenced by setRobotPolicy().

◆ setHTMLTitle()

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.

Parameters
string$name

Definition at line 845 of file OutputPage.php.

References $name, and ContextSource\getContext().

Referenced by headElement(), prepareErrorPage(), and setPageTitle().

◆ setIndexPolicy()

OutputPage::setIndexPolicy (   $policy)

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

References array().

Referenced by setRobotPolicy().

◆ setLanguageLinks()

OutputPage::setLanguageLinks (   $newLinkArray)

Reset the language links and add new language links.

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

Definition at line 1167 of file OutputPage.php.

◆ setLastModified()

OutputPage::setLastModified (   $timestamp)

Override the last modified timestamp.

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

Definition at line 766 of file OutputPage.php.

References $timestamp, TS_RFC2822, and wfTimestamp().

◆ setPageTitle()

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.

Parameters
string | Message$name

Definition at line 879 of file OutputPage.php.

References $name, ContextSource\getContext(), ContextSource\msg(), Sanitizer\normalizeCharReferences(), Sanitizer\removeHTMLtags(), setHTMLTitle(), and Sanitizer\stripAllTags().

Referenced by prepareErrorPage(), and readOnlyPage().

◆ setPageTitleActionText()

OutputPage::setPageTitleActionText (   $text)

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

◆ setPrintable()

OutputPage::setPrintable ( )

Set the page as printable, i.e.

it'll be displayed with with all print styles included

Definition at line 980 of file OutputPage.php.

◆ setProperty()

OutputPage::setProperty (   $name,
  $value 
)

Set an additional output property.

Since
1.21
Parameters
string$name
mixed$value

Definition at line 649 of file OutputPage.php.

References $name, and $value.

◆ setRedirectedFrom()

OutputPage::setRedirectedFrom (   $t)

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

Parameters
Title$t

Definition at line 867 of file OutputPage.php.

References $t.

◆ setRevisionId()

OutputPage::setRevisionId (   $revid)

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

References wfSetVar().

◆ setRevisionTimestamp()

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

Parameters
string | null$timestamp
Returns
mixed Previous value

Definition at line 1418 of file OutputPage.php.

References $timestamp, and wfSetVar().

◆ setRobotPolicy()

OutputPage::setRobotPolicy (   $policy)

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

References Article\formatRobotPolicy(), setFollowPolicy(), and setIndexPolicy().

Referenced by prepareErrorPage(), and readOnlyPage().

◆ setSquidMaxage()

OutputPage::setSquidMaxage (   $maxage)

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

◆ setStatusCode()

OutputPage::setStatusCode (   $statusCode)

Set the HTTP status code to send with the output.

Parameters
int$statusCode

Definition at line 303 of file OutputPage.php.

◆ setSubtitle()

OutputPage::setSubtitle (   $str)

Replace the subtitle with $str.

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

Definition at line 919 of file OutputPage.php.

References addSubtitle(), and clearSubtitle().

◆ setSyndicated()

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.

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

Definition at line 1035 of file OutputPage.php.

References array(), and setFeedAppendQuery().

◆ setTarget()

OutputPage::setTarget (   $target)

Sets ResourceLoader target for load.php links.

If null, will be omitted

Parameters
string | null$target

Definition at line 567 of file OutputPage.php.

◆ setTitle()

OutputPage::setTitle ( Title  $t)

Set the Title object to use.

Parameters
Title$t

Definition at line 910 of file OutputPage.php.

References ContextSource\getContext().

◆ showErrorPage()

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

References $params, $title, addHTML(), addWikiMsgArray(), array(), ContextSource\msg(), prepareErrorPage(), and returnToMain().

◆ showFatalError()

OutputPage::showFatalError (   $message)

◆ showFileCopyError()

OutputPage::showFileCopyError (   $old,
  $new 
)

Definition at line 2432 of file OutputPage.php.

References ContextSource\msg(), showFatalError(), and text.

◆ showFileDeleteError()

OutputPage::showFileDeleteError (   $name)

Definition at line 2440 of file OutputPage.php.

References $name, ContextSource\msg(), showFatalError(), and text.

◆ showFileNotFoundError()

OutputPage::showFileNotFoundError (   $name)

Definition at line 2444 of file OutputPage.php.

References $name, ContextSource\msg(), showFatalError(), and text.

◆ showFileRenameError()

OutputPage::showFileRenameError (   $old,
  $new 
)

Definition at line 2436 of file OutputPage.php.

References ContextSource\msg(), showFatalError(), and text.

◆ showLagWarning()

OutputPage::showLagWarning (   $lag)

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

References array(), ContextSource\getLanguage(), global, Html\rawElement(), and wrapWikiMsg().

◆ showNewSectionLink()

OutputPage::showNewSectionLink ( )

Show an "add new section" link?

Returns
bool

Definition at line 1014 of file OutputPage.php.

References $mNewSectionLink.

◆ showPermissionsErrorPage()

OutputPage::showPermissionsErrorPage (   $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 2182 of file OutputPage.php.

References $query, addHTML(), addWikiText(), array(), formatPermissionsErrorMessage(), ContextSource\getRequest(), SpecialPage\getTitleFor(), ContextSource\getUser(), User\groupHasPermission(), Linker\linkKnown(), ContextSource\msg(), Title\newFromURL(), Title\newMainPage(), parse(), prepareErrorPage(), returnToMain(), and wfArrayToCgi().

◆ showUnexpectedValueError()

OutputPage::showUnexpectedValueError (   $name,
  $val 
)

Definition at line 2428 of file OutputPage.php.

References $name, ContextSource\msg(), showFatalError(), and text.

◆ styleLink()

OutputPage::styleLink (   $style,
  $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 3519 of file OutputPage.php.

References $link, $options, ContextSource\getLanguage(), global, Html\linkedStyle(), and transformCssMedia().

Referenced by buildCssLinksArray().

◆ transformCssMedia()

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

References array(), as, and global.

Referenced by OutputPageTest\assertTransformCssMediaCase(), ResourceLoader\makeCombinedStyles(), and styleLink().

◆ userCanPreview()

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

If it's not passed back with the preview request, we won't render the code.

Returns
bool

Definition at line 3114 of file OutputPage.php.

References ContextSource\getRequest(), ContextSource\getTitle(), and ContextSource\getUser().

Referenced by buildCssLinks(), and getScriptsForBottomQueue().

◆ versionRequired()

OutputPage::versionRequired (   $version)

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

References $version, addWikiMsg(), ContextSource\msg(), prepareErrorPage(), and returnToMain().

◆ wrapWikiMsg()

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

References $args, $n, $name, $s, addWikiText(), array(), as, ContextSource\msg(), and wfDeprecated().

Referenced by showLagWarning().

Member Data Documentation

◆ $mAllowedModules

OutputPage::$mAllowedModules
protected

◆ $mArticleBodyOnly

OutputPage::$mArticleBodyOnly = false

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

Should be private.

Definition at line 190 of file OutputPage.php.

Referenced by getArticleBodyOnly().

◆ $mBodytext

OutputPage::$mBodytext = ''

Contains all of the "<body>" content. Should be private we got set/get accessors and the append() method.

Definition at line 52 of file OutputPage.php.

Referenced by getHTML(), output(), and prependHTML().

◆ $mCanonicalUrl

OutputPage::$mCanonicalUrl = false

Definition at line 43 of file OutputPage.php.

Referenced by getHeadLinksArray().

◆ $mCategories

OutputPage::$mCategories = array()

Definition at line 109 of file OutputPage.php.

Referenced by getCategories().

◆ $mCategoryLinks

OutputPage::$mCategoryLinks = array()

Definition at line 108 of file OutputPage.php.

Referenced by getCategoryLinks().

◆ $mContainsNewMagic

OutputPage::$mContainsNewMagic = 0

Definition at line 168 of file OutputPage.php.

◆ $mContainsOldMagic

OutputPage::$mContainsOldMagic = 0

Definition at line 168 of file OutputPage.php.

◆ $mDebugtext

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

◆ $mDoNothing

bool OutputPage::$mDoNothing = false

Whether output is disabled.

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

$mDoNothing

Definition at line 165 of file OutputPage.php.

Referenced by isDisabled().

◆ $mEnableClientCache

OutputPage::$mEnableClientCache = true

Definition at line 184 of file OutputPage.php.

◆ $mEnableSectionEditLinks

bool OutputPage::$mEnableSectionEditLinks = true
private

Whether parser output should contain section edit links.

Definition at line 261 of file OutputPage.php.

Referenced by sectionEditLinksEnabled().

◆ $mEnableTOC

bool OutputPage::$mEnableTOC = true
private

Whether parser output should contain table of contents.

Definition at line 257 of file OutputPage.php.

Referenced by isTOCEnabled().

◆ $mETag

OutputPage::$mETag = false

Should be private.

No getter but used in sendCacheControl(); 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 106 of file OutputPage.php.

◆ $mExtStyles

OutputPage::$mExtStyles = array()

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

Definition at line 46 of file OutputPage.php.

Referenced by getExtStyle().

◆ $mFeedLinks

OutputPage::$mFeedLinks = array()

Handles the atom / rss links.

We probably only support atom in 2011. Looks like a private variable.

See also
$wgAdvertisedFeedTypes

Definition at line 181 of file OutputPage.php.

Referenced by getSyndicationLinks().

◆ $mFeedLinksAppendQuery

OutputPage::$mFeedLinksAppendQuery = null

Definition at line 152 of file OutputPage.php.

Referenced by getFeedAppendQuery().

◆ $mFileVersion

OutputPage::$mFileVersion = null

Definition at line 216 of file OutputPage.php.

Referenced by getFileVersion().

◆ $mFollowPolicy

OutputPage::$mFollowPolicy = 'follow'
private

Definition at line 234 of file OutputPage.php.

◆ $mHeadItems

OutputPage::$mHeadItems = array()

Array of elements in "<head>". Parser might add its own headers!

Definition at line 137 of file OutputPage.php.

Referenced by getHeadItemsArray().

◆ $mHideNewSectionLink

OutputPage::$mHideNewSectionLink = false

Definition at line 193 of file OutputPage.php.

Referenced by forceHideNewSectionLink().

◆ $mHTMLtitle

OutputPage::$mHTMLtitle = ''

Should be private. Stores contents of "<title>" tag.

Definition at line 62 of file OutputPage.php.

Referenced by getHTMLTitle().

◆ $mImageTimeKeys

OutputPage::$mImageTimeKeys = array()

Definition at line 148 of file OutputPage.php.

Referenced by getFileSearchOptions().

◆ $mIndexPolicy

OutputPage::$mIndexPolicy = 'index'
private

Definition at line 233 of file OutputPage.php.

◆ $mInlineMsg

OutputPage::$mInlineMsg = array()
Todo:
FIXME: Is this still used ?

Definition at line 145 of file OutputPage.php.

◆ $mInlineStyles

OutputPage::$mInlineStyles = ''

Inline CSS styles.

Use addInlineStyle() sparingly

Definition at line 125 of file OutputPage.php.

Referenced by buildCssLinks().

◆ $mIsarticle

OutputPage::$mIsarticle = false

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

Definition at line 65 of file OutputPage.php.

Referenced by isArticle().

◆ $mIsArticleRelated

OutputPage::$mIsArticleRelated = true

Should be private.

Has get/set methods properly documented. Stores "article flag" toggle.

Definition at line 71 of file OutputPage.php.

Referenced by isArticleRelated().

◆ $mJQueryDone

OutputPage::$mJQueryDone = false
protected

Whether jQuery is already handled.

Definition at line 231 of file OutputPage.php.

◆ $mJsConfigVars

OutputPage::$mJsConfigVars = array()

Definition at line 142 of file OutputPage.php.

Referenced by getJsConfigVars().

◆ $mLanguageLinks

OutputPage::$mLanguageLinks = array()

Should be private. Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page')

Definition at line 112 of file OutputPage.php.

Referenced by getLanguageLinks().

◆ $mLastModified

OutputPage::$mLastModified = ''

mLastModified and mEtag are used for sending cache control.

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

Definition at line 94 of file OutputPage.php.

◆ $mLinkColours

OutputPage::$mLinkColours

Definition at line 128 of file OutputPage.php.

◆ $mLinktags

OutputPage::$mLinktags = array()

Definition at line 42 of file OutputPage.php.

◆ $mMetatags

OutputPage::$mMetatags = array()

Should be private. Used with addMeta() which adds "<meta>".

Definition at line 40 of file OutputPage.php.

◆ $mModuleMessages

OutputPage::$mModuleMessages = array()

Definition at line 140 of file OutputPage.php.

◆ $mModules

OutputPage::$mModules = array()

Definition at line 140 of file OutputPage.php.

◆ $mModuleScripts

OutputPage::$mModuleScripts = array()

Definition at line 140 of file OutputPage.php.

◆ $mModuleStyles

OutputPage::$mModuleStyles = array()

Definition at line 140 of file OutputPage.php.

◆ $mNewSectionLink

OutputPage::$mNewSectionLink = false

Definition at line 192 of file OutputPage.php.

Referenced by showNewSectionLink().

◆ $mNoGallery

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 resource loader can replace this.

Definition at line 200 of file OutputPage.php.

◆ $mPageLinkTitle

OutputPage::$mPageLinkTitle = ''

Used by skin template.

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

Definition at line 134 of file OutputPage.php.

◆ $mPagetitle

OutputPage::$mPagetitle = ''

Should be private - has getter and setter. Contains the HTML title.

Definition at line 49 of file OutputPage.php.

Referenced by getPageTitle().

◆ $mPageTitleActionText

OutputPage::$mPageTitleActionText = ''

Definition at line 203 of file OutputPage.php.

Referenced by getPageTitleActionText().

◆ $mParserOptions

ParserOptions OutputPage::$mParserOptions = null
protected

lazy initialised, use parserOptions()

Definition at line 173 of file OutputPage.php.

◆ $mParseWarnings

OutputPage::$mParseWarnings = array()

Definition at line 204 of file OutputPage.php.

◆ $mPreventClickjacking

OutputPage::$mPreventClickjacking = true

Definition at line 210 of file OutputPage.php.

Referenced by getPreventClickjacking().

◆ $mPrintable

OutputPage::$mPrintable = false

Should be private.

We have to set isPrintable(). Some pages should never be printed (ex: redirections).

Definition at line 77 of file OutputPage.php.

Referenced by isPrintable().

◆ $mProperties

OutputPage::$mProperties = array()
private

Additional key => value data.

Definition at line 249 of file OutputPage.php.

◆ $mRedirect

OutputPage::$mRedirect = ''

Definition at line 87 of file OutputPage.php.

Referenced by getRedirect(), and output().

◆ $mRedirectCode

OutputPage::$mRedirectCode = ''

Definition at line 150 of file OutputPage.php.

Referenced by output().

◆ $mRedirectedFrom

Title OutputPage::$mRedirectedFrom = null
private

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

Definition at line 244 of file OutputPage.php.

◆ $mResourceLoader

OutputPage::$mResourceLoader

Definition at line 141 of file OutputPage.php.

Referenced by getResourceLoader().

◆ $mRevisionId

OutputPage::$mRevisionId = null

should be private. To include the variable {{REVISIONID}}

Definition at line 213 of file OutputPage.php.

Referenced by getRevisionId().

◆ $mRevisionTimestamp

OutputPage::$mRevisionTimestamp = null
private

Definition at line 214 of file OutputPage.php.

Referenced by getRevisionTimestamp().

◆ $mScripts

OutputPage::$mScripts = ''

Should be private.

Used for JavaScript (pre resource loader) We should split js / css. mScripts content is inserted as is in "<head>" by Skin. This might contains either a link to a stylesheet or inline css.

Definition at line 120 of file OutputPage.php.

Referenced by getScriptsForBottomQueue().

◆ $mSquidMaxage

OutputPage::$mSquidMaxage = 0

Definition at line 207 of file OutputPage.php.

◆ $mStatusCode

OutputPage::$mStatusCode

Definition at line 88 of file OutputPage.php.

◆ $mSubtitle

OutputPage::$mSubtitle = array()
private

Should be private.

We have set/get/append methods.

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

Definition at line 85 of file OutputPage.php.

◆ $mTarget

string null OutputPage::$mTarget = null
private

ResourceLoader target for load.php links.

If null, will be omitted

Definition at line 253 of file OutputPage.php.

Referenced by getTarget(), and makeResourceLoaderLink().

◆ $mTemplateIds

OutputPage::$mTemplateIds = array()

Definition at line 147 of file OutputPage.php.

Referenced by getTemplateIds().

◆ $mVaryHeader

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

Definition at line 235 of file OutputPage.php.

◆ $styles

OutputPage::$styles = array()

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 OpenSource amazing.

Definition at line 226 of file OutputPage.php.

Referenced by buildCssLinks().


The documentation for this class was generated from the following file:
ResourceLoaderModule\TYPE_COMBINED
const TYPE_COMBINED
Definition: ResourceLoaderModule.php:34
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ResourceLoaderModule\ORIGIN_ALL
const ORIGIN_ALL
Definition: ResourceLoaderModule.php:50