protected function makeMetadataTable( $metadata ) {
$r = "<div class=\"mw-imagepage-section-metadata\">";
$r .= $this->getContext()->msg( 'metadata-help' )->plain();
- $r .= "<table id=\"mw_metadata\" class=\"mw_metadata\">\n";
+ // Intial state is collapsed
+ // see filepage.css and mediawiki.action.view.metadata module.
+ $r .= "<table id=\"mw_metadata\" class=\"mw_metadata collapsed\">\n";
foreach ( $metadata as $type => $stuff ) {
foreach ( $stuff as $v ) {
$class = str_replace( ' ', '_', $v['id'] );
if ( $type == 'collapsed' ) {
- // Handled by mediawiki.action.view.metadata module.
$class .= ' mw-metadata-collapsible';
}
$r .= Html::rawElement( 'tr',
// The dirmark, however, must not be immediately adjacent
// to the filename, because it can get copied with it.
// See T27277.
- // @codingStandardsIgnoreStart Ignore long line
+ // phpcs:disable Generic.Files.LineLength
$out->addWikiText( <<<EOT
<div class="fullMedia"><span class="dangerousLink">{$medialink}</span> $dirmark<span class="fileInfo">$longDesc</span></div>
<div class="mediaWarning">$warning</div>
EOT
);
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
} else {
$out->addWikiText( <<<EOT
<div class="fullMedia">{$medialink} {$dirmark}<span class="fileInfo">$longDesc</span>
* @param string $sizeLinkBigImagePreview HTML for the current size
* @return string HTML output
*/
- private function getThumbPrevText( $params, $sizeLinkBigImagePreview ) {
+ protected function getThumbPrevText( $params, $sizeLinkBigImagePreview ) {
if ( $sizeLinkBigImagePreview ) {
// Show a different message of preview is different format from original.
$previewTypeDiffers = false;
* @param int $height
* @return string
*/
- private function makeSizeLink( $params, $width, $height ) {
+ protected function makeSizeLink( $params, $width, $height ) {
$params['width'] = $width;
$params['height'] = $height;
$thumbnail = $this->displayImg->transform( $params );
* @return int Result of string comparison, or namespace comparison
*/
protected function compare( $a, $b ) {
- if ( $a->page_namespace == $b->page_namespace ) {
- return strcmp( $a->page_title, $b->page_title );
- } else {
- return $a->page_namespace - $b->page_namespace;
- }
+ return $a->page_namespace <=> $b->page_namespace
+ ?: strcmp( $a->page_title, $b->page_title );
}
/**
$option = 0;
}
- return isset( $wgImageLimits[$option] )
- ? $wgImageLimits[$option]
- : [ 800, 600 ]; // if nothing is set, fallback to a hardcoded default
+ // if nothing is set, fallback to a hardcoded default
+ return $wgImageLimits[$option] ?? [ 800, 600 ];
}
/**