";
}
return $text;
@@ -1410,9 +1971,10 @@ class OutputPage {
*
* @todo Needs to be split into multiple functions.
*
- * @param string $source Source code to show (or null).
- * @param bool $protected Is this a permissions error?
- * @param array $reasons List of reasons for this error, as returned by Title::getUserPermissionsErrors().
+ * @param $source String: source code to show (or null).
+ * @param $protected Boolean: is this a permissions error?
+ * @param $reasons Array: list of reasons for this error, as returned by Title::getUserPermissionsErrors().
+ * @param $action String: action that was denied or null if unknown
*/
public function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) {
global $wgUser;
@@ -1423,25 +1985,16 @@ class OutputPage {
// If no reason is given, just supply a default "I can't let you do
// that, Dave" message. Should only occur if called by legacy code.
- if ( $protected && empty($reasons) ) {
+ if ( $protected && empty( $reasons ) ) {
$reasons[] = array( 'badaccess-group0' );
}
- if ( !empty($reasons) ) {
+ if ( !empty( $reasons ) ) {
// Permissions error
if( $source ) {
$this->setPageTitle( wfMsg( 'viewsource' ) );
$this->setSubtitle(
- wfMsg(
- 'viewsourcefor',
- $skin->link(
- $this->getTitle(),
- null,
- array(),
- array(),
- array( 'known', 'noclasses' )
- )
- )
+ wfMsg( 'viewsourcefor', $skin->linkKnown( $this->getTitle() ) )
);
} else {
$this->setPageTitle( wfMsg( 'badaccess' ) );
@@ -1451,7 +2004,7 @@ class OutputPage {
// Wiki is read only
$this->setPageTitle( wfMsg( 'readonly' ) );
$reason = wfReadOnlyReason();
- $this->wrapWikiMsg( '
", array( 'readonlytext', $reason ) );
}
// Show source, if supplied
@@ -1484,6 +2037,39 @@ class OutputPage {
}
}
+ /**
+ * Adds JS-based password security checker
+ * @param $passwordId String ID of input box containing password
+ * @param $retypeId String ID of input box containing retyped password
+ * @return none
+ */
+ public function addPasswordSecurity( $passwordId, $retypeId ) {
+ $this->includeJQuery();
+ $data = array(
+ 'password' => '#' . $passwordId,
+ 'retype' => '#' . $retypeId,
+ 'messages' => array(),
+ );
+ foreach ( array( 'password-strength', 'password-strength-bad', 'password-strength-mediocre',
+ 'password-strength-acceptable', 'password-strength-good', 'password-retype', 'password-retype-mismatch'
+ ) as $message ) {
+ $data['messages'][$message] = wfMsg( $message );
+ }
+ $this->addScript( Html::inlineScript( 'var passwordSecurity=' . FormatJson::encode( $data ) ) );
+ $this->addModules( 'mediawiki.legacy.password' );
+ }
+
+ /** @deprecated */
+ public function errorpage( $title, $msg ) {
+ wfDeprecated( __METHOD__ );
+ throw new ErrorPageError( $title, $msg );
+ }
+
+ /** @deprecated */
+ public function databaseError( $fname, $sql, $error, $errno ) {
+ throw new MWException( "OutputPage::databaseError is obsolete\n" );
+ }
+
/** @deprecated */
public function fatalError( $message ) {
wfDeprecated( __METHOD__ );
@@ -1521,8 +2107,8 @@ class OutputPage {
}
public function showFatalError( $message ) {
- $this->setPageTitle( wfMsg( "internalerror" ) );
- $this->setRobotPolicy( "noindex,nofollow" );
+ $this->setPageTitle( wfMsg( 'internalerror' ) );
+ $this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleRelated( false );
$this->enableClientCache( false );
$this->mRedirect = '';
@@ -1554,12 +2140,15 @@ class OutputPage {
*
* @param $title Title to link
* @param $query String: query string
+ * @param $text String text of the link (input is not escaped)
*/
- public function addReturnTo( $title, $query = array() ) {
+ public function addReturnTo( $title, $query = array(), $text = null ) {
global $wgUser;
- $this->addLink( array( 'rel' => 'next', 'href' => $title->getFullUrl() ) );
- $link = wfMsgHtml( 'returnto', $wgUser->getSkin()->link(
- $title, null, array(), $query ) );
+ $this->addLink( array( 'rel' => 'next', 'href' => $title->getFullURL() ) );
+ $link = wfMsgHtml(
+ 'returnto',
+ $wgUser->getSkin()->link( $title, $text, array(), $query )
+ );
$this->addHTML( "
{$link}
\n" );
}
@@ -1599,119 +2188,228 @@ class OutputPage {
}
/**
- * @return string The doctype, opening , and head element.
- *
* @param $sk Skin The given Skin
+ * @param $includeStyle Boolean: unused
+ * @return String: The doctype, opening , and head element.
*/
public function headElement( Skin $sk, $includeStyle = true ) {
- global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
- global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version;
- global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, $wgHtml5, $wgWellFormedXml;
+ global $wgOutputEncoding, $wgMimeType;
+ global $wgUseTrackbacks, $wgHtml5;
+ global $wgUser, $wgRequest, $wgLang;
- $this->addMeta( "http:Content-Type", "$wgMimeType; charset={$wgOutputEncoding}" );
if ( $sk->commonPrintStylesheet() ) {
- $this->addStyle( 'common/wikiprintable.css', 'print' );
+ $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' );
}
$sk->setupUserCss( $this );
- $ret = '';
-
- if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) {
- $ret .= "\n";
- }
+ $ret = Html::htmlHeader( array( 'lang' => wfUILang()->getCode() ) );
if ( $this->getHTMLTitle() == '' ) {
- $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ));
+ $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) );
}
- $dir = $wgContLang->getDir();
+ $openHead = Html::openElement( 'head' );
+ if ( $openHead ) {
+ # Don't bother with the newline if $head == ''
+ $ret .= "$openHead\n";
+ }
if ( $wgHtml5 ) {
- if ( $wgWellFormedXml ) {
- # Unknown elements and attributes are okay in XML, but unknown
- # named entities are well-formedness errors and will break XML
- # parsers. Thus we need a doctype that gives us appropriate
- # entity definitions. The HTML5 spec permits four legacy
- # doctypes as obsolete but conforming, so let's pick one of
- # those, although it makes our pages look like XHTML1 Strict.
- # Isn't compatibility great?
- $ret .= "\n";
- } else {
- # Much saner.
- $ret .= "\n";
- }
- $ret .= ", has the
+ # same effect
+ $ret .= Html::element( 'meta', array( 'charset' => $wgOutputEncoding ) ) . "\n";
} else {
- $ret .= "\n";
- $ret .= " $ns) {
- $ret .= "xmlns:{$tag}=\"{$ns}\" ";
- }
- $ret .= "xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
+ $this->addMeta( 'http:Content-Type', "$wgMimeType; charset=$wgOutputEncoding" );
}
- $ret .= "\n";
- $ret .= "" . htmlspecialchars( $this->getHTMLTitle() ) . "\n";
+ $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n";
+
$ret .= implode( "\n", array(
- $this->getHeadLinks(),
+ $this->getHeadLinks( $sk ),
$this->buildCssLinks(),
- $this->getHeadScripts( $sk ),
$this->getHeadItems(),
- ));
- if( $sk->usercss ){
+ ) );
+ if ( $sk->usercss ) {
$ret .= Html::inlineStyle( $sk->usercss );
}
- if ($wgUseTrackbacks && $this->isArticleRelated())
+ if ( $wgUseTrackbacks && $this->isArticleRelated() ) {
$ret .= $this->getTitle()->trackbackRDF();
+ }
- $ret .= "\n";
- return $ret;
- }
+ $closeHead = Html::closeElement( 'head' );
+ if ( $closeHead ) {
+ $ret .= "$closeHead\n";
+ }
- /*
- * gets the global variables and mScripts
- *
- * also adds userjs to the end if enabled:
- */
- function getHeadScripts( Skin $sk ) {
- global $wgUser, $wgRequest, $wgJsMimeType, $wgUseSiteJs;
- global $wgStylePath, $wgStyleVersion;
+ $bodyAttrs = array();
- $scripts = Skin::makeGlobalVariablesScript( $sk->getSkinName() );
- $scripts .= Html::linkedScript( "{$wgStylePath}/common/wikibits.js?$wgStyleVersion" );
+ # Crazy edit-on-double-click stuff
+ $action = $wgRequest->getVal( 'action', 'view' );
- //add site JS if enabled:
- if( $wgUseSiteJs ) {
- $jsCache = $wgUser->isLoggedIn() ? '&smaxage=0' : '';
- $this->addScriptFile( Skin::makeUrl( '-',
- "action=raw$jsCache&gen=js&useskin=" .
- urlencode( $sk->getSkinName() )
- )
- );
+ if (
+ $this->getTitle()->getNamespace() != NS_SPECIAL &&
+ !in_array( $action, array( 'edit', 'submit' ) ) &&
+ $wgUser->getOption( 'editondblclick' )
+ )
+ {
+ $bodyAttrs['ondblclick'] = "document.location = '" . Xml::escapeJsString( $this->getTitle()->getEditURL() ) . "'";
}
- //add user js if enabled:
- if( $this->isUserJsAllowed() && $wgUser->isLoggedIn() ) {
+ # Class bloat
+ $dir = wfUILang()->getDir();
+ $bodyAttrs['class'] = "mediawiki $dir";
+
+ if ( $wgLang->capitalizeAllNouns() ) {
+ # A class is probably not the best way to do this . . .
+ $bodyAttrs['class'] .= ' capitalize-all-nouns';
+ }
+ $bodyAttrs['class'] .= ' ns-' . $this->getTitle()->getNamespace();
+ if ( $this->getTitle()->getNamespace() == NS_SPECIAL ) {
+ $bodyAttrs['class'] .= ' ns-special';
+ } elseif ( $this->getTitle()->isTalkPage() ) {
+ $bodyAttrs['class'] .= ' ns-talk';
+ } else {
+ $bodyAttrs['class'] .= ' ns-subject';
+ }
+ $bodyAttrs['class'] .= ' ' . Sanitizer::escapeClass( 'page-' . $this->getTitle()->getPrefixedText() );
+ $bodyAttrs['class'] .= ' skin-' . Sanitizer::escapeClass( $wgUser->getSkin()->getSkinName() );
+
+ $ret .= Html::openElement( 'body', $bodyAttrs ) . "\n";
+
+ return $ret;
+ }
+
+ static function makeResourceLoaderLink( $skin, $modules, $only ) {
+ global $wgUser, $wgLang, $wgRequest, $wgLoadScript;
+ // TODO: Should this be a static function of ResourceLoader instead?
+ // TODO: Divide off modules starting with "user", and add the user parameter to them
+ $query = array(
+ 'lang' => $wgLang->getCode(),
+ 'debug' => ( $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) == 'true' ) ? 'true' : 'false',
+ 'skin' => $wgUser->getSkin()->getSkinName(),
+ 'only' => $only,
+ );
+ $moduleGroups = array( null => array(), 'user' => array() );
+ foreach ( (array) $modules as $name ) {
+ $moduleGroups[strpos( $name, 'user' ) === 0 ? 'user' : null][] = $name;
+ }
+ $links = '';
+ foreach ( $moduleGroups as $group => $modules ) {
+ if ( count( $modules ) ) {
+ sort( $modules );
+ $query['modules'] = implode( '|', array_unique( (array) $modules ) );
+ if ( $group === 'user' && $wgUser->isLoggedIn() ) {
+ $query['user'] = $wgUser->getName();
+ }
+ // Users might change their stuff on-wiki like site or user pages, or user preferences; we need to find
+ // the highest timestamp of these user-changable modules so we can ensure cache misses upon change
+ $timestamp = 0;
+ foreach ( $modules as $name ) {
+ $module = ResourceLoader::getModule( $name );
+ if (
+ $module instanceof ResourceLoaderWikiModule ||
+ $module instanceof ResourceLoaderUserPreferencesModule
+ ) {
+ $timestamp = max(
+ $timestamp,
+ $module->getModifiedTime( new ResourceLoaderContext( new FauxRequest( $query ) ) )
+ );
+ }
+ }
+ // Add a version parameter if any of the modules were user-changable
+ if ( $timestamp ) {
+ $query['version'] = wfTimestamp( TS_ISO_8601, round( $timestamp, -2 ) );
+ }
+ // Make queries uniform in order
+ ksort( $query );
+ // Automatically select style/script elements
+ if ( $only === 'styles' ) {
+ $links .= Html::linkedStyle( wfAppendQuery( $wgLoadScript, $query ) );
+ } else {
+ $links .= Html::linkedScript( wfAppendQuery( $wgLoadScript, $query ) );
+ }
+ }
+ }
+ return $links;
+ }
+
+ /**
+ * Gets the global variables and mScripts; also adds userjs to the end if
+ * enabled. Despite the name, these scripts are no longer put in the
+ * but at the bottom of the
+ *
+ * @param $sk Skin object to use
+ * @return String: HTML fragment
+ */
+ function getHeadScripts( Skin $sk ) {
+ global $wgUser, $wgRequest;
+ global $wgUseSiteJs;
+
+ // Statup - this will immediately load jquery and mediawiki modules
+ $scripts = self::makeResourceLoaderLink( $sk, 'startup', 'scripts' );
+
+ // Configuration -- This could be merged together with the load and go, but makeGlobalVariablesScript returns a
+ // whole script tag -- grumble grumble...
+ $scripts .= Skin::makeGlobalVariablesScript( $sk->getSkinName() ) . "\n";
+
+ // Script and Messages "only"
+ if ( $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) !== 'false' ) {
+ // Scripts
+ foreach ( $this->getModuleScripts() as $name ) {
+ $scripts .= self::makeResourceLoaderLink( $sk, $name, 'scripts' );
+ }
+ // Messages
+ foreach ( $this->getModuleMessages() as $name ) {
+ $scripts .= self::makeResourceLoaderLink( $sk, $name, 'messages' );
+ }
+ } else {
+ // Scripts
+ if ( count( $this->getModuleScripts() ) ) {
+ $scripts .= self::makeResourceLoaderLink( $sk, $this->getModuleScripts(), 'scripts' );
+ }
+ // Messages
+ if ( count( $this->getModuleMessages() ) ) {
+ $scripts .= self::makeResourceLoaderLink( $sk, $this->getModuleMessages(), 'messages' );
+ }
+ }
+
+ // Modules - let the client calculate dependencies and batch requests as it likes
+ if ( $this->getModules() ) {
+ $modules = FormatJson::encode( $this->getModules() );
+ $scripts .= Html::inlineScript(
+ "if ( mediaWiki !== undefined ) { mediaWiki.loader.load( {$modules} ); mediaWiki.loader.go(); }"
+ );
+ }
+
+ // Add user JS if enabled - trying to load user.options as a bundle if possible
+ $userOptionsAdded = false;
+ if ( $this->isUserJsAllowed() && $wgUser->isLoggedIn() ) {
$action = $wgRequest->getVal( 'action', 'view' );
- if( $this->mTitle && $this->mTitle->isJsSubpage() and $sk->userCanPreview( $action ) ) {
+ if( $this->mTitle && $this->mTitle->isJsSubpage() && $sk->userCanPreview( $action ) ) {
# XXX: additional security check/prompt?
$this->addInlineScript( $wgRequest->getText( 'wpTextbox1' ) );
} else {
- $userpage = $wgUser->getUserPage();
- $userjs = Skin::makeUrl(
- $userpage->getPrefixedText() . '/' . $sk->getSkinName() . '.js',
- 'action=raw&ctype=' . $wgJsMimeType );
- $this->addScriptFile( $userjs );
+ $scripts .= self::makeResourceLoaderLink( $sk, array( 'user', 'user.options' ), 'scripts' );
+ $userOptionsAdded = true;
}
}
-
+ if ( !$userOptionsAdded ) {
+ $scripts .= self::makeResourceLoaderLink( $sk, 'user.options', 'scripts' );
+ }
$scripts .= "\n" . $this->mScripts;
+
+ // Add site JS if enabled
+ if ( $wgUseSiteJs ) {
+ $scripts .= self::makeResourceLoaderLink( $sk, 'site', 'scripts' );
+ }
+
return $scripts;
}
+ /**
+ * Add default \ tags
+ */
protected function addDefaultMeta() {
global $wgVersion, $wgHtml5;
@@ -1723,7 +2421,7 @@ class OutputPage {
$called = true;
if ( !$wgHtml5 ) {
- $this->addMeta( 'http:Content-Style-Type', 'text/css' ); //bug 15835
+ $this->addMeta( 'http:Content-Style-Type', 'text/css' ); // bug 15835
}
$this->addMeta( 'generator', "MediaWiki $wgVersion" );
@@ -1739,15 +2437,22 @@ class OutputPage {
"/<.*?" . ">/" => '',
"/_/" => ' '
);
- $this->addMeta( 'keywords', preg_replace(array_keys($strip), array_values($strip),implode( ",", $this->mKeywords ) ) );
+ $this->addMeta(
+ 'keywords',
+ preg_replace(
+ array_keys( $strip ),
+ array_values( $strip ),
+ implode( ',', $this->mKeywords )
+ )
+ );
}
}
/**
* @return string HTML tag links to be put in the header.
*/
- public function getHeadLinks() {
- global $wgRequest, $wgFeed;
+ public function getHeadLinks( $sk ) {
+ global $wgFeed, $wgRequest;
// Ideally this should happen earlier, somewhere. :P
$this->addDefaultMeta();
@@ -1764,7 +2469,9 @@ class OutputPage {
$tags[] = Html::element( 'meta',
array(
$a => $tag[0],
- 'content' => $tag[1] ) );
+ 'content' => $tag[1]
+ )
+ );
}
foreach ( $this->mLinktags as $tag ) {
$tags[] = Html::element( 'link', $tag );
@@ -1781,7 +2488,8 @@ class OutputPage {
$format,
$link,
# Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep)
- wfMsg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() ) );
+ wfMsg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() )
+ );
}
# Recent changes feed should appear on every page (except recentchanges,
@@ -1792,66 +2500,81 @@ class OutputPage {
# or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined.
# If so, use it instead.
- global $wgOverrideSiteFeed, $wgSitename, $wgFeedClasses, $wgAdvertisedFeedTypes;
+ global $wgOverrideSiteFeed, $wgSitename, $wgAdvertisedFeedTypes;
$rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
if ( $wgOverrideSiteFeed ) {
foreach ( $wgOverrideSiteFeed as $type => $feedUrl ) {
- $tags[] = $this->feedLink (
+ $tags[] = $this->feedLink(
$type,
htmlspecialchars( $feedUrl ),
- wfMsg( "site-{$type}-feed", $wgSitename ) );
+ wfMsg( "site-{$type}-feed", $wgSitename )
+ );
}
} elseif ( $this->getTitle()->getPrefixedText() != $rctitle->getPrefixedText() ) {
foreach ( $wgAdvertisedFeedTypes as $format ) {
$tags[] = $this->feedLink(
$format,
$rctitle->getLocalURL( "feed={$format}" ),
- wfMsg( "site-{$format}-feed", $wgSitename ) ); # For grep: 'site-rss-feed', 'site-atom-feed'.
+ wfMsg( "site-{$format}-feed", $wgSitename ) # For grep: 'site-rss-feed', 'site-atom-feed'.
+ );
}
}
}
+ // Support individual script requests in debug mode
+ if ( $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) !== 'false' ) {
+ foreach ( $this->getModuleStyles() as $name ) {
+ $tags[] = self::makeResourceLoaderLink( $sk, $name, 'styles' );
+ }
+ } else {
+ if ( count( $this->getModuleStyles() ) ) {
+ $tags[] = self::makeResourceLoaderLink( $sk, $this->getModuleStyles(), 'styles' );
+ }
+ }
+
return implode( "\n", $tags );
}
/**
- * Return URLs for each supported syndication format for this page.
- * @return array associating format keys with URLs
- */
- public function getSyndicationLinks() {
- return $this->mFeedLinks;
- }
-
- /**
- * Generate a for an RSS feed.
+ * Generate a for a feed.
+ *
+ * @param $type String: feed type
+ * @param $url String: URL to the feed
+ * @param $text String: value of the "title" attribute
+ * @return String: HTML fragment
*/
private function feedLink( $type, $url, $text ) {
return Html::element( 'link', array(
'rel' => 'alternate',
'type' => "application/$type+xml",
'title' => $text,
- 'href' => $url ) );
+ 'href' => $url )
+ );
}
/**
* Add a local or specified stylesheet, with the given media options.
* Meant primarily for internal use...
*
- * @param $media -- to specify a media type, 'screen', 'printable', 'handheld' or any.
- * @param $conditional -- for IE conditional comments, specifying an IE version
- * @param $dir -- set to 'rtl' or 'ltr' for direction-specific sheets
+ * @param $style String: URL to the file
+ * @param $media String: to specify a media type, 'screen', 'printable', 'handheld' or any.
+ * @param $condition String: for IE conditional comments, specifying an IE version
+ * @param $dir String: set to 'rtl' or 'ltr' for direction-specific sheets
*/
- public function addStyle( $style, $media='', $condition='', $dir='' ) {
+ public function addStyle( $style, $media = '', $condition = '', $dir = '' ) {
$options = array();
// Even though we expect the media type to be lowercase, but here we
// force it to lowercase to be safe.
- if( $media )
+ if( $media ) {
$options['media'] = $media;
- if( $condition )
+ }
+ if( $condition ) {
$options['condition'] = $condition;
- if( $dir )
+ }
+ if( $dir ) {
$options['dir'] = $dir;
+ }
$this->styles[$style] = $options;
}
@@ -1868,24 +2591,34 @@ class OutputPage {
* These will be applied to various media & IE conditionals.
*/
public function buildCssLinks() {
+ return implode( "\n", $this->buildCssLinksArray() );
+ }
+
+ public function buildCssLinksArray() {
$links = array();
foreach( $this->styles as $file => $options ) {
$link = $this->styleLink( $file, $options );
- if( $link )
- $links[] = $link;
+ if( $link ) {
+ $links[$file] = $link;
+ }
}
-
- return implode( "\n", $links );
+ return $links;
}
+ /**
+ * Generate \ tags for stylesheets
+ *
+ * @param $style String: URL to the file
+ * @param $options Array: option, can contain 'condition', 'dir', 'media'
+ * keys
+ * @return String: HTML fragment
+ */
protected function styleLink( $style, $options ) {
- global $wgRequest;
-
if( isset( $options['dir'] ) ) {
- global $wgContLang;
- $siteDir = $wgContLang->getDir();
- if( $siteDir != $options['dir'] )
+ $siteDir = wfUILang()->getDir();
+ if( $siteDir != $options['dir'] ) {
return '';
+ }
}
if( isset( $options['media'] ) ) {
@@ -1915,6 +2648,12 @@ class OutputPage {
return $link;
}
+ /**
+ * Transform "media" attribute based on request parameters
+ *
+ * @param $media String: current value of the "media" attribute
+ * @return String: modified value of the "media" attribute
+ */
function transformCssMedia( $media ) {
global $wgRequest, $wgHandheldForIPhone;
@@ -1953,37 +2692,18 @@ class OutputPage {
* for when rate limiting has triggered.
*/
public function rateLimited() {
-
- $this->setPageTitle(wfMsg('actionthrottled'));
+ $this->setPageTitle( wfMsg( 'actionthrottled' ) );
$this->setRobotPolicy( 'noindex,follow' );
$this->setArticleRelated( false );
$this->enableClientCache( false );
$this->mRedirect = '';
$this->clearHTML();
- $this->setStatusCode(503);
+ $this->setStatusCode( 503 );
$this->addWikiMsg( 'actionthrottledtext' );
$this->returnToMain( null, $this->getTitle() );
}
- /**
- * Show an "add new section" link?
- *
- * @return bool
- */
- public function showNewSectionLink() {
- return $this->mNewSectionLink;
- }
-
- /**
- * Forcibly hide the new section link?
- *
- * @return bool
- */
- public function forceHideNewSectionLink() {
- return $this->mHideNewSectionLink;
- }
-
/**
* Show a warning about slave lag
*
@@ -1991,7 +2711,7 @@ class OutputPage {
* then the warning is a bit more obvious. If the lag is
* lower than $wgSlaveLagWarning, then no warning is shown.
*
- * @param int $lag Slave lag
+ * @param $lag Integer: slave lag
*/
public function showLagWarning( $lag ) {
global $wgSlaveLagWarning, $wgSlaveLagCritical, $wgLang;
@@ -2045,11 +2765,11 @@ class OutputPage {
*
* For example:
*
- * $wgOut->wrapWikiMsg( "
\n$1
", 'some-error' );
+ * $wgOut->wrapWikiMsg( "
\n$1\n
", 'some-error' );
*
* Is equivalent to:
*
- * $wgOut->addWikiText( "
\n" . wfMsgNoTrans( 'some-error' ) . '
' );
+ * $wgOut->addWikiText( "
\n" . wfMsgNoTrans( 'some-error' ) . "\n
" );
*
* The newline after opening div is needed in some wikitext. See bug 19226.
*/
@@ -2075,4 +2795,18 @@ class OutputPage {
}
$this->addHTML( $this->parse( $s, /*linestart*/true, /*uilang*/true ) );
}
+
+ /**
+ * Include jQuery core. Use this to avoid loading it multiple times
+ * before we get a usable script loader.
+ *
+ * @param $modules Array: list of jQuery modules which should be loaded
+ * @return Array: the list of modules which were not loaded.
+ * @since 1.16
+ * @deprecated No longer needed as of 1.17
+ */
+ public function includeJQuery( $modules = array() ) {
+ return array();
+ }
+
}