2021-09-09 22:13:48 +00:00
|
|
|
<?php
|
|
|
|
|
2022-05-23 07:32:40 +00:00
|
|
|
namespace MediaWiki\Skins\Vector;
|
2022-02-06 22:43:56 +00:00
|
|
|
|
2021-09-09 22:13:48 +00:00
|
|
|
/**
|
|
|
|
* @ingroup Skins
|
|
|
|
* @package Vector
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
class SkinVectorLegacy extends SkinVector {
|
|
|
|
/**
|
2022-01-20 22:14:19 +00:00
|
|
|
* Whether or not the legacy version of the skin is being used.
|
2021-09-09 22:13:48 +00:00
|
|
|
*
|
2022-01-20 22:14:19 +00:00
|
|
|
* @return bool
|
2021-09-09 22:13:48 +00:00
|
|
|
*/
|
2022-01-20 22:14:19 +00:00
|
|
|
protected function isLegacy(): bool {
|
|
|
|
return true;
|
2021-09-09 22:13:48 +00:00
|
|
|
}
|
2022-04-01 15:53:03 +00:00
|
|
|
|
2022-10-27 21:18:53 +00:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
|
2022-04-01 15:53:03 +00:00
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
protected function isLanguagesInContentAt( $location ) {
|
|
|
|
return false;
|
|
|
|
}
|
2022-10-27 16:17:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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;
|
|
|
|
}
|
2021-09-09 22:13:48 +00:00
|
|
|
}
|