X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialFileDuplicateSearch.php;h=68960d3aad9ed7317001b70177ce62a984be1f81;hb=bbef4902f933c7221de83d76ead61b0ac44b5794;hp=9970dfa97116564d40b9bd3a43b9b4941f7a6a16;hpb=ca8aa5a6a621852f0a8ba58df7f2d9a73f4a6764;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 9970dfa971..68960d3aad 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -53,7 +53,7 @@ class FileDuplicateSearchPage extends QueryPage { } function linkParameters() { - return array( 'filename' => $this->filename ); + return [ 'filename' => $this->filename ]; } /** @@ -70,7 +70,7 @@ class FileDuplicateSearchPage extends QueryPage { * @param array $dupes Array of File objects */ function showList( $dupes ) { - $html = array(); + $html = []; $html[] = $this->openList( 0 ); foreach ( $dupes as $dupe ) { @@ -79,20 +79,20 @@ class FileDuplicateSearchPage extends QueryPage { } $html[] = $this->closeList(); - $this->getOutput()->addHtml( implode( "\n", $html ) ); + $this->getOutput()->addHTML( implode( "\n", $html ) ); } public function getQueryInfo() { - return array( - 'tables' => array( 'image' ), - 'fields' => array( + return [ + 'tables' => [ 'image' ], + 'fields' => [ 'title' => 'img_name', 'value' => 'img_sha1', 'img_user_text', 'img_timestamp' - ), - 'conds' => array( 'img_sha1' => $this->hash ) - ); + ], + 'conds' => [ 'img_sha1' => $this->hash ] + ]; } public function execute( $par ) { @@ -110,8 +110,8 @@ class FileDuplicateSearchPage extends QueryPage { $out = $this->getOutput(); # Create the input form - $formFields = array( - 'filename' => array( + $formFields = [ + 'filename' => [ 'type' => 'text', 'name' => 'filename', 'label-message' => 'fileduplicatesearch-filename', @@ -119,11 +119,11 @@ class FileDuplicateSearchPage extends QueryPage { 'size' => 50, 'value' => $this->filename, 'cssclass' => 'mw-ui-input-inline' - ), - ); - $hiddenFields = array( - 'title' => $this->getPageTitle()->getPrefixedDBKey(), - ); + ], + ]; + $hiddenFields = [ + 'title' => $this->getPageTitle()->getPrefixedDBkey(), + ]; $htmlForm = HTMLForm::factory( 'inline', $formFields, $this->getContext() ); $htmlForm->addHiddenFields( $hiddenFields ); $htmlForm->setAction( wfScript() ); @@ -141,7 +141,7 @@ class FileDuplicateSearchPage extends QueryPage { } elseif ( $this->filename !== '' ) { $out->wrapWikiMsg( "

\n$1\n

", - array( 'fileduplicatesearch-noresults', wfEscapeWikiText( $this->filename ) ) + [ 'fileduplicatesearch-noresults', wfEscapeWikiText( $this->filename ) ] ); } @@ -149,11 +149,11 @@ class FileDuplicateSearchPage extends QueryPage { # Show a thumbnail of the file $img = $this->file; if ( $img ) { - $thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) ); + $thumb = $img->transform( [ 'width' => 120, 'height' => 120 ] ); if ( $thumb ) { $out->addModuleStyles( 'mediawiki.special' ); $out->addHTML( '
' . - $thumb->toHtml( array( 'desc-link' => false ) ) . '
' . + $thumb->toHtml( [ 'desc-link' => false ] ) . '
' . $this->msg( 'fileduplicatesearch-info' )->numParams( $img->getWidth(), $img->getHeight() )->params( $this->getLanguage()->formatSize( $img->getSize() ), @@ -169,13 +169,13 @@ class FileDuplicateSearchPage extends QueryPage { if ( $numRows == 1 ) { $out->wrapWikiMsg( "

\n$1\n

", - array( 'fileduplicatesearch-result-1', wfEscapeWikiText( $this->filename ) ) + [ 'fileduplicatesearch-result-1', wfEscapeWikiText( $this->filename ) ] ); } elseif ( $numRows ) { $out->wrapWikiMsg( "

\n$1\n

", - array( 'fileduplicatesearch-result-n', wfEscapeWikiText( $this->filename ), - $this->getLanguage()->formatNum( $numRows - 1 ) ) + [ 'fileduplicatesearch-result-n', wfEscapeWikiText( $this->filename ), + $this->getLanguage()->formatNum( $numRows - 1 ) ] ); } @@ -244,12 +244,12 @@ class FileDuplicateSearchPage extends QueryPage { $title = Title::newFromText( $search, NS_FILE ); if ( !$title || $title->getNamespace() !== NS_FILE ) { // No prefix suggestion outside of file namespace - return array(); + return []; } $search = SearchEngine::create(); $search->setLimitOffset( $limit, $offset ); // Autocomplete subpage the same as a normal search, but just for files - $search->setNamespaces( array( NS_FILE ) ); + $search->setNamespaces( [ NS_FILE ] ); $result = $search->defaultPrefixSearch( $search ); return array_map( function ( Title $t ) {