r100887 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100886‎ | r100887 | r100888 >
Date:22:18, 26 October 2011
Author:petrb
Status:deferred
Tags:
Comment:
replaced defaults now it should work even for new users
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -112,7 +112,7 @@
113113 $wgHooks['GetPreferences'][] = 'wfOnlineStatusBar_PreferencesHook';
114114 function wfOnlineStatusBar_PreferencesHook( $user, &$preferences ) {
115115 global $wgOnlineStatusBarDefaultOnline, $wgOnlineStatusBarDefaultEnabled, $wgOnlineStatusBarModes;
116 - $preferences['OnlineStatusBar_active'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-used', 'section' => 'misc/onlinestatus' ); // 'default' => $wgOnlineStatusBarDefaultEnabled );
 116+ $preferences['OnlineStatusBar_active'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-used', 'section' => 'misc/onlinestatus' );
117117 $preferences['OnlineStatusBar_status'] = array( 'type' => 'radio', 'label-message' => 'onlinestatusbar-status', 'section' => 'misc/onlinestatus',
118118 'options' => array(
119119 $wgOnlineStatusBarModes['online'] => 'online',
@@ -120,7 +120,16 @@
121121 $wgOnlineStatusBarModes['away'] => 'away',
122122 $wgOnlineStatusBarModes['hidden'] => 'hidden'
123123 ),
124 - //'default' => 'online',
125124 );
126125 return true;
127126 }
 127+
 128+$wgHooks['UserGetDefaultOptions'][] = 'wfOnlineStatusBar_SetDefaultOptions';
 129+function wfOnlineStatusBar_SetDefaultOptions( &$defaultOptions ) {
 130+ global $wgOnlineStatusBarDefaultOnline, $wgOnlineStatusBarDefaultEnabled;
 131+ // set defaults
 132+ $defaultOptions['OnlineStatusBar_status'] = $wgOnlineStatusBarDefaultOnline;
 133+ $defaultOptions['OnlineStatusBar_active'] = $wgOnlineStatusBarDefaultEnabled;
 134+ // quit
 135+ return true;
 136+}

Status & tagging log