<?php
+use MediaWiki\MediaWikiServices;
+
/**
* Implements Special:FileDuplicateSearch
*
}
$html[] = $this->closeList();
- $this->getOutput()->addHtml( implode( "\n", $html ) );
+ $this->getOutput()->addHTML( implode( "\n", $html ) );
}
public function getQueryInfo() {
'id' => 'filename',
'size' => 50,
'value' => $this->filename,
- 'cssclass' => 'mw-ui-input-inline'
],
];
$hiddenFields = [
- 'title' => $this->getPageTitle()->getPrefixedDBKey(),
+ 'title' => $this->getPageTitle()->getPrefixedDBkey(),
];
- $htmlForm = HTMLForm::factory( 'inline', $formFields, $this->getContext() );
+ $htmlForm = HTMLForm::factory( 'ooui', $formFields, $this->getContext() );
$htmlForm->addHiddenFields( $hiddenFields );
$htmlForm->setAction( wfScript() );
$htmlForm->setMethod( 'get' );
$htmlForm->setSubmitProgressive();
$htmlForm->setSubmitTextMsg( $this->msg( 'fileduplicatesearch-submit' ) );
- $htmlForm->setWrapperLegendMsg( 'fileduplicatesearch-legend' );
// The form should be visible always, even if it was submitted (e.g. to perform another action).
// To bypass the callback validation of HTMLForm, use prepareForm() and displayForm().
// No prefix suggestion outside of file namespace
return [];
}
- $search = SearchEngine::create();
- $search->setLimitOffset( $limit, $offset );
+ $searchEngine = MediaWikiServices::getInstance()->newSearchEngine();
+ $searchEngine->setLimitOffset( $limit, $offset );
// Autocomplete subpage the same as a normal search, but just for files
- $search->setNamespaces( [ NS_FILE ] );
- $result = $search->defaultPrefixSearch( $search );
+ $searchEngine->setNamespaces( [ NS_FILE ] );
+ $result = $searchEngine->defaultPrefixSearch( $search );
return array_map( function ( Title $t ) {
// Remove namespace in search suggestion