diff --git a/includes/Constants.php b/includes/Constants.php index 9f949237..8a5f3c10 100644 --- a/includes/Constants.php +++ b/includes/Constants.php @@ -264,6 +264,26 @@ final class Constants { */ public const WEB_AB_TEST_ARTICLE_ID_FACTORY_SERVICE = 'WikimediaEvents.WebABTestArticleIdFactory'; + /** + * @var string + */ + public const REQUIREMENT_TITLE_ABOVE_TABS = 'TitleAboveTabs'; + + /** + * @var string + */ + public const CONFIG_TITLE_ABOVE_TABS = 'VectorTitleAboveTabs'; + + /** + * @var string + */ + public const QUERY_PARAM_TITLE_ABOVE_TABS = 'titleabovetabs'; + + /** + * @var string + */ + public const FEATURE_TITLE_ABOVE_TABS = 'TitleAboveTabs'; + /** * This class is for namespacing constants only. Forbid construction. * @throws FatalError diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 2f42f323..452cbcf2 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -217,6 +217,29 @@ return [ ] ); + // Feature: Title above tabs + // ================================ + $featureManager->registerRequirement( + new OverridableConfigRequirement( + $services->getMainConfig(), + $context->getUser(), + $context->getRequest(), + null, + Constants::CONFIG_TITLE_ABOVE_TABS, + Constants::REQUIREMENT_TITLE_ABOVE_TABS, + Constants::QUERY_PARAM_TITLE_ABOVE_TABS, + null + ) + ); + + $featureManager->registerFeature( + Constants::FEATURE_TITLE_ABOVE_TABS, + [ + Constants::REQUIREMENT_FULLY_INITIALISED, + Constants::REQUIREMENT_TITLE_ABOVE_TABS, + ] + ); + return $featureManager; } ]; diff --git a/includes/SkinVector22.php b/includes/SkinVector22.php index b569e6a7..23afa3c2 100644 --- a/includes/SkinVector22.php +++ b/includes/SkinVector22.php @@ -167,6 +167,7 @@ class SkinVector22 extends SkinVector { Constants::FEATURE_STICKY_HEADER_EDIT ) ) : false, + 'is-title-above-tabs' => $featureManager->isFeatureEnabled( Constants::FEATURE_TITLE_ABOVE_TABS ) ]; } } diff --git a/skin.json b/skin.json index a5ef56d6..c2d13b03 100644 --- a/skin.json +++ b/skin.json @@ -511,6 +511,10 @@ "VectorTableOfContentsCollapseAtCount": { "value": 20, "description": "@var When `VectorTableOfContents` is enabled, the minimum number of headings required to collapse all headings in the sticky table of contents by default." + }, + "VectorTitleAboveTabs": { + "value": false, + "description": "@var boolean `VectorTitleAboveTabs` places the tittle of the page above the tabs that link to history/talk etc." } }, "ServiceWiringFiles": [