mediawiki-extensions-Popups/includes/Module.php
Piotr Miazga f597e341af Introduce Opt-In option on user preferences page
This changes introduces new option on Special:Preferences page that
allows users to enable/disable Page Previews feature.
By default feature is disabled. Temporarily option in Preferences
page is smoke and mirrors as switching logic is still WIP.

Bug: T146889
Change-Id: Ifdd17ce265d2d4c7583433ed4991443c563f1fe3
2016-12-16 01:06:59 +01:00

36 lines
585 B
PHP

<?php
/**
* Module.php
*/
namespace Popups;
/**
* Popups Module
*
* @package Popups
*/
final class Module {
/**
* @var \Config
*/
private $config;
/**
* Module constructor.
* @param \Config $config
*/
public function __construct( \Config $config ) {
$this->config = $config;
}
/**
* Are Page previews visible on User Preferences Page
*
* return @bool
*/
public function showPreviewsOptInOnPreferencesPage() {
return $this->config->get( 'PopupsBetaFeature' ) === false
&& $this->config->get( 'PopupsHideOptInOnPreferencesPage' ) === false;
}
}