2021-06-09 19:55:45 +00:00
|
|
|
<?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' );
|
2021-11-11 14:39:04 +00:00
|
|
|
if ( !$dtConfig->get( 'DiscussionToolsEnableMobile' ) ) {
|
2021-06-09 19:55:45 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if ( HookUtils::isFeatureEnabledForOutput( $output ) ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|