=== New user-facing features in 1.34 ===
* Special:Mute has been added as a quick way for users to block unwanted emails
from other users originating from Special:EmailUser.
+* (T207577) Special:NewSection has been created as a shortcut to creating a new
+ section on a page. When linked to, its subpage is used as the target
+ ([[Special:NewSection/Test]] redirects to creating a new section in "Test").
+ Otherwise, it displays a basic interface to allow the end user to specify
+ the target manually.
=== New developer features in 1.34 ===
* Language::formatTimePeriod now supports the new 'avoidhours' option to output
'SpecialMytalk' => __DIR__ . '/includes/specials/redirects/SpecialMytalk.php',
'SpecialMyuploads' => __DIR__ . '/includes/specials/redirects/SpecialMyuploads.php',
'SpecialNewFiles' => __DIR__ . '/includes/specials/SpecialNewimages.php',
+ 'SpecialNewSection' => __DIR__ . '/includes/specials/SpecialNewSection.php',
'SpecialNewpages' => __DIR__ . '/includes/specials/SpecialNewpages.php',
'SpecialPage' => __DIR__ . '/includes/specialpage/SpecialPage.php',
'SpecialPageAction' => __DIR__ . '/includes/actions/SpecialPageAction.php',
'Mytalk' => \SpecialMytalk::class,
'Myuploads' => \SpecialMyuploads::class,
'AllMyUploads' => \SpecialAllMyUploads::class,
+ 'NewSection' => \SpecialNewSection::class,
'PermanentLink' => \SpecialPermanentLink::class,
'Redirect' => \SpecialRedirect::class,
'Revisiondelete' => \SpecialRevisionDelete::class,
--- /dev/null
+<?php
+/**
+ * Redirect from Special:NewSection/$1 to index.php?title=$1&action=edit§ion=new.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
+ */
+class SpecialNewSection extends RedirectSpecialPage {
+ public function __construct() {
+ parent::__construct( 'NewSection' );
+ $this->mAllowedRedirectParams = [ 'preloadtitle', 'nosummary', 'editintro',
+ 'preload', 'preloadparams[]', 'summary' ];
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getRedirect( $subpage ) {
+ if ( $subpage === null || $subpage === '' ) {
+ return false;
+ }
+ $this->mAddedRedirectParams['title'] = $subpage;
+ $this->mAddedRedirectParams['action'] = 'edit';
+ $this->mAddedRedirectParams['section'] = 'new';
+ return true;
+ }
+
+ protected function showNoRedirectPage() {
+ $this->setHeaders();
+ $this->outputHeader();
+ $this->showForm();
+ }
+
+ private function showForm() {
+ $form = HTMLForm::factory( 'ooui', [
+ 'page' => [
+ 'type' => 'text',
+ 'name' => 'page',
+ 'label-message' => 'newsection-page',
+ ],
+ ], $this->getContext(), 'newsection' );
+ $form->setSubmitTextMsg( 'newsection-submit' );
+ $form->setSubmitCallback( [ $this, 'onFormSubmit' ] );
+ $form->show();
+ }
+
+ public function onFormSubmit( $formData ) {
+ $page = $formData['page'];
+ $query = [ 'action' => 'edit', 'section' => 'new' ];
+ $url = $page->getFullUrlForRedirect( $query );
+ $this->getOutput()->redirect( $url );
+ }
+
+ public function isListed() {
+ return true;
+ }
+
+ protected function getGroupName() {
+ return 'redirects';
+ }
+}
"permanentlink-revid": "Revision ID",
"permanentlink-submit": "Go to revision",
"permanentlink-summary": "",
+ "newsection": "New section",
+ "newsection-page": "Target page",
+ "newsection-submit": "Go to page",
+ "newsection-summary": "",
"dberr-problems": "Sorry! This site is experiencing technical difficulties.",
"dberr-again": "Try waiting a few minutes and reloading.",
"dberr-info": "(Cannot access the database: $1)",
"permanentlink-revid": "Label for the field for the revision ID in [[Special:PermanentLink]]\n{{Identical|Revision ID}}",
"permanentlink-submit": "Submit button on [[Special:PermanentLink]]",
"permanentlink-summary": "{{doc-specialpagesummary|permanentlink}}",
+ "newsection": "The title of [[Special:NewSection]]",
+ "newsection-page": "Label for the field for the target page in [[Special:NewSection]]",
+ "newsection-submit": "Submit button on [[Special:NewSection]]",
+ "newsection-summary": "{{doc-specialpagessummary|newsection}}",
"dberr-problems": "This message does not allow any wiki nor html markup.",
"dberr-again": "This message does not allow any wiki nor html markup.",
"dberr-info": "This message does not allow any wiki nor html markup. Parameters:\n* $1 - database server name\nSee also:\n* {{msg-mw|Dberr-info-hidden}} - hides database server name",
'Mytalk' => [ 'MyTalk' ],
'Myuploads' => [ 'MyUploads', 'MyFiles' ],
'Newimages' => [ 'NewFiles', 'NewImages' ],
+ 'NewSection' => [ 'NewSection', 'Newsection' ],
'Newpages' => [ 'NewPages' ],
'PagesWithProp' => [ 'PagesWithProp', 'Pageswithprop', 'PagesByProp', 'Pagesbyprop' ],
'PageData' => [ 'PageData' ],