| Index: trunk/phase3/skins/MonoBook.php |
| — | — | @@ -93,7 +93,7 @@ |
| 94 | 94 | <div id="content"> |
| 95 | 95 | <a name="top" id="top"></a> |
| 96 | 96 | <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?> |
| 97 | | - <h1 class="firstHeading"><?php $this->text('title') ?></h1> |
| | 97 | + <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1> |
| 98 | 98 | <div id="bodyContent"> |
| 99 | 99 | <h3 id="siteSub"><?php $this->msg('tagline') ?></h3> |
| 100 | 100 | <div id="contentSub"><?php $this->html('subtitle') ?></div> |
| Index: trunk/phase3/includes/Parser.php |
| — | — | @@ -2441,7 +2441,7 @@ |
| 2442 | 2442 | * @access private |
| 2443 | 2443 | */ |
| 2444 | 2444 | function braceSubstitution( $piece ) { |
| 2445 | | - global $wgContLang; |
| | 2445 | + global $wgContLang, $wgAllowDisplayTitle; |
| 2446 | 2446 | $fname = 'Parser::braceSubstitution'; |
| 2447 | 2447 | wfProfileIn( $fname ); |
| 2448 | 2448 | |
| — | — | @@ -2611,7 +2611,31 @@ |
| 2612 | 2612 | $found = true; |
| 2613 | 2613 | } |
| 2614 | 2614 | } |
| | 2615 | + |
| | 2616 | + # DISPLAYTITLE |
| | 2617 | + if ( !$found && $argc == 1 && $wgAllowDisplayTitle ) { |
| | 2618 | + global $wgOut; |
| | 2619 | + |
| | 2620 | + # Only the first one counts... |
| | 2621 | + if ( $wgOut->mPageLinkTitle == "" ) { |
| | 2622 | + $param = $args[0]; |
| | 2623 | + $parserOptions = new ParserOptions; |
| | 2624 | + $local_parser = new Parser (); |
| | 2625 | + $t2 = $local_parser->parse ( $param, $this->mTitle, $parserOptions, false ); |
| | 2626 | + $wgOut->mPageLinkTitle = $wgOut->getPageTitle(); |
| | 2627 | + $wgOut->mPagetitle = $t2->GetText(); |
| 2615 | 2628 | |
| | 2629 | + # Add subtitle |
| | 2630 | + $t = $this->mTitle->getPrefixedText(); |
| | 2631 | + $st = trim ( $wgOut->getSubtitle () ); |
| | 2632 | + if ( $st != "" ) $st .= " "; |
| | 2633 | + $st .= str_replace ( "$1", $t, wfMsg('displaytitle') ); |
| | 2634 | + $wgOut->setSubtitle ( $st ); |
| | 2635 | + } |
| | 2636 | + $text = "" ; |
| | 2637 | + $found = true ; |
| | 2638 | + } |
| | 2639 | + |
| 2616 | 2640 | # Extensions |
| 2617 | 2641 | if ( !$found ) { |
| 2618 | 2642 | $colonPos = strpos( $part1, ':' ); |
| Index: trunk/phase3/includes/OutputPage.php |
| — | — | @@ -18,7 +18,7 @@ |
| 19 | 19 | var $mHTMLtitle, $mRobotpolicy, $mIsarticle, $mPrintable; |
| 20 | 20 | var $mSubtitle, $mRedirect, $mStatusCode; |
| 21 | 21 | var $mLastModified, $mETag, $mCategoryLinks; |
| 22 | | - var $mScripts, $mLinkColours; |
| | 22 | + var $mScripts, $mLinkColours, $mPageLinkTitle; |
| 23 | 23 | |
| 24 | 24 | var $mSuppressQuickbar; |
| 25 | 25 | var $mOnloadHandler; |
| — | — | @@ -40,11 +40,11 @@ |
| 41 | 41 | $this->mHTMLtitle = $this->mPagetitle = $this->mBodytext = |
| 42 | 42 | $this->mRedirect = $this->mLastModified = |
| 43 | 43 | $this->mSubtitle = $this->mDebugtext = $this->mRobotpolicy = |
| 44 | | - $this->mOnloadHandler = ''; |
| | 44 | + $this->mOnloadHandler = $this->mPageLinkTitle = ''; |
| 45 | 45 | $this->mIsArticleRelated = $this->mIsarticle = $this->mPrintable = true; |
| 46 | 46 | $this->mSuppressQuickbar = $this->mPrintable = false; |
| 47 | 47 | $this->mLanguageLinks = array(); |
| 48 | | - $this->mCategoryLinks = array() ; |
| | 48 | + $this->mCategoryLinks = array(); |
| 49 | 49 | $this->mDoNothing = false; |
| 50 | 50 | $this->mContainsOldMagic = $this->mContainsNewMagic = 0; |
| 51 | 51 | $this->mParserOptions = ParserOptions::newFromUser( $temp = NULL ); |
| — | — | @@ -54,7 +54,7 @@ |
| 55 | 55 | $this->mRevisionId = null; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | | - function addHeader( $name, $val ) { array_push( $this->mHeaders, $name.': '.$val ) ; } |
| | 58 | + function addHeader( $name, $val ) { array_push( $this->mHeaders, $name.': '.$val ); } |
| 59 | 59 | function redirect( $url, $responsecode = '302' ) { $this->mRedirect = $url; $this->mRedirectCode = $responsecode; } |
| 60 | 60 | function setStatusCode( $statusCode ) { $this->mStatusCode = $statusCode; } |
| 61 | 61 | |
| — | — | @@ -821,9 +821,9 @@ |
| 822 | 822 | |
| 823 | 823 | if( is_string( $source ) ) { |
| 824 | 824 | if( strcmp( $source, '' ) == 0 ) { |
| 825 | | - global $wgTitle ; |
| | 825 | + global $wgTitle; |
| 826 | 826 | if ( $wgTitle->getNamespace() == NS_MEDIAWIKI ) { |
| 827 | | - $source = wfMsgWeirdKey ( $wgTitle->getText() ) ; |
| | 827 | + $source = wfMsgWeirdKey ( $wgTitle->getText() ); |
| 828 | 828 | } else { |
| 829 | 829 | $source = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); |
| 830 | 830 | } |
| Index: trunk/phase3/includes/MagicWord.php |
| — | — | @@ -72,6 +72,7 @@ |
| 73 | 73 | 'MAG_RAW', |
| 74 | 74 | 'MAG_SUBPAGENAME', |
| 75 | 75 | 'MAG_SUBPAGENAMEE', |
| | 76 | + 'MAG_DISPLAYTITLE', |
| 76 | 77 | ); |
| 77 | 78 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
| 78 | 79 | wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) ); |
| — | — | @@ -105,7 +106,8 @@ |
| 106 | 107 | MAG_CURRENTDOW, |
| 107 | 108 | MAG_REVISIONID, |
| 108 | 109 | MAG_SUBPAGENAME, |
| 109 | | - MAG_SUBPAGENAMEE |
| | 110 | + MAG_SUBPAGENAMEE, |
| | 111 | + MAG_DISPLAYTITLE, |
| 110 | 112 | ); |
| 111 | 113 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
| 112 | 114 | wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) ); |
| Index: trunk/phase3/includes/SkinTemplate.php |
| — | — | @@ -187,6 +187,7 @@ |
| 188 | 188 | wfProfileIn( "$fname-stuff2" ); |
| 189 | 189 | $tpl->set( 'title', $wgOut->getPageTitle() ); |
| 190 | 190 | $tpl->set( 'pagetitle', $wgOut->getHTMLTitle() ); |
| | 191 | + $tpl->set( 'displaytitle', $wgOut->mPageLinkTitle ); |
| 191 | 192 | |
| 192 | 193 | $tpl->setRef( "thispage", $this->thispage ); |
| 193 | 194 | $subpagestr = $this->subPageSubtitle(); |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -1920,5 +1920,9 @@ |
| 1921 | 1921 | */ |
| 1922 | 1922 | $wgAjaxExportList = array( 'wfSajaxSearch' ); |
| 1923 | 1923 | |
| | 1924 | +/** |
| | 1925 | + * Allow DISPLAYTITLE to change title display |
| | 1926 | + */ |
| | 1927 | +$wgAllowDisplayTitle = false ; |
| 1924 | 1928 | |
| 1925 | 1929 | ?> |
| Index: trunk/phase3/includes/Skin.php |
| — | — | @@ -686,7 +686,6 @@ |
| 687 | 687 | |
| 688 | 688 | function pageTitle() { |
| 689 | 689 | global $wgOut; |
| 690 | | - |
| 691 | 690 | $s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>'; |
| 692 | 691 | return $s; |
| 693 | 692 | } |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -43,6 +43,8 @@ |
| 44 | 44 | * Minor grammatical improvements in English language files |
| 45 | 45 | * Display the anon talk page info message on anon talk pages again |
| 46 | 46 | (moved outside the parser cache) |
| | 47 | +* Optional {{DISPLAYTITLE|title with markup}} magic word |
| | 48 | + Deactivated by default, set "$wgAllowDisplayTitle = true" in LocalSettings.php to activate |
| 47 | 49 | |
| 48 | 50 | |
| 49 | 51 | == Compatibility == |
| Index: trunk/phase3/languages/Messages.php |
| — | — | @@ -2000,6 +2000,9 @@ |
| 2001 | 2001 | 'articletitles' => "Articles starting with ''$1''", |
| 2002 | 2002 | 'hideresults' => 'Hide results', |
| 2003 | 2003 | |
| | 2004 | +# DISPLAYTITLE |
| | 2005 | +'displaytitle' => '(Link to this page as [[$1]])', |
| | 2006 | + |
| 2004 | 2007 | ); |
| 2005 | 2008 | |
| 2006 | 2009 | |
| Index: trunk/phase3/languages/Language.php |
| — | — | @@ -265,6 +265,7 @@ |
| 266 | 266 | MAG_LC => array( 0, 'LC:' ), |
| 267 | 267 | MAG_UC => array( 0, 'UC:' ), |
| 268 | 268 | MAG_RAW => array( 0, 'RAW:' ), |
| | 269 | + MAG_DISPLAYTITLE => array( 1, 'DISPLAYTITLE' ), |
| 269 | 270 | ); |
| 270 | 271 | |
| 271 | 272 | if (!$wgCachedMessageArrays) { |