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