From 2d115ac53bad0a75d7d7ab95cb4885d607a14826 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 6 Aug 2008 19:20:38 +0000 Subject: [PATCH] (bug 15007) New 'pagetitle-view-mainpage' message allows the HTML of the main page to be customized. --- CREDITS | 2 +- RELEASE-NOTES | 2 ++ includes/Article.php | 8 ++++++++ languages/messages/MessagesEn.php | 1 + maintenance/language/messageTypes.inc | 1 + maintenance/language/messages.inc | 1 + 6 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index e3f971365e..146058148d 100644 --- a/CREDITS +++ b/CREDITS @@ -19,7 +19,7 @@ following names for their contribution to the product. * Tim Starling == Patch Contributors == -* +* RememberTheDot == Translators == * Anders Wegge Jakobsen diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 05eb802ae5..962312c5e9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -44,6 +44,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN ables into into the output of Skin::makeVariablesScript * Added $wgAddGroups and $wgRemoveGroups display on Special:ListGroupRights * (bug 14377) Add a date selector to history pages +* (bug 15007) New 'pagetitle-view-mainpage' message allows the HTML <title> of + the main page to be customized === Bug fixes in 1.14 === diff --git a/includes/Article.php b/includes/Article.php index d6809bfeff..2c479aadcc 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -892,6 +892,14 @@ class Article { $t = $wgOut->getPageTitle(); if( empty( $t ) ) { $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); + + # For the main page, overwrite the <title> element with the con- + # tents of 'pagetitle-view-mainpage' instead of the default (if + # that's not empty). + if( $this->mTitle->equals( Title::newMainPage() ) && + wfMsgForContent( 'pagetitle-view-mainpage' ) !== '' ) { + $wgOut->setHTMLTitle( wfMsgForContent( 'pagetitle-view-mainpage' ) ); + } } # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index cc75ea3a43..8e25c69229 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -728,6 +728,7 @@ See [[Special:Version|version page]].', 'ok' => 'OK', 'sitetitle' => '{{SITENAME}}', # do not translate or duplicate this message to other languages 'pagetitle' => '$1 - {{SITENAME}}', # only translate this message to other languages if you have to change it +'pagetitle-view-mainpage' => '', # do not translate or duplicate this message to other languages 'sitesubtitle' => '', # do not translate or duplicate this message to other languages 'retrievedfrom' => 'Retrieved from "$1"', 'youhavenewmessages' => 'You have $1 ($2).', diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index 56e0f1a40a..8a62a2ae99 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -150,6 +150,7 @@ $wgIgnoredMessages = array( 'fewestrevisions-summary', 'missingfiles-summary', 'upload-summary', + 'pagetitle-view-mainpage', ); /** Optional messages, which may be translated only if changed in the target language. */ diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 1b971e8b3f..42c5b226d7 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -250,6 +250,7 @@ $wgMessageStructure = array( 'ok', 'sitetitle', 'pagetitle', + 'pagetitle-view-mainpage', 'sitesubtitle', 'retrievedfrom', 'youhavenewmessages', -- 2.20.1