(bug 13100) Added 'preloadtitle' parameter to action=edit&section=new that pre-fills...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 26 Feb 2008 22:40:59 +0000 (22:40 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 26 Feb 2008 22:40:59 +0000 (22:40 +0000)
RELEASE-NOTES
includes/EditPage.php

index cf5b642..d7f6c99 100644 (file)
@@ -34,6 +34,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   confused when they are told they are range-blocked.
 * Add a new hook ImageBeforeProduceHTML to allow extensions to modify wikitext
   image syntax output.
+* (bug 13100) Added 'preloadtitle' parameter to action=edit&section=new that
+  pre-fills the section title field.
 
 === Bug fixes in 1.13 ===
 
index 1a3eae7..badb695 100644 (file)
@@ -531,6 +531,9 @@ class EditPage {
                $fname = 'EditPage::importFormData';
                wfProfileIn( $fname );
 
+               # Section edit can come from either the form or a link
+               $this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) );
+
                if( $request->wasPosted() ) {
                        # These fields need to be checked for encoding.
                        # Also remove trailing whitespace, but don't remove _initial_
@@ -614,13 +617,14 @@ class EditPage {
                        $this->minoredit = false;
                        $this->watchthis = false;
                        $this->recreate  = false;
+
+                       if ( $this->section == 'new' && $request->getVal( 'preloadtitle' ) ) {
+                               $this->summary = $request->getVal( 'preloadtitle' );
+                       }
                }
 
                $this->oldid = $request->getInt( 'oldid' );
 
-               # Section edit can come from either the form or a link
-               $this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) );
-
                $this->live = $request->getCheck( 'live' );
                $this->editintro = $request->getText( 'editintro' );