* Minor grammatical improvements in English language files
* Display the anon talk page info message on anon talk pages again
(moved outside the parser cache)
+* Optional {{DISPLAYTITLE|title with markup}} magic word
+ Deactivated by default, set "$wgAllowDisplayTitle = true" in LocalSettings.php to activate
== Compatibility ==
*/
$wgAjaxExportList = array( 'wfSajaxSearch' );
+/**
+ * Allow DISPLAYTITLE to change title display
+ */
+$wgAllowDisplayTitle = false ;
?>
'MAG_RAW',
'MAG_SUBPAGENAME',
'MAG_SUBPAGENAMEE',
+ 'MAG_DISPLAYTITLE',
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
MAG_CURRENTDOW,
MAG_REVISIONID,
MAG_SUBPAGENAME,
- MAG_SUBPAGENAMEE
+ MAG_SUBPAGENAMEE,
+ MAG_DISPLAYTITLE,
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) );
var $mHTMLtitle, $mRobotpolicy, $mIsarticle, $mPrintable;
var $mSubtitle, $mRedirect, $mStatusCode;
var $mLastModified, $mETag, $mCategoryLinks;
- var $mScripts, $mLinkColours;
+ var $mScripts, $mLinkColours, $mPageLinkTitle;
var $mSuppressQuickbar;
var $mOnloadHandler;
$this->mHTMLtitle = $this->mPagetitle = $this->mBodytext =
$this->mRedirect = $this->mLastModified =
$this->mSubtitle = $this->mDebugtext = $this->mRobotpolicy =
- $this->mOnloadHandler = '';
+ $this->mOnloadHandler = $this->mPageLinkTitle = '';
$this->mIsArticleRelated = $this->mIsarticle = $this->mPrintable = true;
$this->mSuppressQuickbar = $this->mPrintable = false;
$this->mLanguageLinks = array();
- $this->mCategoryLinks = array() ;
+ $this->mCategoryLinks = array();
$this->mDoNothing = false;
$this->mContainsOldMagic = $this->mContainsNewMagic = 0;
$this->mParserOptions = ParserOptions::newFromUser( $temp = NULL );
$this->mRevisionId = null;
}
- function addHeader( $name, $val ) { array_push( $this->mHeaders, $name.': '.$val ) ; }
+ function addHeader( $name, $val ) { array_push( $this->mHeaders, $name.': '.$val ); }
function redirect( $url, $responsecode = '302' ) { $this->mRedirect = $url; $this->mRedirectCode = $responsecode; }
function setStatusCode( $statusCode ) { $this->mStatusCode = $statusCode; }
if( is_string( $source ) ) {
if( strcmp( $source, '' ) == 0 ) {
- global $wgTitle ;
+ global $wgTitle;
if ( $wgTitle->getNamespace() == NS_MEDIAWIKI ) {
- $source = wfMsgWeirdKey ( $wgTitle->getText() ) ;
+ $source = wfMsgWeirdKey ( $wgTitle->getText() );
} else {
$source = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
}
* @access private
*/
function braceSubstitution( $piece ) {
- global $wgContLang;
+ global $wgContLang, $wgAllowDisplayTitle;
$fname = 'Parser::braceSubstitution';
wfProfileIn( $fname );
$found = true;
}
}
+
+ # DISPLAYTITLE
+ if ( !$found && $argc == 1 && $wgAllowDisplayTitle ) {
+ global $wgOut;
+
+ # Only the first one counts...
+ if ( $wgOut->mPageLinkTitle == "" ) {
+ $param = $args[0];
+ $parserOptions = new ParserOptions;
+ $local_parser = new Parser ();
+ $t2 = $local_parser->parse ( $param, $this->mTitle, $parserOptions, false );
+ $wgOut->mPageLinkTitle = $wgOut->getPageTitle();
+ $wgOut->mPagetitle = $t2->GetText();
+
+ # Add subtitle
+ $t = $this->mTitle->getPrefixedText();
+ $st = trim ( $wgOut->getSubtitle () );
+ if ( $st != "" ) $st .= " ";
+ $st .= str_replace ( "$1", $t, wfMsg('displaytitle') );
+ $wgOut->setSubtitle ( $st );
+ }
+ $text = "" ;
+ $found = true ;
+ }
# Extensions
if ( !$found ) {
function pageTitle() {
global $wgOut;
-
$s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
return $s;
}
wfProfileIn( "$fname-stuff2" );
$tpl->set( 'title', $wgOut->getPageTitle() );
$tpl->set( 'pagetitle', $wgOut->getHTMLTitle() );
+ $tpl->set( 'displaytitle', $wgOut->mPageLinkTitle );
$tpl->setRef( "thispage", $this->thispage );
$subpagestr = $this->subPageSubtitle();
MAG_LC => array( 0, 'LC:' ),
MAG_UC => array( 0, 'UC:' ),
MAG_RAW => array( 0, 'RAW:' ),
+ MAG_DISPLAYTITLE => array( 1, 'DISPLAYTITLE' ),
);
if (!$wgCachedMessageArrays) {
'articletitles' => "Articles starting with ''$1''",
'hideresults' => 'Hide results',
+# DISPLAYTITLE
+'displaytitle' => '(Link to this page as [[$1]])',
+
);
<div id="content">
<a name="top" id="top"></a>
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
- <h1 class="firstHeading"><?php $this->text('title') ?></h1>
+ <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
<div id="bodyContent">
<h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
<div id="contentSub"><?php $this->html('subtitle') ?></div>