r58980 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58979‎ | r58980 | r58981 >
Date:22:35, 12 November 2009
Author:btongminh
Status:resolved (Comments)
Tags:
Comment:
* (bug 17662) Customizable default preload/editintro in add-new-section link for Talk page. Patch by ireas.
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -74,6 +74,7 @@
7575 * Emufarmers
7676 * FunPika
7777 * Happy-melon
 78+* Ireas
7879 * Jeremy Baron
7980 * Jidanni
8081 * Jimmy Xu
Index: trunk/phase3/includes/SkinTemplate.php
@@ -740,10 +740,19 @@
741741 // adds new section link if page is a current revision of a talk page or
742742 if ( ( $wgArticle && $wgArticle->isCurrent() && $istalk ) || $wgOut->showNewSectionLink() ) {
743743 if ( !$wgOut->forceHideNewSectionLink() ) {
 744+ $urlArgs = 'action=edit&section=new';
 745+ $preloadMsg = wfMsg( 'talk-addsection-preload' );
 746+ $editintroMsg = wfMsg( 'talk-addsection-editintro' );
 747+ if( '' != $preloadMsg ) {
 748+ $urlArgs .= '&preload=' . urlencode( $preloadMsg );
 749+ }
 750+ if( '' != $editintroMsg ) {
 751+ $urlArgs .= '&editintro=' . urlencode( $editintroMsg );
 752+ }
744753 $content_actions['addsection'] = array(
745754 'class' => $section == 'new' ? 'selected' : false,
746755 'text' => wfMsg( 'addsection' ),
747 - 'href' => $this->mTitle->getLocalUrl( 'action=edit&section=new' )
 756+ 'href' => $this->mTitle->getLocalUrl( $urlArgs )
748757 );
749758 }
750759 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1357,6 +1357,8 @@
13581358 'edit-no-change' => 'Your edit was ignored, because no change was made to the text.',
13591359 'edit-already-exists' => 'Could not create a new page.
13601360 It already exists.',
 1361+'talk-addsection-preload' => '', # should be empty
 1362+'talk-addsection-editintro' => '', # should be empty
13611363
13621364 # Parser/template warnings
13631365 'expensive-parserfunction-warning' => "'''Warning:''' This page contains too many expensive parser function calls.
Index: trunk/phase3/RELEASE-NOTES
@@ -278,6 +278,8 @@
279279 * rebuildtextindex.php maintenance script now supports databases other than
280280 MySQL
281281 * upgrade1_5.php now requires to be run --update option to prevent confusion
 282+* (bug 17662) Customizable default preload/editintro in add-new-section link
 283+ for Talk page
282284
283285 === Bug fixes in 1.16 ===
284286

Follow-up revisions

RevisionCommit summaryAuthorDate
r58985Update language maintenance scripts for r58980btongminh22:58, 12 November 2009
r60559Fix for r58980: use wfMsgForContentbtongminh15:03, 2 January 2010
r60927Followup r58980: Moved logic for addsection-editintro/preload from SkinTempla...btongminh11:47, 11 January 2010

Comments

#Comment by Siebrand (talk | contribs)   22:38, 12 November 2009

Please update maintenance/language/messages.inc when adding messages. If the messages must remain untranslated, the $wgIgnoredMessages in messageTypes.inc should also be updated. Thanks.

#Comment by Bryan (talk | contribs)   22:59, 12 November 2009

Fixed in r58985.

#Comment by Raymond (talk | contribs)   16:26, 13 November 2009

I wonder if it wouldn't be better to use wfMsgForContent?

#Comment by Bryan (talk | contribs)   20:49, 1 January 2010

I'm not sure, perhaps you want those per language?

#Comment by Platonides (talk | contribs)   20:54, 1 January 2010

No, as it's clear from the fact that it should be empty. Sites like commons would want to override it, but I also think it should be ForContent.

#Comment by Tim Starling (talk | contribs)   05:12, 11 January 2010

This logic should be in EditPage, not passed through a URL parameter in a link from SkinTemplate.

#Comment by Bryan (talk | contribs)   11:55, 11 January 2010

Status & tagging log