mediawiki-extensions-Popups/Popups.hooks.php
Max Semenik 6b0057a521 Kill $wgEnablePopups
It's not a feature flag because it disables whole extension as opposed to a
particular feature. It would result in weird situations where the extension is
present in Special:Version but does not work for no obvious reason. If an
extension needs to be disabled on WMF, its registration file should not be included,
as opposed to "feature flags". This, however, does not mean that I'm opposed to
real feature flags:)

Change-Id: I09bae50241057f727881f33d6f97f69cec7c0a10
2014-02-10 13:20:39 +04:00

32 lines
1 KiB
PHP

<?php
/*
* This file is part of the MediaWiki extension Popups.
*
* Popups is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Popups is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Popups. If not, see <http://www.gnu.org/licenses/>.
*
* @file
* @ingroup extensions
*/
class PopupsHooks {
public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin) {
// Depends on PageImages & TextExtracts extensions
if ( class_exists( 'ApiQueryExtracts' )
&& class_exists( 'ApiQueryPageImages' )
) {
$out->addModules( array( 'ext.popups' ) );
}
}
}