$wgOut->addWikiText( $text );
}
}
- $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
+ /* title may have been set from the cache */
+ $t = $wgOut->getPageTitle();
+ if( empty( $t ) ) {
+ $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
+ }
+
# If we have been passed an &rcid= parameter, we want to give the user a
# chance to mark this new article as patrolled.
if ( $wgUseRCPatrol && !is_null ( $rcid ) && $rcid != 0 && $wgUser->isLoggedIn() &&
$this->replaceLinkHolders( $text );
$text = $wgContLang->convert($text);
-
+ $this->mOutput->setTitleText($wgContLang->getParsedTitle());
$text = $this->unstripNoWiki( $text, $this->mStripState );
if ($wgUseTidy) {
$text = Parser::tidy($text);
var $mText, $mLanguageLinks, $mCategoryLinks, $mContainsOldMagic;
var $mCacheTime; # Used in ParserCache
var $mVersion; # Compatibility check
+ var $mTitleText; # title text of the chosen language variant
function ParserOutput( $text = '', $languageLinks = array(), $categoryLinks = array(),
- $containsOldMagic = false )
+ $containsOldMagic = false, $titletext = '' )
{
$this->mText = $text;
$this->mLanguageLinks = $languageLinks;
$this->mContainsOldMagic = $containsOldMagic;
$this->mCacheTime = '';
$this->mVersion = MW_PARSER_VERSION;
+ $this->mTitleText = $titletext;
}
function getText() { return $this->mText; }
function getLanguageLinks() { return $this->mLanguageLinks; }
function getCategoryLinks() { return array_keys( $this->mCategoryLinks ); }
function getCacheTime() { return $this->mCacheTime; }
+ function getTitleText() { return $this->mTitleText; }
function containsOldMagic() { return $this->mContainsOldMagic; }
function setText( $text ) { return wfSetVar( $this->mText, $text ); }
function setLanguageLinks( $ll ) { return wfSetVar( $this->mLanguageLinks, $ll ); }
function setCategoryLinks( $cl ) { return wfSetVar( $this->mCategoryLinks, $cl ); }
function setContainsOldMagic( $com ) { return wfSetVar( $this->mContainsOldMagic, $com ); }
function setCacheTime( $t ) { return wfSetVar( $this->mCacheTime, $t ); }
+ function setTitleText( $t ) { return wfSetVar ($this->mTitleText, $t); }
+
function addCategoryLink( $c ) { $this->mCategoryLinks[$c] = 1; }
function merge( $other ) {
var $mTablesLoaded = false;
var $mCacheKey;
var $mDoTitleConvert = true, $mDoContentConvert = true;
- var $mTitleDisplay=false;
+ var $mTitleDisplay='';
function LanguageZh() {
global $wgDBname;
$this->mCacheKey = $wgDBname . ":zhtables";
return $text;
if( $isTitle ) {
- if( !$this->mDoTitleConvert )
+ if( !$this->mDoTitleConvert ) {
+ $this->mTitleDisplay = $text;
return $text;
-
- if( $this->mTitleDisplay != false )
+ }
+ if( !empty($this->mTitleDisplay))
return $this->mTitleDisplay;
global $wgRequest;
return $text;
}
else {
- return $this->autoConvert($text);
+ $this->mTitleDisplay = $this->autoConvert($text);
+ return $this->mTitleDisplay;
}
}
return '!' . $variant ;
}
+ function getParsedTitle() {
+ return $this->mTitleDisplay;
+ }
}
?>