http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60927

Revision: 60927
Author:   btongminh
Date:     2010-01-11 11:47:50 +0000 (Mon, 11 Jan 2010)

Log Message:
-----------
Followup r58980: Moved logic for addsection-editintro/preload from SkinTemplate 
to EditPage.

Message names changed from talk-addsection-* to addsection-*.
Messages now contain the preload/editnotice themselves instead of the title of 
the page that contains them.

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/EditPage.php
    trunk/phase3/includes/SkinTemplate.php
    trunk/phase3/languages/messages/MessagesEn.php
    trunk/phase3/maintenance/language/messages.inc

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2010-01-11 09:51:39 UTC (rev 60926)
+++ trunk/phase3/RELEASE-NOTES  2010-01-11 11:47:50 UTC (rev 60927)
@@ -273,8 +273,8 @@
 * rebuildtextindex.php maintenance script now supports databases other than
   MySQL
 * upgrade1_5.php now requires to be run --update option to prevent confusion
-* (bug 17662) Customizable default preload/editintro in add-new-section link
-  for Talk page
+* (bug 17662) Customizable default preload/editintro for new sections in the
+  respective addsection-preload and addsection-editintro messages
 * Added maintenance script syntaxChecker.php that checks for PHP syntax errors
   and common coding mistakes
 * Updated Unicode normalization tables

Modified: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php  2010-01-11 09:51:39 UTC (rev 60926)
+++ trunk/phase3/includes/EditPage.php  2010-01-11 11:47:50 UTC (rev 60927)
@@ -129,7 +129,10 @@
                wfProfileIn( __METHOD__ );
                # Get variables from query string :P
                $section = $wgRequest->getVal( 'section' );
-               $preload = $wgRequest->getVal( 'preload' );
+                       
+               $preload = $wgRequest->getVal( 'preload', 
+                       // Custom preload text for new sections
+                       $section === 'new' ? 'MediaWiki:addsection-preload' : 
'' );
                $undoafter = $wgRequest->getVal( 'undoafter' );
                $undo = $wgRequest->getVal( 'undo' );
 
@@ -709,7 +712,9 @@
                $this->oldid = $request->getInt( 'oldid' );
 
                $this->live = $request->getCheck( 'live' );
-               $this->editintro = $request->getText( 'editintro' );
+               $this->editintro = $request->getText( 'editintro',
+                       // Custom edit intro for new sections
+                       $this->section === 'new' ? 
'MediaWiki:addsection-editintro' : '' );
 
                wfProfileOut( __METHOD__ );
 

Modified: trunk/phase3/includes/SkinTemplate.php
===================================================================
--- trunk/phase3/includes/SkinTemplate.php      2010-01-11 09:51:39 UTC (rev 
60926)
+++ trunk/phase3/includes/SkinTemplate.php      2010-01-11 11:47:50 UTC (rev 
60927)
@@ -760,19 +760,10 @@
                                // adds new section link if page is a current 
revision of a talk page or
                                if ( ( $wgArticle && $wgArticle->isCurrent() && 
$istalk ) || $wgOut->showNewSectionLink() ) {
                                        if ( !$wgOut->forceHideNewSectionLink() 
) {
-                                               $urlArgs = 
'action=edit&section=new';
-                                               $preloadMsg = wfMsgForContent( 
'talk-addsection-preload' );
-                                               $editintroMsg = 
wfMsgForContent( 'talk-addsection-editintro' );
-                                               if( $preloadMsg != ''  ) {
-                                                       $urlArgs .= '&preload=' 
. urlencode( $preloadMsg );
-                                               }
-                                               if( $editintroMsg != '' ) {
-                                                       $urlArgs .= 
'&editintro=' . urlencode( $editintroMsg );
-                                               }
                                                $content_actions['addsection'] 
= array(
                                                        'class' => $section == 
'new' ? 'selected' : false,
                                                        'text' => wfMsg( 
'addsection' ),
-                                                       'href' => 
$this->mTitle->getLocalUrl( $urlArgs )
+                                                       'href' => 
$this->mTitle->getLocalUrl( 'action=edit&section=new' )
                                                );
                                        }
                                }

Modified: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php      2010-01-11 09:51:39 UTC 
(rev 60926)
+++ trunk/phase3/languages/messages/MessagesEn.php      2010-01-11 11:47:50 UTC 
(rev 60927)
@@ -1359,8 +1359,8 @@
 'edit-no-change'                   => 'Your edit was ignored, because no 
change was made to the text.',
 'edit-already-exists'              => 'Could not create a new page.
 It already exists.',
-'talk-addsection-preload'          => '', # do not translate or duplicate this 
message to other languages
-'talk-addsection-editintro'        => '', # do not translate or duplicate this 
message to other languages
+'addsection-preload'          => '', # do not translate or duplicate this 
message to other languages
+'addsection-editintro'        => '', # do not translate or duplicate this 
message to other languages
 
 # Parser/template warnings
 'expensive-parserfunction-warning'        => "'''Warning:''' This page 
contains too many expensive parser function calls.

Modified: trunk/phase3/maintenance/language/messages.inc
===================================================================
--- trunk/phase3/maintenance/language/messages.inc      2010-01-11 09:51:39 UTC 
(rev 60926)
+++ trunk/phase3/maintenance/language/messages.inc      2010-01-11 11:47:50 UTC 
(rev 60927)
@@ -602,8 +602,8 @@
                'edit-conflict',
                'edit-no-change',
                'edit-already-exists',
-               'talk-addsection-preload',
-               'talk-addsection-editintro',
+               'addsection-preload',
+               'addsection-editintro',
        ),
        'parserwarnings' => array(
                'expensive-parserfunction-warning',



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to