* @access private
*/
function braceSubstitution( $piece ) {
- global $wgContLang, $wgAllowDisplayTitle;
+ global $wgContLang, $wgAllowDisplayTitle, $action;
$fname = 'Parser::braceSubstitution';
wfProfileIn( $fname );
}
# 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 );
+ if ( !$found && $argc == 1 && $wgAllowDisplayTitle && $action == "view" ) {
+ $mwDT =& MagicWord::get( MAG_DISPLAYTITLE );
+ if ( $mwDT->matchStartAndRemove( $part1 ) ) {
+ 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 .= wfMsg('displaytitle', $t);
+ $wgOut->setSubtitle ( $st );
+ }
+ $text = "" ;
+ $found = true ;
}
- $text = "" ;
- $found = true ;
}
# Extensions