Index: trunk/phase3/includes/specials/SpecialMovepage.php |
— | — | @@ -54,12 +54,13 @@ |
55 | 55 | * @ingroup SpecialPage |
56 | 56 | */ |
57 | 57 | class MovePageForm { |
58 | | - var $oldTitle, $newTitle, $reason; # Text input |
59 | | - var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects; |
| 58 | + var $oldTitle, $newTitle; # Objects |
| 59 | + var $reason; # Text input |
| 60 | + var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects; # Checks |
60 | 61 | |
61 | 62 | private $watch = false; |
62 | 63 | |
63 | | - function MovePageForm( $oldTitle, $newTitle ) { |
| 64 | + function __construct( $oldTitle, $newTitle ) { |
64 | 65 | global $wgRequest; |
65 | 66 | $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); |
66 | 67 | $this->oldTitle = $oldTitle; |
— | — | @@ -83,16 +84,19 @@ |
84 | 85 | $skin = $wgUser->getSkin(); |
85 | 86 | |
86 | 87 | $oldTitleLink = $skin->makeLinkObj( $this->oldTitle ); |
87 | | - $oldTitle = $this->oldTitle->getPrefixedText(); |
88 | 88 | |
89 | | - $wgOut->setPagetitle( wfMsg( 'move-page', $oldTitle ) ); |
| 89 | + $wgOut->setPagetitle( wfMsg( 'move-page', $this->oldTitle->getPrefixedText() ) ); |
90 | 90 | $wgOut->setSubtitle( wfMsg( 'move-page-backlink', $oldTitleLink ) ); |
91 | 91 | |
92 | | - if( $this->newTitle == '' ) { |
| 92 | + $newTitle = $this->newTitle; |
| 93 | + |
| 94 | + if( !$newTitle ) { |
93 | 95 | # Show the current title as a default |
94 | 96 | # when the form is first opened. |
95 | | - $newTitle = $oldTitle; |
96 | | - } else { |
| 97 | + $newTitle = $this->oldTitle; |
| 98 | + } |
| 99 | + // WTF is this doing, passing title *object* to newFromUrl()?? |
| 100 | + /*else { |
97 | 101 | if( empty($err) ) { |
98 | 102 | $nt = Title::newFromURL( $this->newTitle ); |
99 | 103 | if( $nt ) { |
— | — | @@ -105,11 +109,10 @@ |
106 | 110 | } |
107 | 111 | } |
108 | 112 | } |
109 | | - $newTitle = $this->newTitle; |
110 | | - } |
| 113 | + }*/ |
111 | 114 | |
112 | 115 | if ( !empty($err) && $err[0] == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) { |
113 | | - $wgOut->addWikiMsg( 'delete_and_move_text', $newTitle ); |
| 116 | + $wgOut->addWikiMsg( 'delete_and_move_text', $newTitle->getPrefixedText() ); |
114 | 117 | $movepagebtn = wfMsg( 'delete_and_move' ); |
115 | 118 | $submitVar = 'wpDeleteAndMove'; |
116 | 119 | $confirm = " |
— | — | @@ -172,8 +175,8 @@ |
173 | 176 | Xml::label( wfMsg( 'newtitle' ), 'wpNewTitle' ) . |
174 | 177 | "</td> |
175 | 178 | <td class='mw-input'>" . |
176 | | - Xml::input( 'wpNewTitle', 40, $newTitle, array( 'type' => 'text', 'id' => 'wpNewTitle' ) ) . |
177 | | - Xml::hidden( 'wpOldTitle', $oldTitle ) . |
| 179 | + Xml::input( 'wpNewTitle', 40, $newTitle->getPrefixedText(), array( 'type' => 'text', 'id' => 'wpNewTitle' ) ) . |
| 180 | + Xml::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) . |
178 | 181 | "</td> |
179 | 182 | </tr> |
180 | 183 | <tr> |
— | — | @@ -215,7 +218,7 @@ |
216 | 219 | <tr> |
217 | 220 | <td></td> |
218 | 221 | <td class=\"mw-input\">" . |
219 | | - Xml::checkLabel( wfMsgHtml( |
| 222 | + Xml::checkLabel( wfMsg( |
220 | 223 | $this->oldTitle->hasSubpages() |
221 | 224 | ? 'move-subpages' |
222 | 225 | : 'move-talk-subpages' |