* @return string|bool String containing article contents, or false if null
* @deprecated since 1.21, use WikiPage::getContent() instead
*/
- function fetchContent() { #BC cruft!
+ function fetchContent() {
+ // BC cruft!
+
ContentHandler::deprecated( __METHOD__, '1.21' );
if ( $this->mContentLoaded && $this->mContent ) {
}
# Should the parser cache be used?
- $useParserCache = $this->mPage->isParserCacheUsed( $parserOptions, $oldid );
+ $useParserCache = $this->mPage->shouldCheckParserCache( $parserOptions, $oldid );
wfDebug( 'Article::view using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" );
if ( $user->getStubThreshold() ) {
$this->getContext()->getStats()->increment( 'pcache_miss_stub' );
if ( !$this->mPage->hasViewableContent() && $wgSend404Code && !$validUserPage ) {
// If there's no backing content, send a 404 Not Found
// for better machine handling of broken links.
- $this->getContext()->getRequest()->response()->header( "HTTP/1.1 404 Not Found" );
+ $this->getContext()->getRequest()->response()->statusHeader( 404 );
}
// Also apply the robot policy for nonexisting pages (even if a 404 was used for sanity)
'</div>';
}
+ /**
+ * Adds help link with an icon via page indicators.
+ * Link target can be overridden by a local message containing a wikilink:
+ * the message key is: 'namespace-' + namespace number + '-helppage'.
+ * @param string $to Target MediaWiki.org page title or encoded URL.
+ * @param bool $overrideBaseUrl Whether $url is a full URL, to avoid MW.o.
+ * @since 1.25
+ */
+ public function addHelpLink( $to, $overrideBaseUrl = false ) {
+ $msg = wfMessage(
+ 'namespace-' . $this->getTitle()->getNamespace() . '-helppage'
+ );
+
+ $out = $this->getContext()->getOutput();
+ if ( !$msg->isDisabled() ) {
+ $helpUrl = Skin::makeUrl( $msg->plain() );
+ $out->addHelpLink( $helpUrl, true );
+ } else {
+ $out->addHelpLink( $to, $overrideBaseUrl );
+ }
+ }
+
/**
* Handle action=render
*/
Xml::closeElement( 'form' );
if ( $user->isAllowed( 'editinterface' ) ) {
- $dropdownTitle = Title::makeTitle( NS_MEDIAWIKI, 'Deletereason-dropdown' );
- $link = Linker::link(
- $dropdownTitle,
+ $link = Linker::linkKnown(
+ $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->getTitle(),
wfMessage( 'delete-edit-reasonlist' )->escaped(),
array(),
array( 'action' => 'edit' )