mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Don't export unused wgEchoOverlayConfiguration/wgEchoHelpPage JS variables
And make the if conditional a little easier to read: is logged in versus not anonymous. Change-Id: I76784b74caabd1ea0a5f0f506661a1682c865394
This commit is contained in:
parent
b46fcf57b3
commit
0790125dd4
|
@ -812,17 +812,12 @@ class EchoHooks {
|
|||
* @return bool true in all cases
|
||||
*/
|
||||
public static function makeGlobalVariablesScript( &$vars, OutputPage $outputPage ) {
|
||||
global $wgEchoHelpPage, $wgEchoMaxNotificationCount, $wgEchoConfig;
|
||||
global $wgEchoConfig;
|
||||
$user = $outputPage->getUser();
|
||||
|
||||
// Provide info for the Overlay
|
||||
|
||||
if ( !$user->isAnon() ) {
|
||||
$vars['wgEchoOverlayConfiguration'] = array(
|
||||
'notification-count' => MWEchoNotifUser::newFromUser( $user )->getFormattedNotificationCount(),
|
||||
'max-notification-count' => $wgEchoMaxNotificationCount,
|
||||
);
|
||||
$vars['wgEchoHelpPage'] = $wgEchoHelpPage;
|
||||
if ( $user->isLoggedIn() ) {
|
||||
$vars['wgEchoConfig'] = $wgEchoConfig;
|
||||
} elseif (
|
||||
$outputPage->getTitle()->equals( SpecialPage::getTitleFor( 'JavaScriptTest', 'qunit' ) ) ||
|
||||
|
|
Loading…
Reference in a new issue