$sk = $wgUser->getSkin();
foreach ( $categories as $category => $type ) {
$title = Title::makeTitleSafe( NS_CATEGORY, $category );
+ $wgContLang->findVariantLink( $category, $title );
$text = $wgContLang->convertHtml( $title->getText() );
$this->mCategoryLinks[$type][] = $sk->makeLinkObj( $title, $text );
}
$this->mNoGallery = $parserOutput->getNoGallery();
$this->mHeadItems = array_merge( $this->mHeadItems, (array)$parserOutput->mHeadItems );
// Versioning...
- $this->mTemplateIds = wfArrayMerge( $this->mTemplateIds, (array)$parserOutput->mTemplateIds );
-
- // Display title
+ foreach ( (array)$parserOutput->mTemplateIds as $ns => $dbks ) {
+ if ( isset( $this->mTemplateIds[$ns] ) ) {
+ $this->mTemplateIds[$ns] = $dbks + $this->mTemplateIds[$ns];
+ } else {
+ $this->mTemplateIds[$ns] = $dbks;
+ }
+ }
+ // Page title
if( ( $dt = $parserOutput->getDisplayTitle() ) !== false )
$this->setPageTitle( $dt );
+ else if ( ( $title = $parserOutput->getTitleText() ) != '' )
+ $this->setPageTitle( $title );
// Hooks registered in the object
global $wgParserOutputHooks;
*/
public function parse( $text, $linestart = true, $interface = false ) {
global $wgParser, $wgTitle;
+ if( is_null( $wgTitle ) ) {
+ throw new MWException( 'Empty $wgTitle in ' . __METHOD__ );
+ }
$popts = $this->parserOptions();
if ( $interface) { $popts->setInterfaceMessage(true); }
$parserOutput = $wgParser->parse( $text, $wgTitle, $popts,
* If it does, it's very important that we don't allow public caching
*/
function haveCacheVaryCookies() {
- global $wgRequest, $wgCookiePrefix;
+ global $wgRequest;
$cookieHeader = $wgRequest->getHeader( 'cookie' );
if ( $cookieHeader === false ) {
return false;
/** Get a complete X-Vary-Options header */
public function getXVO() {
- global $wgCookiePrefix;
$cvCookies = $this->getCacheVaryCookies();
$xvo = 'X-Vary-Options: Accept-Encoding;list-contains=gzip,Cookie;';
$first = true;
global $wgUser, $wgOutputEncoding, $wgRequest;
global $wgContLanguageCode, $wgDebugRedirects, $wgMimeType;
global $wgJsMimeType, $wgUseAjax, $wgAjaxWatch;
- global $wgEnableMWSuggest;
+ global $wgEnableMWSuggest, $wgUniversalEditButton;
+ global $wgArticle, $wgTitle;
if( $this->mDoNothing ){
return;
$this->addScriptFile( 'rightclickedit.js' );
}
+ if( $wgUniversalEditButton ) {
+ if( isset( $wgArticle ) && isset( $wgTitle ) && $wgTitle->quickUserCan( 'edit' )
+ && ( $wgTitle->exists() || $wgTitle->quickUserCan( 'create' ) ) ) {
+ // Original UniversalEditButton
+ $this->addLink( array(
+ 'rel' => 'alternate',
+ 'type' => 'application/x-wiki',
+ 'title' => wfMsg( 'edit' ),
+ 'href' => $wgTitle->getFullURL( 'action=edit' )
+ ) );
+ // Alternate edit link
+ $this->addLink( array(
+ 'rel' => 'edit',
+ 'title' => wfMsg( 'edit' ),
+ 'href' => $wgTitle->getFullURL( 'action=edit' )
+ ) );
+ }
+ }
+
# Buffer output; final headers may depend on later processing
ob_start();
array_unshift( $params, 'parse' );
array_unshift( $params, $msg );
- $this->addHtml( call_user_func_array( 'wfMsgExt', $params ) );
+ $this->addHTML( call_user_func_array( 'wfMsgExt', $params ) );
$this->returnToMain();
}
$loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
$loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() );
- $this->addHtml( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
- $this->addHtml( "\n<!--" . $wgTitle->getPrefixedUrl() . "-->" );
+ $this->addHTML( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
+ $this->addHTML( "\n<!--" . $wgTitle->getPrefixedUrl() . "-->" );
# Don't return to the main page if the user can't read it
# otherwise we'll end up in a pointless loop
*/
public function addReturnTo( $title ) {
global $wgUser;
+ $this->addLink( array( 'rel' => 'next', 'href' => $title->getFullUrl() ) );
$link = wfMsg( 'returnto', $wgUser->getSkin()->makeLinkObj( $title ) );
- $this->addHtml( "<p>{$link}</p>\n" );
+ $this->addHTML( "<p>{$link}</p>\n" );
}
/**
protected function addDefaultMeta() {
global $wgVersion;
- $this->addMeta( "generator", "MediaWiki $wgVersion" );
+ $this->addMeta( 'http:Content-Style-Type', 'text/css' ); //bug 15835
+ $this->addMeta( 'generator', "MediaWiki $wgVersion" );
$p = "{$this->mIndexPolicy},{$this->mFollowPolicy}";
if( $p !== 'index,follow' ) {
? 'lag-warn-normal'
: 'lag-warn-high';
$warning = wfMsgExt( $message, 'parse', $lag );
- $this->addHtml( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
+ $this->addHTML( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
}
}