MediaWiki  master
SpecialImport.php
Go to the documentation of this file.
1 <?php
29 
35 class SpecialImport extends SpecialPage {
36  private $sourceName = false;
37  private $interwiki = false;
38  private $subproject;
40  private $mapping = 'default';
41  private $namespace;
42  private $rootpage = '';
43  private $frompage = '';
44  private $logcomment = false;
45  private $history = true;
46  private $includeTemplates = false;
47  private $pageLinkDepth;
48 
50  private $importSources;
52  private $usernamePrefix;
53 
57  private $permManager;
58 
59  public function __construct() {
60  parent::__construct( 'Import', 'import' );
61  $this->permManager = MediaWikiServices::getInstance()->getPermissionManager();
62  }
63 
64  public function doesWrites() {
65  return true;
66  }
67 
74  public function execute( $par ) {
76 
77  $this->setHeaders();
78  $this->outputHeader();
79 
80  $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
81 
82  $this->getOutput()->addModules( 'mediawiki.special.import' );
83 
84  $this->importSources = $this->getConfig()->get( 'ImportSources' );
85  // Avoid phan error by checking the type
86  if ( !is_array( $this->importSources ) ) {
87  throw new UnexpectedValueException( '$wgImportSources must be an array' );
88  }
89  $this->getHookRunner()->onImportSources( $this->importSources );
90 
91  $user = $this->getUser();
92  if ( !$this->permManager->userHasAnyRight( $user, 'import', 'importupload' ) ) {
93  throw new PermissionsError( 'import' );
94  }
95 
96  # @todo Allow PermissionManager::getPermissionErrors() to take an array
97  $errors = wfMergeErrorArrays(
98  $this->permManager->getPermissionErrors(
99  'import', $user, $this->getPageTitle(),
100  PermissionManager::RIGOR_FULL,
101  [ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
102  ),
103  $this->permManager->getPermissionErrors(
104  'importupload', $user, $this->getPageTitle(),
105  PermissionManager::RIGOR_FULL,
106  [ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
107  )
108  );
109 
110  if ( $errors ) {
111  throw new PermissionsError( 'import', $errors );
112  }
113 
114  $this->checkReadOnly();
115 
116  $request = $this->getRequest();
117  if ( $request->wasPosted() && $request->getVal( 'action' ) == 'submit' ) {
118  $this->doImport();
119  }
120  $this->showForm();
121  }
122 
126  private function doImport() {
127  $isUpload = false;
128  $request = $this->getRequest();
129  $this->sourceName = $request->getVal( "source" );
130  $this->assignKnownUsers = $request->getCheck( 'assignKnownUsers' );
131 
132  $this->logcomment = $request->getText( 'log-comment' );
133  $this->pageLinkDepth = $this->getConfig()->get( 'ExportMaxLinkDepth' ) == 0
134  ? 0
135  : $request->getIntOrNull( 'pagelink-depth' );
136 
137  $this->mapping = $request->getVal( 'mapping' );
138  if ( $this->mapping === 'namespace' ) {
139  $this->namespace = $request->getIntOrNull( 'namespace' );
140  } elseif ( $this->mapping === 'subpage' ) {
141  $this->rootpage = $request->getText( 'rootpage' );
142  } else {
143  $this->mapping = 'default';
144  }
145 
146  $user = $this->getUser();
147  if ( !$user->matchEditToken( $request->getVal( 'editToken' ) ) ) {
148  $source = Status::newFatal( 'import-token-mismatch' );
149  } elseif ( $this->sourceName === 'upload' ) {
150  $isUpload = true;
151  $this->usernamePrefix = $this->fullInterwikiPrefix = $request->getVal( 'usernamePrefix' );
152  if ( $this->permManager->userHasRight( $user, 'importupload' ) ) {
154  } else {
155  throw new PermissionsError( 'importupload' );
156  }
157  } elseif ( $this->sourceName === 'interwiki' ) {
158  if ( !$this->permManager->userHasRight( $user, 'import' ) ) {
159  throw new PermissionsError( 'import' );
160  }
161  $this->interwiki = $this->fullInterwikiPrefix = $request->getVal( 'interwiki' );
162  // does this interwiki have subprojects?
163  $hasSubprojects = array_key_exists( $this->interwiki, $this->importSources );
164  if ( !$hasSubprojects && !in_array( $this->interwiki, $this->importSources ) ) {
165  $source = Status::newFatal( "import-invalid-interwiki" );
166  } else {
167  if ( $hasSubprojects ) {
168  $this->subproject = $request->getVal( 'subproject' );
169  $this->fullInterwikiPrefix .= ':' . $request->getVal( 'subproject' );
170  }
171  if ( $hasSubprojects &&
172  !in_array( $this->subproject, $this->importSources[$this->interwiki] )
173  ) {
174  $source = Status::newFatal( "import-invalid-interwiki" );
175  } else {
176  $this->history = $request->getCheck( 'interwikiHistory' );
177  $this->frompage = $request->getText( "frompage" );
178  $this->includeTemplates = $request->getCheck( 'interwikiTemplates' );
180  $this->fullInterwikiPrefix,
181  $this->frompage,
182  $this->history,
183  $this->includeTemplates,
184  $this->pageLinkDepth );
185  }
186  }
187  } else {
188  $source = Status::newFatal( "importunknownsource" );
189  }
190 
191  if ( (string)$this->fullInterwikiPrefix === '' ) {
192  $source->fatal( 'importnoprefix' );
193  }
194 
195  $out = $this->getOutput();
196  if ( !$source->isGood() ) {
197  $out->wrapWikiTextAsInterface( 'error',
198  $this->msg( 'importfailed', $source->getWikiText( false, false, $this->getLanguage() ) )
199  ->plain()
200  );
201  } else {
202  $importer = new WikiImporter( $source->value, $this->getConfig() );
203  if ( $this->namespace !== null ) {
204  $importer->setTargetNamespace( $this->namespace );
205  } elseif ( $this->rootpage !== null ) {
206  $statusRootPage = $importer->setTargetRootPage( $this->rootpage );
207  if ( !$statusRootPage->isGood() ) {
208  $out->wrapWikiMsg(
209  "<div class=\"error\">\n$1\n</div>",
210  [
211  'import-options-wrong',
212  $statusRootPage->getWikiText( false, false, $this->getLanguage() ),
213  count( $statusRootPage->getErrorsArray() )
214  ]
215  );
216 
217  return;
218  }
219  }
220  $importer->setUsernamePrefix( $this->fullInterwikiPrefix, $this->assignKnownUsers );
221 
222  $out->addWikiMsg( "importstart" );
223 
224  $reporter = new ImportReporter(
225  $importer,
226  $isUpload,
227  $this->fullInterwikiPrefix,
228  $this->logcomment
229  );
230  $reporter->setContext( $this->getContext() );
231  $exception = false;
232 
233  $reporter->open();
234  try {
235  $importer->doImport();
236  } catch ( Exception $e ) {
237  $exception = $e;
238  }
239  $result = $reporter->close();
240 
241  if ( $exception ) {
242  # No source or XML parse error
243  $out->wrapWikiMsg(
244  "<div class=\"error\">\n$1\n</div>",
245  [ 'importfailed', $exception->getMessage() ]
246  );
247  } elseif ( !$result->isGood() ) {
248  # Zero revisions
249  $out->wrapWikiMsg(
250  "<div class=\"error\">\n$1\n</div>",
251  [ 'importfailed', $result->getWikiText( false, false, $this->getLanguage() ) ]
252  );
253  } else {
254  # Success!
255  $out->addWikiMsg( 'importsuccess' );
256  }
257  $out->addHTML( '<hr />' );
258  }
259  }
260 
261  private function getMappingFormPart( $sourceName ) {
262  $isSameSourceAsBefore = ( $this->sourceName === $sourceName );
263  $defaultNamespace = $this->getConfig()->get( 'ImportTargetNamespace' );
264  return "<tr>
265  <td>
266  </td>
267  <td class='mw-input'>" .
269  $this->msg( 'import-mapping-default' )->text(),
270  'mapping',
271  'default',
272  // mw-import-mapping-interwiki-default, mw-import-mapping-upload-default
273  "mw-import-mapping-$sourceName-default",
274  ( $isSameSourceAsBefore ?
275  ( $this->mapping === 'default' ) :
276  $defaultNamespace === null )
277  ) .
278  "</td>
279  </tr>
280  <tr>
281  <td>
282  </td>
283  <td class='mw-input'>" .
285  $this->msg( 'import-mapping-namespace' )->text(),
286  'mapping',
287  'namespace',
288  // mw-import-mapping-interwiki-namespace, mw-import-mapping-upload-namespace
289  "mw-import-mapping-$sourceName-namespace",
290  ( $isSameSourceAsBefore ?
291  ( $this->mapping === 'namespace' ) :
292  $defaultNamespace !== null )
293  ) . ' ' .
295  [
296  'selected' => ( $isSameSourceAsBefore ?
297  $this->namespace :
298  ( $defaultNamespace || '' ) ),
299  'in-user-lang' => true,
300  ], [
301  'name' => "namespace",
302  // mw-import-namespace-interwiki, mw-import-namespace-upload
303  'id' => "mw-import-namespace-$sourceName",
304  'class' => 'namespaceselector',
305  ]
306  ) .
307  "</td>
308  </tr>
309  <tr>
310  <td>
311  </td>
312  <td class='mw-input'>" .
314  $this->msg( 'import-mapping-subpage' )->text(),
315  'mapping',
316  'subpage',
317  // mw-import-mapping-interwiki-subpage, mw-import-mapping-upload-subpage
318  "mw-import-mapping-$sourceName-subpage",
319  ( $isSameSourceAsBefore ? ( $this->mapping === 'subpage' ) : '' )
320  ) . ' ' .
321  Xml::input( 'rootpage', 50,
322  ( $isSameSourceAsBefore ? $this->rootpage : '' ),
323  [
324  // Should be "mw-import-rootpage-...", but we keep this inaccurate
325  // ID for legacy reasons
326  // mw-interwiki-rootpage-interwiki, mw-interwiki-rootpage-upload
327  'id' => "mw-interwiki-rootpage-$sourceName",
328  'type' => 'text'
329  ]
330  ) . ' ' .
331  "</td>
332  </tr>";
333  }
334 
335  private function showForm() {
336  $action = $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] );
337  $user = $this->getUser();
338  $out = $this->getOutput();
339  $this->addHelpLink( 'https://meta.wikimedia.org/wiki/Special:MyLanguage/Help:Import', true );
340 
341  if ( $this->permManager->userHasRight( $user, 'importupload' ) ) {
342  $mappingSelection = $this->getMappingFormPart( 'upload' );
343  $out->addHTML(
344  Xml::fieldset( $this->msg( 'import-upload' )->text() ) .
346  'form',
347  [
348  'enctype' => 'multipart/form-data',
349  'method' => 'post',
350  'action' => $action,
351  'id' => 'mw-import-upload-form'
352  ]
353  ) .
354  $this->msg( 'importtext' )->parseAsBlock() .
355  Html::hidden( 'action', 'submit' ) .
356  Html::hidden( 'source', 'upload' ) .
357  Xml::openElement( 'table', [ 'id' => 'mw-import-table-upload' ] ) .
358  "<tr>
359  <td class='mw-label'>" .
360  Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) .
361  "</td>
362  <td class='mw-input'>" .
363  Html::input( 'xmlimport', '', 'file', [ 'id' => 'xmlimport' ] ) . ' ' .
364  "</td>
365  </tr>
366  <tr>
367  <td class='mw-label'>" .
368  Xml::label( $this->msg( 'import-upload-username-prefix' )->text(),
369  'mw-import-usernamePrefix' ) .
370  "</td>
371  <td class='mw-input'>" .
372  Xml::input( 'usernamePrefix', 50,
373  $this->usernamePrefix,
374  [ 'id' => 'usernamePrefix', 'type' => 'text' ] ) . ' ' .
375  "</td>
376  </tr>
377  <tr>
378  <td></td>
379  <td class='mw-input'>" .
381  $this->msg( 'import-assign-known-users' )->text(),
382  'assignKnownUsers',
383  'assignKnownUsers',
384  $this->assignKnownUsers
385  ) .
386  "</td>
387  </tr>
388  <tr>
389  <td class='mw-label'>" .
390  Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) .
391  "</td>
392  <td class='mw-input'>" .
393  Xml::input( 'log-comment', 50,
394  ( $this->sourceName === 'upload' ? $this->logcomment : '' ),
395  [ 'id' => 'mw-import-comment', 'type' => 'text' ] ) . ' ' .
396  "</td>
397  </tr>
398  $mappingSelection
399  <tr>
400  <td></td>
401  <td class='mw-submit'>" .
402  Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
403  "</td>
404  </tr>" .
405  Xml::closeElement( 'table' ) .
406  Html::hidden( 'editToken', $user->getEditToken() ) .
407  Xml::closeElement( 'form' ) .
408  Xml::closeElement( 'fieldset' )
409  );
410  } elseif ( empty( $this->importSources ) ) {
411  $out->addWikiMsg( 'importnosources' );
412  }
413 
414  if ( $this->permManager->userHasRight( $user, 'import' ) && !empty( $this->importSources ) ) {
415  # Show input field for import depth only if $wgExportMaxLinkDepth > 0
416  $importDepth = '';
417  if ( $this->getConfig()->get( 'ExportMaxLinkDepth' ) > 0 ) {
418  $importDepth = "<tr>
419  <td class='mw-label'>" .
420  $this->msg( 'export-pagelinks' )->parse() .
421  "</td>
422  <td class='mw-input'>" .
423  Xml::input( 'pagelink-depth', 3, 0 ) .
424  "</td>
425  </tr>";
426  }
427  $mappingSelection = $this->getMappingFormPart( 'interwiki' );
428 
429  $out->addHTML(
430  Xml::fieldset( $this->msg( 'importinterwiki' )->text() ) .
432  'form',
433  [
434  'method' => 'post',
435  'action' => $action,
436  'id' => 'mw-import-interwiki-form'
437  ]
438  ) .
439  $this->msg( 'import-interwiki-text' )->parseAsBlock() .
440  Html::hidden( 'action', 'submit' ) .
441  Html::hidden( 'source', 'interwiki' ) .
442  Html::hidden( 'editToken', $user->getEditToken() ) .
443  Xml::openElement( 'table', [ 'id' => 'mw-import-table-interwiki' ] ) .
444  "<tr>
445  <td class='mw-label'>" .
446  Xml::label( $this->msg( 'import-interwiki-sourcewiki' )->text(), 'interwiki' ) .
447  "</td>
448  <td class='mw-input'>" .
450  'select',
451  [ 'name' => 'interwiki', 'id' => 'interwiki' ]
452  )
453  );
454 
455  $needSubprojectField = false;
456  foreach ( $this->importSources as $key => $value ) {
457  if ( is_int( $key ) ) {
458  $key = $value;
459  } elseif ( $value !== $key ) {
460  $needSubprojectField = true;
461  }
462 
463  $attribs = [
464  'value' => $key,
465  ];
466  if ( is_array( $value ) ) {
467  $attribs['data-subprojects'] = implode( ' ', $value );
468  }
469  if ( $this->interwiki === $key ) {
470  $attribs['selected'] = 'selected';
471  }
472  $out->addHTML( Html::element( 'option', $attribs, $key ) );
473  }
474 
475  $out->addHTML(
476  Xml::closeElement( 'select' )
477  );
478 
479  if ( $needSubprojectField ) {
480  $out->addHTML(
482  'select',
483  [ 'name' => 'subproject', 'id' => 'subproject' ]
484  )
485  );
486 
487  $subprojectsToAdd = [];
488  foreach ( $this->importSources as $key => $value ) {
489  if ( is_array( $value ) ) {
490  $subprojectsToAdd = array_merge( $subprojectsToAdd, $value );
491  }
492  }
493  $subprojectsToAdd = array_unique( $subprojectsToAdd );
494  sort( $subprojectsToAdd );
495  foreach ( $subprojectsToAdd as $subproject ) {
496  $out->addHTML( Xml::option( $subproject, $subproject, $this->subproject === $subproject ) );
497  }
498 
499  $out->addHTML(
500  Xml::closeElement( 'select' )
501  );
502  }
503 
504  $out->addHTML(
505  "</td>
506  </tr>
507  <tr>
508  <td class='mw-label'>" .
509  Xml::label( $this->msg( 'import-interwiki-sourcepage' )->text(), 'frompage' ) .
510  "</td>
511  <td class='mw-input'>" .
512  Xml::input( 'frompage', 50, $this->frompage, [ 'id' => 'frompage' ] ) .
513  "</td>
514  </tr>
515  <tr>
516  <td>
517  </td>
518  <td class='mw-input'>" .
520  $this->msg( 'import-interwiki-history' )->text(),
521  'interwikiHistory',
522  'interwikiHistory',
523  $this->history
524  ) .
525  "</td>
526  </tr>
527  <tr>
528  <td>
529  </td>
530  <td class='mw-input'>" .
532  $this->msg( 'import-interwiki-templates' )->text(),
533  'interwikiTemplates',
534  'interwikiTemplates',
535  $this->includeTemplates
536  ) .
537  "</td>
538  </tr>
539  <tr>
540  <td></td>
541  <td class='mw-input'>" .
543  $this->msg( 'import-assign-known-users' )->text(),
544  'assignKnownUsers',
545  'interwikiAssignKnownUsers',
546  $this->assignKnownUsers
547  ) .
548  "</td>
549  </tr>
550  $importDepth
551  <tr>
552  <td class='mw-label'>" .
553  Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) .
554  "</td>
555  <td class='mw-input'>" .
556  Xml::input( 'log-comment', 50,
557  ( $this->sourceName === 'interwiki' ? $this->logcomment : '' ),
558  [ 'id' => 'mw-interwiki-comment', 'type' => 'text' ] ) . ' ' .
559  "</td>
560  </tr>
561  $mappingSelection
562  <tr>
563  <td>
564  </td>
565  <td class='mw-submit'>" .
567  $this->msg( 'import-interwiki-submit' )->text(),
569  ) .
570  "</td>
571  </tr>" .
572  Xml::closeElement( 'table' ) .
573  Xml::closeElement( 'form' ) .
574  Xml::closeElement( 'fieldset' )
575  );
576  }
577  }
578 
579  protected function getGroupName() {
580  return 'pagetools';
581  }
582 }
SpecialImport\showForm
showForm()
Definition: SpecialImport.php:335
SpecialImport
MediaWiki page data importer.
Definition: SpecialImport.php:35
SpecialImport\$pageLinkDepth
$pageLinkDepth
Definition: SpecialImport.php:47
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:669
wfMergeErrorArrays
wfMergeErrorArrays(... $args)
Merge arrays in the style of PermissionManager::getPermissionErrors, with duplicate removal e....
Definition: GlobalFunctions.php:181
SpecialImport\$includeTemplates
$includeTemplates
Definition: SpecialImport.php:46
SpecialPage\msg
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:800
WikiImporter
XML file reader for the page data importer.
Definition: WikiImporter.php:36
StatusValue\newFatal
static newFatal( $message,... $parameters)
Factory function for fatal errors.
Definition: StatusValue.php:69
SpecialImport\$usernamePrefix
$usernamePrefix
Definition: SpecialImport.php:52
SpecialImport\$permManager
PermissionManager $permManager
Definition: SpecialImport.php:57
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:716
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:146
Xml\label
static label( $label, $id, $attribs=[])
Convenience function to build an HTML form label.
Definition: Xml.php:362
SpecialImport\$importSources
array $importSources
Definition: SpecialImport.php:50
SpecialImport\$fullInterwikiPrefix
$fullInterwikiPrefix
Definition: SpecialImport.php:39
Xml\option
static option( $text, $value=null, $selected=false, $attribs=[])
Convenience function to build an HTML drop-down list item.
Definition: Xml.php:488
SpecialPage\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition: SpecialPage.php:902
PermissionsError
Show an error when a user tries to do something they do not have the necessary permissions for.
Definition: PermissionsError.php:30
ImportReporter
Reporting callback.
Definition: ImportReporter.php:28
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:108
SpecialImport\$namespace
$namespace
Definition: SpecialImport.php:41
Linker\tooltipAndAccesskeyAttribs
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[], $options=null)
Returns the attributes for the tooltip and access key.
Definition: Linker.php:2295
Html\input
static input( $name, $value='', $type='text', array $attribs=[])
Convenience function to produce an "<input>" element.
Definition: Html.php:667
Xml\fieldset
static fieldset( $legend=false, $content=false, $attribs=[])
Shortcut for creating fieldsets.
Definition: Xml.php:613
SpecialImport\$subproject
$subproject
Definition: SpecialImport.php:38
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:836
SpecialImport\execute
execute( $par)
Execute.
Definition: SpecialImport.php:74
SpecialImport\doImport
doImport()
Do the actual import.
Definition: SpecialImport.php:126
SpecialPage\getHookRunner
getHookRunner()
Definition: SpecialPage.php:974
SpecialPage\getConfig
getConfig()
Shortcut to get main config object.
Definition: SpecialPage.php:766
SpecialImport\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialImport.php:579
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:551
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:726
SpecialImport\doesWrites
doesWrites()
Indicates whether this special page may perform database writes.
Definition: SpecialImport.php:64
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:689
ImportStreamSource\newFromInterwiki
static newFromInterwiki( $interwiki, $page, $history=false, $templates=false, $pageLinkDepth=0)
Definition: ImportStreamSource.php:149
SpecialImport\$interwiki
$interwiki
Definition: SpecialImport.php:37
Html\hidden
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
Definition: Html.php:802
SpecialImport\$frompage
$frompage
Definition: SpecialImport.php:43
MediaWiki\Permissions\PermissionManager
A service class for checking permissions To obtain an instance, use MediaWikiServices::getInstance()-...
Definition: PermissionManager.php:49
Html\namespaceSelector
static namespaceSelector(array $params=[], array $selectAttribs=[])
Build a drop-down box for selecting a namespace.
Definition: Html.php:894
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:39
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:706
SpecialImport\$logcomment
$logcomment
Definition: SpecialImport.php:44
Xml\radioLabel
static radioLabel( $label, $name, $value, $id, $checked=false, $attribs=[])
Convenience function to build an HTML radio button with a label.
Definition: Xml.php:448
Xml\closeElement
static closeElement( $element)
Shortcut to close an XML element.
Definition: Xml.php:117
SpecialImport\$sourceName
$sourceName
Definition: SpecialImport.php:36
SpecialImport\__construct
__construct()
Definition: SpecialImport.php:59
$source
$source
Definition: mwdoc-filter.php:34
SpecialImport\$mapping
$mapping
Definition: SpecialImport.php:40
Xml\input
static input( $name, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field.
Definition: Xml.php:278
SpecialImport\$assignKnownUsers
$assignKnownUsers
Definition: SpecialImport.php:51
SpecialPage\checkReadOnly
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
Definition: SpecialPage.php:341
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:231
SpecialImport\$rootpage
$rootpage
Definition: SpecialImport.php:42
SpecialImport\$history
$history
Definition: SpecialImport.php:45
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:636
ImportStreamSource\newFromUpload
static newFromUpload( $fieldname="xmlimport")
Definition: ImportStreamSource.php:75
Xml\submitButton
static submitButton( $value, $attribs=[])
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will ...
Definition: Xml.php:463
Xml\checkLabel
static checkLabel( $label, $name, $id, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox with a label.
Definition: Xml.php:423
SpecialImport\getMappingFormPart
getMappingFormPart( $sourceName)
Definition: SpecialImport.php:261