Index: trunk/phase3/includes/SpecialNewpages.php |
— | — | @@ -138,19 +138,28 @@ |
139 | 139 | * @return string |
140 | 140 | */ |
141 | 141 | function getPageHeader() { |
142 | | - global $wgScript; |
| 142 | + global $wgScript, $wgContLang; |
| 143 | + $align = $wgContLang->isRTL() ? 'left' : 'right'; |
143 | 144 | $self = SpecialPage::getTitleFor( $this->getName() ); |
144 | | - $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
145 | | - $form .= Xml::hidden( 'title', $self->getPrefixedDBkey() ); |
146 | | - # Namespace selector |
147 | | - $form .= '<table><tr><td align="right">' . Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '</td>'; |
148 | | - $form .= '<td>' . Xml::namespaceSelector( $this->namespace, 'all' ) . '</td></tr>'; |
149 | | - # Username filter |
150 | | - $form .= '<tr><td align="right">' . Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) . '</td>'; |
151 | | - $form .= '<td>' . Xml::input( 'username', 30, $this->username, array( 'id' => 'mw-np-username' ) ) . '</td></tr>'; |
152 | | - |
153 | | - $form .= '<tr><td></td><td>' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . '</td></tr></table>'; |
154 | | - $form .= Xml::hidden( 'offset', $this->offset ) . Xml::hidden( 'limit', $this->limit ) . '</form>'; |
| 145 | + $form = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . |
| 146 | + Xml::hidden( 'title', $self->getPrefixedDBkey() ) . |
| 147 | + Xml::openElement( 'table' ) . |
| 148 | + "<tr> |
| 149 | + <td align=\"$align\">" . Xml::label( wfMsg( 'namespace' ), 'namespace' ) . "</td> |
| 150 | + <td>" . Xml::namespaceSelector( intval( $this->namespace ), 'all' ) . "</td> |
| 151 | + </tr> |
| 152 | + <tr> |
| 153 | + <td align=\"$align\">" . Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) . "</td> |
| 154 | + <td>" . Xml::input( 'username', 30, $this->username, array( 'id' => 'mw-np-username' ) ) . "</td> |
| 155 | + </tr> |
| 156 | + <tr> |
| 157 | + <td></td> |
| 158 | + <td>" . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "</td> |
| 159 | + </tr>" . |
| 160 | + Xml::closeElement( 'table' ) . |
| 161 | + Xml::hidden( 'offset', $this->offset ) . |
| 162 | + Xml::hidden( 'limit', $this->limit ) . |
| 163 | + Xml::closeElement( 'form' ); |
155 | 164 | return $form; |
156 | 165 | } |
157 | 166 | |
— | — | @@ -168,7 +177,7 @@ |
169 | 178 | /** |
170 | 179 | * constructor |
171 | 180 | */ |
172 | | -function wfSpecialNewpages($par, $specialPage) { |
| 181 | +function wfSpecialNewpages( $par, $specialPage ) { |
173 | 182 | global $wgRequest, $wgContLang; |
174 | 183 | |
175 | 184 | list( $limit, $offset ) = wfCheckLimits(); |
— | — | @@ -176,32 +185,13 @@ |
177 | 186 | $username = ''; |
178 | 187 | |
179 | 188 | if ( $par ) { |
180 | | - $bits = preg_split( '/\s*,\s*/', trim( $par ) ); |
181 | | - foreach ( $bits as $bit ) { |
182 | | - if ( 'shownav' == $bit ) |
183 | | - $shownavigation = true; |
184 | | - if ( is_numeric( $bit ) ) |
185 | | - $limit = $bit; |
186 | | - |
187 | | - $m = array(); |
188 | | - if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) |
189 | | - $limit = intval($m[1]); |
190 | | - if ( preg_match( '/^offset=(\d+)$/', $bit, $m ) ) |
191 | | - $offset = intval($m[1]); |
192 | | - if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) { |
193 | | - $ns = $wgContLang->getNsIndex( $m[1] ); |
194 | | - if( $ns !== false ) { |
195 | | - $namespace = $ns; |
196 | | - } |
197 | | - } |
198 | | - } |
| 189 | + $namespace = $wgContLang->getNsIndex( $par ); |
199 | 190 | } else { |
200 | 191 | if( $ns = $wgRequest->getText( 'namespace', NS_MAIN ) ) |
201 | 192 | $namespace = $ns; |
202 | | - if( $un = $wgRequest->getText( 'username' ) ) |
203 | | - $username = $un; |
204 | 193 | } |
205 | | - |
| 194 | + if( $un = $wgRequest->getText( 'username' ) ) |
| 195 | + $username = $un; |
206 | 196 | if ( ! isset( $shownavigation ) ) |
207 | 197 | $shownavigation = ! $specialPage->including(); |
208 | 198 | |
— | — | @@ -209,4 +199,4 @@ |
210 | 200 | |
211 | 201 | if ( ! $npp->doFeed( $wgRequest->getVal( 'feed' ), $limit ) ) |
212 | 202 | $npp->doQuery( $offset, $limit, $shownavigation ); |
213 | | -} |
\ No newline at end of file |
| 203 | +} |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -67,6 +67,9 @@ |
68 | 68 | * (bug 11331) Add buildConcat() and use CASE not IF for DB compatibility. Make oldimage |
69 | 69 | cascade delete via image table for Postgres, change fa_storage_key TEXT. |
70 | 70 | * (bug 11438) Live Preview chops returned text |
| 71 | +* (bug 8376) Special:Newpages accepts namespace in subpage form |
| 72 | +* Make input form of Special:Newpages nicer for RTL wikis |
| 73 | +* Fix namespace selection after submit of Special:Newpages |
71 | 74 | |
72 | 75 | === API changes in 1.12 === |
73 | 76 | |