<?php
+use MediaWiki\MediaWikiServices;
+
/**
* Implements Special:FileDuplicateSearch
*
'id' => 'filename',
'size' => 50,
'value' => $this->filename,
- 'cssclass' => 'mw-ui-input-inline'
],
];
$hiddenFields = [
'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().
function formatResult( $skin, $result ) {
global $wgContLang;
+ $linkRenderer = $this->getLinkRenderer();
$nt = $result->getTitle();
$text = $wgContLang->convert( $nt->getText() );
- $plink = Linker::link(
+ $plink = $linkRenderer->makeLink(
$nt,
- htmlspecialchars( $text )
+ $text
);
$userText = $result->getUser( 'text' );
// No prefix suggestion outside of file namespace
return [];
}
- $searchEngine = SearchEngine::create();
+ $searchEngine = MediaWikiServices::getInstance()->newSearchEngine();
$searchEngine->setLimitOffset( $limit, $offset );
// Autocomplete subpage the same as a normal search, but just for files
$searchEngine->setNamespaces( [ NS_FILE ] );