From 6ad9f6942286dce36c4e48320bfb9d0349a707f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 7 May 2005 04:51:33 +0000 Subject: [PATCH] * Added support for paramaters like Special:Movepage/Page_to_move --- RELEASE-NOTES | 2 ++ includes/SpecialMovepage.php | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2dde35894d..1e28771c21 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -155,6 +155,8 @@ Various bugfixes, small features, and a few experimental things: * Supplying a reason for a block is no longer mandatory * Language conversion support for category pages * $wgStyleSheetDirectory is no longer an alias for $wgStyleDirectory; +* Special:Movepage can now take paramaters like Special:Movepage/Page_to_move + (used to just be able to take paramaters via a GET request like index.php?title=Special:Movepage&target=Page_to_move) * ...and more! diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 2332a29d5b..65708eafd2 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -13,7 +13,7 @@ require_once( "LinksUpdate.php" ); /** * Constructor */ -function wfSpecialMovepage() { +function wfSpecialMovepage( $par = null ) { global $wgUser, $wgOut, $wgRequest, $action, $wgOnlySysopMayMove; # check rights. We don't want newbies to move pages to prevents possible attack @@ -27,7 +27,7 @@ function wfSpecialMovepage() { return; } - $f = new MovePageForm(); + $f = new MovePageForm( $par ); if ( 'success' == $action ) { $f->showSuccess(); @@ -48,9 +48,10 @@ class MovePageForm { var $oldTitle, $newTitle, $reason; # Text input var $moveTalk, $deleteAndMove; - function MovePageForm() { + function MovePageForm( $par ) { global $wgRequest; - $this->oldTitle = $wgRequest->getText( 'wpOldTitle', $wgRequest->getVal( 'target' ) ); + $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); + $this->oldTitle = $wgRequest->getText( 'wpOldTitle', $target ); $this->newTitle = $wgRequest->getText( 'wpNewTitle' ); $this->reason = $wgRequest->getText( 'wpReason' ); $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', true ); -- 2.20.1