Index: trunk/phase3/includes/specials/SpecialImport.php |
— | — | @@ -66,13 +66,13 @@ |
67 | 67 | * Do the actual import |
68 | 68 | */ |
69 | 69 | private function doImport() { |
70 | | - global $wgOut, $wgRequest, $wgUser, $wgImportSources; |
| 70 | + global $wgOut, $wgRequest, $wgUser, $wgImportSources, $wgExportMaxLinkDepth; |
71 | 71 | $isUpload = false; |
72 | 72 | $this->namespace = $wgRequest->getIntOrNull( 'namespace' ); |
73 | 73 | $sourceName = $wgRequest->getVal( "source" ); |
74 | 74 | |
75 | 75 | $this->logcomment = $wgRequest->getText( 'log-comment' ); |
76 | | - $this->pageLinkDepth = $wgRequest->getIntOrNull( 'pagelink-depth' ); |
| 76 | + $this->pageLinkDepth = $wgExportMaxLinkDepth == 0 ? 0 : $wgRequest->getIntOrNull( 'pagelink-depth' ); |
77 | 77 | |
78 | 78 | if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'editToken' ) ) ) { |
79 | 79 | $source = new WikiErrorMsg( 'import-token-mismatch' ); |
— | — | @@ -132,9 +132,7 @@ |
133 | 133 | } |
134 | 134 | |
135 | 135 | private function showForm() { |
136 | | - global $wgUser, $wgOut, $wgRequest, $wgTitle, $wgImportSources; |
137 | | - # FIXME: Quick hack to disable import for non privileged users /Raymond |
138 | | - # Regression from 43963 |
| 136 | + global $wgUser, $wgOut, $wgRequest, $wgTitle, $wgImportSources, $wgExportMaxLinkDepth; |
139 | 137 | if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) ) |
140 | 138 | return $wgOut->permissionRequired( 'import' ); |
141 | 139 | |
— | — | @@ -143,9 +141,9 @@ |
144 | 142 | if( $wgUser->isAllowed( 'importupload' ) ) { |
145 | 143 | $wgOut->addWikiMsg( "importtext" ); |
146 | 144 | $wgOut->addHTML( |
147 | | - Xml::openElement( 'fieldset' ). |
148 | | - Xml::element( 'legend', null, wfMsg( 'import-upload' ) ) . |
149 | | - Xml::openElement( 'form', array( 'enctype' => 'multipart/form-data', 'method' => 'post', 'action' => $action ) ) . |
| 145 | + Xml::fieldset( wfMsg( 'import-upload' ) ). |
| 146 | + Xml::openElement( 'form', array( 'enctype' => 'multipart/form-data', 'method' => 'post', |
| 147 | + 'action' => $action, 'id' => 'mw-import-upload-form' ) ) . |
150 | 148 | Xml::hidden( 'action', 'submit' ) . |
151 | 149 | Xml::hidden( 'source', 'upload' ) . |
152 | 150 | Xml::openElement( 'table', array( 'id' => 'mw-import-table' ) ) . |
— | — | @@ -169,7 +167,7 @@ |
170 | 168 | </tr> |
171 | 169 | <tr> |
172 | 170 | <td></td> |
173 | | - <td class='mw-input'>" . |
| 171 | + <td class='mw-submit'>" . |
174 | 172 | Xml::submitButton( wfMsg( 'uploadbtn' ) ) . |
175 | 173 | "</td> |
176 | 174 | </tr>" . |
— | — | @@ -185,10 +183,22 @@ |
186 | 184 | } |
187 | 185 | |
188 | 186 | if( $wgUser->isAllowed( 'import' ) && !empty( $wgImportSources ) ) { |
| 187 | + # Show input field for import depth only if $wgExportMaxLinkDepth > 0 |
| 188 | + $importDepth = ''; |
| 189 | + if( $wgExportMaxLinkDepth > 0 ) { |
| 190 | + $importDepth = "<tr> |
| 191 | + <td class='mw-label'>" . |
| 192 | + wfMsgExt( 'export-pagelinks', 'parseinline' ) . |
| 193 | + "</td> |
| 194 | + <td class='mw-input'>" . |
| 195 | + Xml::input( 'pagelink-depth', 3, 0 ) . |
| 196 | + "</td> |
| 197 | + </tr>"; |
| 198 | + } |
| 199 | + |
189 | 200 | $wgOut->addHTML( |
190 | | - Xml::openElement( 'fieldset' ) . |
191 | | - Xml::element( 'legend', null, wfMsg( 'importinterwiki' ) ) . |
192 | | - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action ) ) . |
| 201 | + Xml::fieldset( wfMsg( 'importinterwiki' ) ) . |
| 202 | + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form' ) ) . |
193 | 203 | wfMsgExt( 'import-interwiki-text', array( 'parse' ) ) . |
194 | 204 | Xml::hidden( 'action', 'submit' ) . |
195 | 205 | Xml::hidden( 'source', 'interwiki' ) . |
— | — | @@ -205,6 +215,7 @@ |
206 | 216 | $selected = ( $this->interwiki === $prefix ) ? ' selected="selected"' : ''; |
207 | 217 | $wgOut->addHTML( Xml::option( $prefix, $prefix, $selected ) ); |
208 | 218 | } |
| 219 | + |
209 | 220 | $wgOut->addHTML( |
210 | 221 | Xml::closeElement( 'select' ) . |
211 | 222 | Xml::input( 'frompage', 50, $this->frompage ) . |
— | — | @@ -224,12 +235,9 @@ |
225 | 236 | Xml::checkLabel( wfMsg( 'import-interwiki-templates' ), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates ) . |
226 | 237 | "</td> |
227 | 238 | </tr> |
| 239 | + $importDepth |
228 | 240 | <tr> |
229 | | - <td>".wfMsgExt( 'export-pagelinks', 'parseinline' )."</td> |
230 | | - <td class=\"mw-input\">" . Xml::input( 'pagelink-depth', 20, 0 ) . "<br/> |
231 | | - </tr> |
232 | | - <tr> |
233 | | - <td>" . |
| 241 | + <td class='mw-label'>" . |
234 | 242 | Xml::label( wfMsg( 'import-interwiki-namespace' ), 'namespace' ) . |
235 | 243 | "</td> |
236 | 244 | <td class='mw-input'>" . |
— | — | @@ -248,7 +256,7 @@ |
249 | 257 | <tr> |
250 | 258 | <td> |
251 | 259 | </td> |
252 | | - <td class='mw-input'>" . |
| 260 | + <td class='mw-submit'>" . |
253 | 261 | Xml::submitButton( wfMsg( 'import-interwiki-submit' ), array( 'accesskey' => 's' ) ) . |
254 | 262 | "</td> |
255 | 263 | </tr>" . |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -230,6 +230,8 @@ |
231 | 231 | * (bug 17502) meta=siteinfo&siprop=namespacealiases no longer lists namespace |
232 | 232 | aliases already listed in siprop=namespaces |
233 | 233 | * (bug 17529) rvend ignored when rvstartid is specified |
| 234 | +* Special:Import: Do not show input field for import depth if |
| 235 | + $wgExportMaxLinkDepth == 0 |
234 | 236 | |
235 | 237 | === Languages updated in 1.15 === |
236 | 238 | |