X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialImport.php;h=2a3ab6450fcd143d4704c703729824678bbf76c8;hb=f4d6ccddc13dafa86f31dca0050cd7af7b76f0c1;hp=28e6479474874c1c82c47e4e4d5ed7577c87ffef;hpb=4a4c24208517904e9e5aca123bc494f41960c448;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 28e6479474..2a3ab6450f 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -44,12 +44,12 @@ class SpecialImport extends SpecialPage { */ public function __construct() { parent::__construct( 'Import', 'import' ); - global $wgImportTargetNamespace; - $this->namespace = $wgImportTargetNamespace; + $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' ); } /** * Execute + * @param string|null $par */ function execute( $par ) { $this->setHeaders(); @@ -91,15 +91,13 @@ class SpecialImport extends SpecialPage { * Do the actual import */ private function doImport() { - global $wgImportSources, $wgExportMaxLinkDepth; - $isUpload = false; $request = $this->getRequest(); $this->namespace = $request->getIntOrNull( 'namespace' ); $sourceName = $request->getVal( "source" ); $this->logcomment = $request->getText( 'log-comment' ); - $this->pageLinkDepth = $wgExportMaxLinkDepth == 0 + $this->pageLinkDepth = $this->getConfig()->get( 'ExportMaxLinkDepth' ) == 0 ? 0 : $request->getIntOrNull( 'pagelink-depth' ); $this->rootpage = $request->getText( 'rootpage' ); @@ -119,7 +117,7 @@ class SpecialImport extends SpecialPage { throw new PermissionsError( 'import' ); } $this->interwiki = $request->getVal( 'interwiki' ); - if ( !in_array( $this->interwiki, $wgImportSources ) ) { + if ( !in_array( $this->interwiki, $this->getConfig()->get( 'ImportSources' ) ) ) { $source = Status::newFatal( "import-invalid-interwiki" ); } else { $this->history = $request->getCheck( 'interwikiHistory' ); @@ -203,11 +201,10 @@ class SpecialImport extends SpecialPage { } private function showForm() { - global $wgImportSources, $wgExportMaxLinkDepth; - $action = $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) ); $user = $this->getUser(); $out = $this->getOutput(); + $importSources = $this->getConfig()->get( 'ImportSources' ); if ( $user->isAllowed( 'importupload' ) ) { $out->addHTML( @@ -266,15 +263,15 @@ class SpecialImport extends SpecialPage { Xml::closeElement( 'fieldset' ) ); } else { - if ( empty( $wgImportSources ) ) { + if ( empty( $importSources ) ) { $out->addWikiMsg( 'importnosources' ); } } - if ( $user->isAllowed( 'import' ) && !empty( $wgImportSources ) ) { + if ( $user->isAllowed( 'import' ) && !empty( $importSources ) ) { # Show input field for import depth only if $wgExportMaxLinkDepth > 0 $importDepth = ''; - if ( $wgExportMaxLinkDepth > 0 ) { + if ( $this->getConfig()->get( 'ExportMaxLinkDepth' ) > 0 ) { $importDepth = " " . $this->msg( 'export-pagelinks' )->parse() . @@ -311,7 +308,7 @@ class SpecialImport extends SpecialPage { ) ); - foreach ( $wgImportSources as $prefix ) { + foreach ( $importSources as $prefix ) { $selected = ( $this->interwiki === $prefix ) ? ' selected="selected"' : ''; $out->addHTML( Xml::option( $prefix, $prefix, $selected ) ); }