. * * @file * @ingroup Skins */ declare( strict_types=1 ); namespace Citizen\Partials; use ResourceLoaderSkinModule; /** * Drawer partial of Skin Citizen * Generates the following partials: * - Logo * - Drawer * + Special Pages Link * + Upload Link */ final class Logos extends Partial { /** * Get and pick the correct logo based on types and variants * Based on getLogoData() in MW 1.36 * * @return array */ public function getLogoData() : array { $logoData = ResourceLoaderSkinModule::getAvailableLogos( $this->skin->getConfig() ); // check if the logo supports variants $variantsLogos = $logoData['variants'] ?? null; if ( $variantsLogos ) { $preferred = $this->skin->getOutput()->getTitle() ->getPageViewLanguage()->getCode(); $variantOverrides = $variantsLogos[$preferred] ?? null; // Overrides the logo if ( $variantOverrides ) { foreach ( $variantOverrides as $key => $val ) { $logoData[$key] = $val; } } } return $logoData; } }