mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-18 02:51:26 +00:00
3cbca26bd0
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
34 lines
800 B
PHP
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;
|
|
}
|
|
}
|