From dc4443a7ddcd356d388fcc90e6cbfdc618c03188 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Tue, 5 May 2020 07:53:49 -0700 Subject: [PATCH] Timeless should support default logos Use getAvailableLogos to retrieve wordmark and icon wikimedia production has values for all projects for these values TimelessLogo and TimelessWordmark continue to be supported for 3rd parties. Bug: T231615 Change-Id: I2e4bc30c948b1bcb338f9d41774912b9afb320b4 --- includes/TimelessTemplate.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/includes/TimelessTemplate.php b/includes/TimelessTemplate.php index bec7ebe..680e8b5 100644 --- a/includes/TimelessTemplate.php +++ b/includes/TimelessTemplate.php @@ -370,8 +370,17 @@ class TimelessTemplate extends BaseTemplate { 'role' => 'banner' ] ); + $logos = ResourceLoaderSkinModule::getAvailableLogos( $config ); if ( $part !== 'image' ) { $wordmarkImage = $this->getLogoImage( $config->get( 'TimelessWordmark' ), true ); + if ( !$wordmarkImage && isset( $logos['wordmark'] ) ) { + $wordmarkData = $logos['wordmark']; + $wordmarkImage = Html::element( 'img', [ + 'src' => $wordmarkData['src'], + 'height' => $wordmarkData['height'] ?? null, + 'width' => $wordmarkData['width'] ?? null, + ] ); + } $titleClass = ''; $siteTitle = ''; @@ -399,6 +408,12 @@ class TimelessTemplate extends BaseTemplate { } if ( $part !== 'text' ) { $logoImage = $this->getLogoImage( $config->get( 'TimelessLogo' ) ); + if ( $logoImage === null && isset( $logos['icon'] ) ) { + $logoSrc = $logos['icon']; + $logoImage = Html::element( 'img', [ + 'src' => $logoSrc, + ] ); + } $html .= Html::rawElement( 'a',