mediawiki-skins-Vector/includes/SkinVectorLegacy.php
Jon Robson 41ed1cc525 [Technical] Separate shouldHideLanguages from isLegacy logic
Bug: T319349
Change-Id: I640533dc7ee3b39157963024eae11dca583606cd
2022-10-31 22:53:46 +00:00

51 lines
1.1 KiB
PHP

<?php
namespace MediaWiki\Skins\Vector;
/**
* @ingroup Skins
* @package Vector
* @internal
*/
class SkinVectorLegacy extends SkinVector {
/**
* Whether or not the legacy version of the skin is being used.
*
* @return bool
*/
protected function isLegacy(): bool {
return true;
}
/**
* Show the ULS button if it's modern Vector, languages in header is enabled,
* and the ULS extension is enabled. Hide it otherwise.
* There is no point in showing the language button if ULS extension is unavailable
* as there is no ways to add languages without it.
* @return bool
*/
protected function shouldHideLanguages(): bool {
return true;
}
/**
* @inheritDoc
*/
protected function isLanguagesInContentAt( $location ) {
return false;
}
/**
* @inheritDoc
*/
public function getTemplateData(): array {
$parentData = parent::getTemplateData();
// SkinVector sometimes serves new Vector as part of removing the
// skin version user preference. To avoid T302461 we need to unset it here.
// This shouldn't be run on SkinVector22.
unset( $parentData['data-toc'] );
return $parentData;
}
}