private $interwiki = false;
private $namespace;
+ private $rootpage = '';
private $frompage = '';
private $logcomment= false;
private $history = true;
$this->logcomment = $request->getText( 'log-comment' );
$this->pageLinkDepth = $wgExportMaxLinkDepth == 0 ? 0 : $request->getIntOrNull( 'pagelink-depth' );
+ $this->rootpage = $request->getText( 'rootpage' );\r
$user = $this->getUser();
if ( !$user->matchEditToken( $request->getVal( 'editToken' ) ) ) {
if( !$source->isGood() ) {
$out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'importfailed', $source->getWikiText() ) );
} else {
- $out->addWikiMsg( "importstart" );
-
$importer = new WikiImporter( $source->value );
if( !is_null( $this->namespace ) ) {
$importer->setTargetNamespace( $this->namespace );
}
+ if( !is_null( $this->rootpage ) ) {
+ $statusRootPage = $importer->setTargetRootPage( $this->rootpage );
+ if( !$statusRootPage->isGood() ) {
+ $out->wrapWikiMsg( "<p class=\"error\">\n$1\n</p>", array( 'import-options-wrong', $statusRootPage->getWikiText(), count( $statusRootPage->getErrorsArray() ) ) );
+ return;
+ }
+ }
+
+ $out->addWikiMsg( "importstart" );
+
$reporter = new ImportReporter( $importer, $isUpload, $this->interwiki , $this->logcomment);
$reporter->setContext( $this->getContext() );
$exception = false;
array( 'id' => 'mw-import-comment', 'type' => 'text' ) ) . ' ' .
"</td>
</tr>
+ <tr>
+ <td class='mw-label'>" .
+ Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage' ) .
+ "</td>
+ <td class='mw-input'>" .
+ Xml::input( 'rootpage', 50, $this->rootpage,
+ array( 'id' => 'mw-interwiki-rootpage', 'type' => 'text' ) ) . ' ' .
+ "</td>
+ </tr>
<tr>
<td></td>
<td class='mw-submit'>" .
array( 'id' => 'mw-interwiki-comment', 'type' => 'text' ) ) . ' ' .
"</td>
</tr>
+ <tr>
+ <td class='mw-label'>" .
+ Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage' ) .
+ "</td>
+ <td class='mw-input'>" .
+ Xml::input( 'rootpage', 50, $this->rootpage,
+ array( 'id' => 'mw-interwiki-rootpage', 'type' => 'text' ) ) . ' ' .
+ "</td>
+ </tr>
<tr>
<td>
</td>