Index: branches/hashar/prettyURL/includes/specials/SpecialAllpages.php |
— | — | @@ -95,9 +95,12 @@ |
96 | 96 | * @param $to String: dbKey we are ending listing at. |
97 | 97 | */ |
98 | 98 | function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) { |
| 99 | + global $wgScript; |
| 100 | + $t = $this->getTitle(); |
99 | 101 | |
100 | 102 | $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) ); |
101 | | - $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getFormAction() ) ); |
| 103 | + $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
| 104 | + $out .= Html::hidden( 'title', $t->getPrefixedText() ); |
102 | 105 | $out .= Xml::openElement( 'fieldset' ); |
103 | 106 | $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) ); |
104 | 107 | $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) ); |
Index: branches/hashar/prettyURL/includes/specials/SpecialUserrights.php |
— | — | @@ -372,14 +372,10 @@ |
373 | 373 | * Output a form to allow searching for a user |
374 | 374 | */ |
375 | 375 | function switchForm() { |
376 | | - global $wgOut; |
| 376 | + global $wgOut, $wgScript; |
377 | 377 | $wgOut->addHTML( |
378 | | - Html::openElement( 'form', array( |
379 | | - 'action' => $this->getFormAction(), |
380 | | - 'id' => 'mw-userrights-form1', |
381 | | - 'method' => 'get', |
382 | | - 'name' => 'uluser', |
383 | | - ) ) . |
| 378 | + Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1' ) ) . |
| 379 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
384 | 380 | Xml::fieldset( wfMsg( 'userrights-lookup-user' ) ) . |
385 | 381 | Xml::inputLabel( wfMsg( 'userrights-user-editname' ), 'user', 'username', 30, str_replace( '_', ' ', $this->mTarget ) ) . ' ' . |
386 | 382 | Xml::submitButton( wfMsg( 'editusergroup' ) ) . |
— | — | @@ -442,12 +438,7 @@ |
443 | 439 | $grouplist .= '<p>' . $autogrouplistintro . ' ' . $wgLang->listToText( $autolist ) . "</p>\n"; |
444 | 440 | } |
445 | 441 | $wgOut->addHTML( |
446 | | - Xml::openElement( 'form', array( |
447 | | - 'action' => $this->getFormAction(), |
448 | | - 'id' => 'mw-userrights-form2', |
449 | | - 'method' => 'post', |
450 | | - 'name' => 'editGroup', |
451 | | - ) ) . |
| 442 | + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL(), 'name' => 'editGroup', 'id' => 'mw-userrights-form2' ) ) . |
452 | 443 | Html::hidden( 'user', $this->mTarget ) . |
453 | 444 | Html::hidden( 'wpEditToken', $wgUser->editToken( $this->mTarget ) ) . |
454 | 445 | Xml::openElement( 'fieldset' ) . |
Index: branches/hashar/prettyURL/includes/specials/SpecialAllmessages.php |
— | — | @@ -83,11 +83,14 @@ |
84 | 84 | } |
85 | 85 | |
86 | 86 | function buildForm() { |
| 87 | + global $wgScript; |
| 88 | + |
87 | 89 | $languages = Language::getLanguageNames( false ); |
88 | 90 | ksort( $languages ); |
89 | 91 | |
90 | | - $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getFormAction(), 'id' => 'mw-allmessages-form' ) ) . |
| 92 | + $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) . |
91 | 93 | Xml::fieldset( wfMsg( 'allmessages-filter-legend' ) ) . |
| 94 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
92 | 95 | Xml::openElement( 'table', array( 'class' => 'mw-allmessages-table' ) ) . "\n" . |
93 | 96 | '<tr> |
94 | 97 | <td class="mw-label">' . |
Index: branches/hashar/prettyURL/includes/specials/SpecialUndelete.php |
— | — | @@ -718,15 +718,16 @@ |
719 | 719 | } |
720 | 720 | |
721 | 721 | function showSearchForm() { |
722 | | - global $wgOut; |
| 722 | + global $wgOut, $wgScript; |
723 | 723 | $wgOut->addWikiMsg( 'undelete-header' ); |
724 | 724 | |
725 | 725 | $wgOut->addHTML( |
726 | 726 | Xml::openElement( 'form', array( |
727 | 727 | 'method' => 'get', |
728 | | - 'action' => $this->getFormAction(), |
729 | | - ) ) . |
| 728 | + 'action' => $wgScript ) ) . |
730 | 729 | Xml::fieldset( wfMsg( 'undelete-search-box' ) ) . |
| 730 | + Html::hidden( 'title', |
| 731 | + $this->getTitle()->getPrefixedDbKey() ) . |
731 | 732 | Xml::inputLabel( wfMsg( 'undelete-search-prefix' ), |
732 | 733 | 'prefix', 'prefix', 20, |
733 | 734 | $this->mSearchPrefix ) . ' ' . |
Index: branches/hashar/prettyURL/includes/specials/SpecialNewpages.php |
— | — | @@ -203,7 +203,7 @@ |
204 | 204 | } |
205 | 205 | |
206 | 206 | protected function form() { |
207 | | - global $wgOut, $wgEnableNewpagesUserFilter; |
| 207 | + global $wgOut, $wgEnableNewpagesUserFilter, $wgScript; |
208 | 208 | |
209 | 209 | // Consume values |
210 | 210 | $this->opts->consumeValue( 'offset' ); // don't carry offset, DWIW |
— | — | @@ -227,7 +227,8 @@ |
228 | 228 | list( $tagFilterLabel, $tagFilterSelector ) = $tagFilter; |
229 | 229 | } |
230 | 230 | |
231 | | - $form = Xml::openElement( 'form', array( 'action' => $this->getFormAction() ) ) . |
| 231 | + $form = Xml::openElement( 'form', array( 'action' => $wgScript ) ) . |
| 232 | + Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . |
232 | 233 | Xml::fieldset( wfMsg( 'newpages' ) ) . |
233 | 234 | Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) . |
234 | 235 | '<tr> |
Index: branches/hashar/prettyURL/includes/specials/SpecialFilepath.php |
— | — | @@ -71,12 +71,13 @@ |
72 | 72 | } |
73 | 73 | |
74 | 74 | function showForm( $title ) { |
75 | | - global $wgOut; |
| 75 | + global $wgOut, $wgScript; |
76 | 76 | |
77 | 77 | $wgOut->addHTML( |
78 | | - Html::openElement( 'form', array( 'method' => 'get', 'action' => $this->getFormAction(), 'id' => 'specialfilepath' ) ) . |
| 78 | + Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'specialfilepath' ) ) . |
79 | 79 | Html::openElement( 'fieldset' ) . |
80 | 80 | Html::element( 'legend', null, wfMsg( 'filepath' ) ) . |
| 81 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
81 | 82 | Xml::inputLabel( wfMsg( 'filepath-page' ), 'file', 'file', 25, is_object( $title ) ? $title->getText() : '' ) . ' ' . |
82 | 83 | Xml::submitButton( wfMsg( 'filepath-submit' ) ) . "\n" . |
83 | 84 | Html::closeElement( 'fieldset' ) . |
Index: branches/hashar/prettyURL/includes/specials/SpecialFileDuplicateSearch.php |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | } |
93 | 93 | |
94 | 94 | function execute( $par ) { |
95 | | - global $wgRequest, $wgOut, $wgLang, $wgContLang; |
| 95 | + global $wgRequest, $wgOut, $wgLang, $wgContLang, $wgScript; |
96 | 96 | |
97 | 97 | $this->setHeaders(); |
98 | 98 | $this->outputHeader(); |
— | — | @@ -106,7 +106,8 @@ |
107 | 107 | |
108 | 108 | # Create the input form |
109 | 109 | $wgOut->addHTML( |
110 | | - Xml::openElement( 'form', array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $this->getFormAction() ) ) . |
| 110 | + Xml::openElement( 'form', array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript ) ) . |
| 111 | + Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . |
111 | 112 | Xml::openElement( 'fieldset' ) . |
112 | 113 | Xml::element( 'legend', null, wfMsg( 'fileduplicatesearch-legend' ) ) . |
113 | 114 | Xml::inputLabel( wfMsg( 'fileduplicatesearch-filename' ), 'filename', 'filename', 50, $this->filename ) . ' ' . |
Index: branches/hashar/prettyURL/includes/specials/SpecialWhatlinkshere.php |
— | — | @@ -380,9 +380,10 @@ |
381 | 381 | $namespace = $this->opts->consumeValue( 'namespace' ); |
382 | 382 | |
383 | 383 | # Build up the form |
384 | | - $f = Xml::openElement( 'form', array( 'action' => $this->getFormAction() ) ); |
| 384 | + $f = Xml::openElement( 'form', array( 'action' => $wgScript ) ); |
385 | 385 | |
386 | 386 | # Values that should not be forgotten |
| 387 | + $f .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ); |
387 | 388 | foreach ( $this->opts->getUnconsumedValues() as $name => $value ) { |
388 | 389 | $f .= Html::hidden( $name, $value ); |
389 | 390 | } |
Index: branches/hashar/prettyURL/includes/specials/SpecialRecentchanges.php |
— | — | @@ -510,7 +510,9 @@ |
511 | 511 | $out .= Html::hidden( $key, $value ); |
512 | 512 | } |
513 | 513 | |
514 | | - $form = Xml::tags( 'form', array( 'action' => $this->getFormAction() ), $out ); |
| 514 | + $t = $this->getTitle(); |
| 515 | + $out .= Html::hidden( 'title', $t->getPrefixedText() ); |
| 516 | + $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out ); |
515 | 517 | $panel[] = $form; |
516 | 518 | $panelString = implode( "\n", $panel ); |
517 | 519 | |
Index: branches/hashar/prettyURL/includes/specials/SpecialProtectedtitles.php |
— | — | @@ -112,10 +112,14 @@ |
113 | 113 | * @private |
114 | 114 | */ |
115 | 115 | function showOptions( $namespace, $type='edit', $level ) { |
116 | | - # FIXME use Xml: or Html: methods to build the form |
117 | | - return "<form action=\"". $this->getFormAction()."\" method=\"get\">\n" . |
| 116 | + global $wgScript; |
| 117 | + $action = htmlspecialchars( $wgScript ); |
| 118 | + $title = SpecialPage::getTitleFor( 'Protectedtitles' ); |
| 119 | + $special = htmlspecialchars( $title->getPrefixedDBkey() ); |
| 120 | + return "<form action=\"$action\" method=\"get\">\n" . |
118 | 121 | '<fieldset>' . |
119 | 122 | Xml::element( 'legend', array(), wfMsg( 'protectedtitles' ) ) . |
| 123 | + Html::hidden( 'title', $special ) . " \n" . |
120 | 124 | $this->getNamespaceMenu( $namespace ) . " \n" . |
121 | 125 | $this->getLevelMenu( $level ) . " \n" . |
122 | 126 | " " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . |
Index: branches/hashar/prettyURL/includes/specials/SpecialPrefixindex.php |
— | — | @@ -77,9 +77,12 @@ |
78 | 78 | * @param $from String: dbKey we are starting listing at. |
79 | 79 | */ |
80 | 80 | function namespacePrefixForm( $namespace = NS_MAIN, $from = '' ) { |
| 81 | + global $wgScript; |
| 82 | + $t = $this->getTitle(); |
81 | 83 | |
82 | 84 | $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) ); |
83 | | - $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getFormAction() ) ); |
| 85 | + $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
| 86 | + $out .= Html::hidden( 'title', $t->getPrefixedText() ); |
84 | 87 | $out .= Xml::openElement( 'fieldset' ); |
85 | 88 | $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) ); |
86 | 89 | $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) ); |
Index: branches/hashar/prettyURL/includes/specials/SpecialWithoutinterwiki.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | } |
43 | 43 | |
44 | 44 | function getPageHeader() { |
45 | | - global $wgMiserMode; |
| 45 | + global $wgScript, $wgMiserMode; |
46 | 46 | |
47 | 47 | # Do not show useless input form if wiki is running in misermode |
48 | 48 | if( $wgMiserMode ) { |
— | — | @@ -49,10 +49,12 @@ |
50 | 50 | } |
51 | 51 | |
52 | 52 | $prefix = $this->prefix; |
| 53 | + $t = SpecialPage::getTitleFor( $this->getName() ); |
53 | 54 | |
54 | | - return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getFormAction() ) ) . |
| 55 | + return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . |
55 | 56 | Xml::openElement( 'fieldset' ) . |
56 | 57 | Xml::element( 'legend', null, wfMsg( 'withoutinterwiki-legend' ) ) . |
| 58 | + Html::hidden( 'title', $t->getPrefixedText() ) . |
57 | 59 | Xml::inputLabel( wfMsg( 'allpagesprefix' ), 'prefix', 'wiprefix', 20, $prefix ) . ' ' . |
58 | 60 | Xml::submitButton( wfMsg( 'withoutinterwiki-submit' ) ) . |
59 | 61 | Xml::closeElement( 'fieldset' ) . |
Index: branches/hashar/prettyURL/includes/specials/SpecialBooksources.php |
— | — | @@ -114,8 +114,11 @@ |
115 | 115 | * @return string |
116 | 116 | */ |
117 | 117 | private function makeForm() { |
| 118 | + global $wgScript; |
| 119 | + $title = self::getTitleFor( 'Booksources' ); |
118 | 120 | $form = '<fieldset><legend>' . wfMsgHtml( 'booksources-search-legend' ) . '</legend>'; |
119 | | - $form .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getFormAction() ) ); |
| 121 | + $form .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
| 122 | + $form .= Html::hidden( 'title', $title->getPrefixedText() ); |
120 | 123 | $form .= '<p>' . Xml::inputLabel( wfMsg( 'booksources-isbn' ), 'isbn', 'isbn', 20, $this->isbn ); |
121 | 124 | $form .= ' ' . Xml::submitButton( wfMsg( 'booksources-go' ) ) . '</p>'; |
122 | 125 | $form .= Xml::closeElement( 'form' ); |
Index: branches/hashar/prettyURL/includes/specials/SpecialSearch.php |
— | — | @@ -218,7 +218,7 @@ |
219 | 219 | array( |
220 | 220 | 'id' => ( $this->searchAdvanced ? 'powersearch' : 'search' ), |
221 | 221 | 'method' => 'get', |
222 | | - 'action' => $this->getFormAction(), |
| 222 | + 'action' => $wgScript |
223 | 223 | ) |
224 | 224 | ) |
225 | 225 | ); |
— | — | @@ -836,6 +836,7 @@ |
837 | 837 | $namespaceTables . |
838 | 838 | Xml::element( 'div', array( 'class' => 'divider' ), '', false ) . |
839 | 839 | $redirects . |
| 840 | + Html::hidden( 'title', SpecialPage::getTitleFor( 'Search' )->getPrefixedText() ) . |
840 | 841 | Html::hidden( 'advanced', $this->searchAdvanced ) . |
841 | 842 | Html::hidden( 'fulltext', 'Advanced search' ) . |
842 | 843 | Xml::closeElement( 'fieldset' ); |
— | — | @@ -959,6 +960,8 @@ |
960 | 961 | } |
961 | 962 | |
962 | 963 | protected function shortDialog( $term ) { |
| 964 | + $searchTitle = SpecialPage::getTitleFor( 'Search' ); |
| 965 | + $out = Html::hidden( 'title', $searchTitle->getPrefixedText() ) . "\n"; |
963 | 966 | // Keep redirect setting |
964 | 967 | $out .= Html::hidden( "redirs", (int)$this->searchRedirects ) . "\n"; |
965 | 968 | // Term box |
Index: branches/hashar/prettyURL/includes/specials/SpecialProtectedpages.php |
— | — | @@ -159,9 +159,12 @@ |
160 | 160 | * @return String: input form |
161 | 161 | */ |
162 | 162 | protected function showOptions( $namespace, $type='edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly ) { |
163 | | - return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getFormAction() ) ) . |
| 163 | + global $wgScript; |
| 164 | + $title = SpecialPage::getTitleFor( 'Protectedpages' ); |
| 165 | + return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . |
164 | 166 | Xml::openElement( 'fieldset' ) . |
165 | 167 | Xml::element( 'legend', array(), wfMsg( 'protectedpages' ) ) . |
| 168 | + Html::hidden( 'title', $title->getPrefixedDBkey() ) . "\n" . |
166 | 169 | $this->getNamespaceMenu( $namespace ) . " \n" . |
167 | 170 | $this->getTypeMenu( $type ) . " \n" . |
168 | 171 | $this->getLevelMenu( $level ) . " \n" . |
Index: branches/hashar/prettyURL/includes/specials/SpecialMIMEsearch.php |
— | — | @@ -65,8 +65,9 @@ |
66 | 66 | $this->setHeaders(); |
67 | 67 | $this->outputHeader(); |
68 | 68 | $wgOut->addHTML( |
69 | | - Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $this->getFormAction() ) ) . |
| 69 | + Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor( 'MIMEsearch' )->getLocalUrl() ) ) . |
70 | 70 | Xml::openElement( 'fieldset' ) . |
| 71 | + Html::hidden( 'title', SpecialPage::getTitleFor( 'MIMEsearch' )->getPrefixedText() ) . |
71 | 72 | Xml::element( 'legend', null, wfMsg( 'mimesearch' ) ) . |
72 | 73 | Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 20, $mime ) . ' ' . |
73 | 74 | Xml::submitButton( wfMsg( 'ilsubmit' ) ) . |
Index: branches/hashar/prettyURL/includes/specials/SpecialMergeHistory.php |
— | — | @@ -131,17 +131,18 @@ |
132 | 132 | } |
133 | 133 | |
134 | 134 | function showMergeForm() { |
135 | | - global $wgOut ; |
| 135 | + global $wgOut, $wgScript; |
136 | 136 | |
137 | 137 | $wgOut->addWikiMsg( 'mergehistory-header' ); |
138 | 138 | |
139 | 139 | $wgOut->addHTML( |
140 | 140 | Xml::openElement( 'form', array( |
141 | 141 | 'method' => 'get', |
142 | | - 'action' => $this->getFormAction() ) ) . |
| 142 | + 'action' => $wgScript ) ) . |
143 | 143 | '<fieldset>' . |
144 | 144 | Xml::element( 'legend', array(), |
145 | 145 | wfMsg( 'mergehistory-box' ) ) . |
| 146 | + Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . |
146 | 147 | Html::hidden( 'submitted', '1' ) . |
147 | 148 | Html::hidden( 'mergepoint', $this->mTimestamp ) . |
148 | 149 | Xml::openElement( 'table' ) . |
Index: branches/hashar/prettyURL/includes/specials/SpecialLinkSearch.php |
— | — | @@ -42,7 +42,6 @@ |
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | |
46 | | - /** @todo rewrite this function to make it cleaner! Please? :( */ |
47 | 46 | function execute( $par ) { |
48 | 47 | global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang; |
49 | 48 | $this->setHeaders(); |
— | — | @@ -81,7 +80,8 @@ |
82 | 81 | $self = $this->getTitle(); |
83 | 82 | |
84 | 83 | $wgOut->addWikiMsg( 'linksearch-text', '<nowiki>' . $wgLang->commaList( $wgUrlProtocols ) . '</nowiki>' ); |
85 | | - $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $this->getFormAction() ) ) . |
| 84 | + $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . |
| 85 | + Html::hidden( 'title', $self->getPrefixedDbKey() ) . |
86 | 86 | '<fieldset>' . |
87 | 87 | Xml::element( 'legend', array(), wfMsg( 'linksearch' ) ) . |
88 | 88 | Xml::inputLabel( wfMsg( 'linksearch-pat' ), 'target', 'target', 50, $target ) . ' '; |
Index: branches/hashar/prettyURL/includes/SpecialPage.php |
— | — | @@ -944,15 +944,6 @@ |
945 | 945 | } |
946 | 946 | |
947 | 947 | /** |
948 | | - * Get a local URL suitable for <form action=""> |
949 | | - * |
950 | | - * @return String this title local URL |
951 | | - */ |
952 | | - function getFormAction( $subpage = false ) { |
953 | | - return self::getTitleFor( $this->mName, $subpage )->getLocalURL(); |
954 | | - } |
955 | | - |
956 | | - /** |
957 | 948 | * Set whether this page is listed in Special:Specialpages, at run-time |
958 | 949 | */ |
959 | 950 | function setListed( $listed ) { |