Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -38,7 +38,6 @@ |
39 | 39 | added to the textarea on the edit form. |
40 | 40 | * mw.util.getScript has been implemented (like wfScript in GlobalFunctions.php) |
41 | 41 | |
42 | | - |
43 | 42 | === Bug fixes in 1.19 === |
44 | 43 | * (bug 10154) Don't allow user to specify days beyond $wgRCMaxAge. |
45 | 44 | * (bug 28868) Show total pages in the subtitle of an image on the |
— | — | @@ -75,9 +74,9 @@ |
76 | 75 | * (bug 29055) Make don't send email on minor edits preference apply to |
77 | 76 | changes to talk page in addition to watchlist edits. |
78 | 77 | * (bug 29071) mediawiki.action.watch.ajax.js should pass uselang to API. |
| 78 | +* (bug 28272) Special:Allmessages should have only one "Go" button |
79 | 79 | |
80 | 80 | === API changes in 1.19 === |
81 | | - |
82 | 81 | * BREAKING CHANGE: action=watch now requires POST and token. |
83 | 82 | * (bug 27790) add query type for querymodules to action=paraminfo |
84 | 83 | * (bug 28963) add langbacklinks module to api |
Index: trunk/phase3/includes/specials/SpecialAllmessages.php |
— | — | @@ -34,8 +34,6 @@ |
35 | 35 | */ |
36 | 36 | protected $table; |
37 | 37 | |
38 | | - protected $filter, $prefix, $langCode; |
39 | | - |
40 | 38 | /** |
41 | 39 | * Constructor |
42 | 40 | */ |
— | — | @@ -75,91 +73,25 @@ |
76 | 74 | |
77 | 75 | $this->langCode = $this->table->lang->getCode(); |
78 | 76 | |
79 | | - $out->addHTML( $this->buildForm() . |
| 77 | + $out->addHTML( $this->table->buildForm() . |
80 | 78 | $this->table->getNavigationBar() . |
81 | | - $this->table->getLimitForm() . |
82 | 79 | $this->table->getBody() . |
83 | 80 | $this->table->getNavigationBar() ); |
84 | 81 | |
85 | 82 | } |
86 | 83 | |
87 | | - function buildForm() { |
88 | | - global $wgScript; |
| 84 | +} |
89 | 85 | |
90 | | - $languages = Language::getLanguageNames( false ); |
91 | | - ksort( $languages ); |
92 | 86 | |
93 | | - $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) . |
94 | | - Xml::fieldset( wfMsg( 'allmessages-filter-legend' ) ) . |
95 | | - Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
96 | | - Xml::openElement( 'table', array( 'class' => 'mw-allmessages-table' ) ) . "\n" . |
97 | | - '<tr> |
98 | | - <td class="mw-label">' . |
99 | | - Xml::label( wfMsg( 'allmessages-prefix' ), 'mw-allmessages-form-prefix' ) . |
100 | | - "</td>\n |
101 | | - <td class=\"mw-input\">" . |
102 | | - Xml::input( 'prefix', 20, str_replace( '_', ' ', $this->prefix ), array( 'id' => 'mw-allmessages-form-prefix' ) ) . |
103 | | - "</td>\n |
104 | | - </tr> |
105 | | - <tr>\n |
106 | | - <td class='mw-label'>" . |
107 | | - wfMsg( 'allmessages-filter' ) . |
108 | | - "</td>\n |
109 | | - <td class='mw-input'>" . |
110 | | - Xml::radioLabel( wfMsg( 'allmessages-filter-unmodified' ), |
111 | | - 'filter', |
112 | | - 'unmodified', |
113 | | - 'mw-allmessages-form-filter-unmodified', |
114 | | - ( $this->filter == 'unmodified' ) |
115 | | - ) . |
116 | | - Xml::radioLabel( wfMsg( 'allmessages-filter-all' ), |
117 | | - 'filter', |
118 | | - 'all', |
119 | | - 'mw-allmessages-form-filter-all', |
120 | | - ( $this->filter == 'all' ) |
121 | | - ) . |
122 | | - Xml::radioLabel( wfMsg( 'allmessages-filter-modified' ), |
123 | | - 'filter', |
124 | | - 'modified', |
125 | | - 'mw-allmessages-form-filter-modified', |
126 | | - ( $this->filter == 'modified' ) |
127 | | - ) . |
128 | | - "</td>\n |
129 | | - </tr> |
130 | | - <tr>\n |
131 | | - <td class=\"mw-label\">" . |
132 | | - Xml::label( wfMsg( 'allmessages-language' ), 'mw-allmessages-form-lang' ) . |
133 | | - "</td>\n |
134 | | - <td class=\"mw-input\">" . |
135 | | - Xml::openElement( 'select', array( 'id' => 'mw-allmessages-form-lang', 'name' => 'lang' ) ); |
136 | 87 | |
137 | | - foreach( $languages as $lang => $name ) { |
138 | | - $selected = $lang == $this->langCode; |
139 | | - $out .= Xml::option( $lang . ' - ' . $name, $lang, $selected ) . "\n"; |
140 | | - } |
141 | | - $out .= Xml::closeElement( 'select' ) . |
142 | | - "</td>\n |
143 | | - </tr> |
144 | | - <tr>\n |
145 | | - <td></td> |
146 | | - <td>" . |
147 | | - Xml::submitButton( wfMsg( 'allmessages-filter-submit' ) ) . |
148 | | - "</td>\n |
149 | | - </tr>" . |
150 | | - Xml::closeElement( 'table' ) . |
151 | | - $this->table->getHiddenFields( array( 'title', 'prefix', 'filter', 'lang' ) ) . |
152 | | - Xml::closeElement( 'fieldset' ) . |
153 | | - Xml::closeElement( 'form' ); |
154 | | - return $out; |
155 | | - } |
156 | | -} |
157 | | - |
158 | 88 | /** |
159 | 89 | * Use TablePager for prettified output. We have to pretend that we're |
160 | 90 | * getting data from a table when in fact not all of it comes from the database. |
161 | 91 | */ |
162 | 92 | class AllmessagesTablePager extends TablePager { |
163 | 93 | |
| 94 | + protected $filter, $prefix, $langCode; |
| 95 | + |
164 | 96 | public $mLimitsShown; |
165 | 97 | |
166 | 98 | /** |
— | — | @@ -217,6 +149,85 @@ |
218 | 150 | } |
219 | 151 | } |
220 | 152 | |
| 153 | + function buildForm() { |
| 154 | + global $wgScript; |
| 155 | + |
| 156 | + $languages = Language::getLanguageNames( false ); |
| 157 | + ksort( $languages ); |
| 158 | + |
| 159 | + $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) . |
| 160 | + Xml::fieldset( wfMsg( 'allmessages-filter-legend' ) ) . |
| 161 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
| 162 | + Xml::openElement( 'table', array( 'class' => 'mw-allmessages-table' ) ) . "\n" . |
| 163 | + '<tr> |
| 164 | + <td class="mw-label">' . |
| 165 | + Xml::label( wfMsg( 'allmessages-prefix' ), 'mw-allmessages-form-prefix' ) . |
| 166 | + "</td>\n |
| 167 | + <td class=\"mw-input\">" . |
| 168 | + Xml::input( 'prefix', 20, str_replace( '_', ' ', $this->prefix ), array( 'id' => 'mw-allmessages-form-prefix' ) ) . |
| 169 | + "</td>\n |
| 170 | + </tr> |
| 171 | + <tr>\n |
| 172 | + <td class='mw-label'>" . |
| 173 | + wfMsg( 'allmessages-filter' ) . |
| 174 | + "</td>\n |
| 175 | + <td class='mw-input'>" . |
| 176 | + Xml::radioLabel( wfMsg( 'allmessages-filter-unmodified' ), |
| 177 | + 'filter', |
| 178 | + 'unmodified', |
| 179 | + 'mw-allmessages-form-filter-unmodified', |
| 180 | + ( $this->filter == 'unmodified' ) |
| 181 | + ) . |
| 182 | + Xml::radioLabel( wfMsg( 'allmessages-filter-all' ), |
| 183 | + 'filter', |
| 184 | + 'all', |
| 185 | + 'mw-allmessages-form-filter-all', |
| 186 | + ( $this->filter == 'all' ) |
| 187 | + ) . |
| 188 | + Xml::radioLabel( wfMsg( 'allmessages-filter-modified' ), |
| 189 | + 'filter', |
| 190 | + 'modified', |
| 191 | + 'mw-allmessages-form-filter-modified', |
| 192 | + ( $this->filter == 'modified' ) |
| 193 | + ) . |
| 194 | + "</td>\n |
| 195 | + </tr> |
| 196 | + <tr>\n |
| 197 | + <td class=\"mw-label\">" . |
| 198 | + Xml::label( wfMsg( 'allmessages-language' ), 'mw-allmessages-form-lang' ) . |
| 199 | + "</td>\n |
| 200 | + <td class=\"mw-input\">" . |
| 201 | + Xml::openElement( 'select', array( 'id' => 'mw-allmessages-form-lang', 'name' => 'lang' ) ); |
| 202 | + |
| 203 | + foreach( $languages as $lang => $name ) { |
| 204 | + $selected = $lang == $this->langcode; |
| 205 | + $out .= Xml::option( $lang . ' - ' . $name, $lang, $selected ) . "\n"; |
| 206 | + } |
| 207 | + $out .= Xml::closeElement( 'select' ) . |
| 208 | + "</td>\n |
| 209 | + </tr>" . |
| 210 | + |
| 211 | + '<tr> |
| 212 | + <td class="mw-label">' . |
| 213 | + Xml::label( wfMsg( 'table_pager_limit_label'), 'mw-table_pager_limit_label' ) . |
| 214 | + '</td> |
| 215 | + <td class="mw-input">' . |
| 216 | + $this->getLimitSelect() . |
| 217 | + '</td> |
| 218 | + <tr> |
| 219 | + <td></td> |
| 220 | + <td>' . |
| 221 | + Xml::submitButton( wfMsg( 'allmessages-filter-submit' ) ) . |
| 222 | + "</td>\n |
| 223 | + </tr>" . |
| 224 | + |
| 225 | + Xml::closeElement( 'table' ) . |
| 226 | + $this->getHiddenFields( array( 'title', 'prefix', 'filter', 'lang', 'limit' ) ) . |
| 227 | + Xml::closeElement( 'fieldset' ) . |
| 228 | + Xml::closeElement( 'form' ); |
| 229 | + return $out; |
| 230 | + } |
| 231 | + |
221 | 232 | function getAllMessages( $descending ) { |
222 | 233 | wfProfileIn( __METHOD__ ); |
223 | 234 | $messageNames = Language::getLocalisationCache()->getSubitemList( 'en', 'messages' ); |