mediawiki-extensions-Discus.../includes/Hooks/MobileHooks.php
Esanders 3cbca26bd0 Revert "Split DiscussionToolsEnableMobile=true into 'behind-overlay' and 'remove-overlay'"
This reverts commit 99b757465a.

Reason for revert: We may never need the 'behind-overlay' setting
and it is untested and probably broken.

Bug: T295816
Change-Id: I9e128862271697ece5241d0e98727174b42f54ff
2021-12-06 17:26:01 +00:00

34 lines
800 B
PHP

<?php
/**
* DiscussionTools mobile hooks
*
* @file
* @ingroup Extensions
* @license MIT
*/
namespace MediaWiki\Extension\DiscussionTools\Hooks;
use MediaWiki\MediaWikiServices;
class MobileHooks {
/**
* Decide whether mobile frontend should be allowed to activate
*
* @param \Title $title
* @param \OutputPage $output
* @return bool|void This hook can return false to abort, causing the talk overlay to not be shown
*/
public static function onMinervaNeueTalkPageOverlay( $title, $output ) {
$dtConfig = MediaWikiServices::getInstance()->getConfigFactory()
->makeConfig( 'discussiontools' );
if ( !$dtConfig->get( 'DiscussionToolsEnableMobile' ) ) {
return true;
}
if ( HookUtils::isFeatureEnabledForOutput( $output ) ) {
return false;
}
return true;
}
}