Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php |
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | |
113 | 113 | $wgHooks['GetPreferences'][] = 'wfOnlineStatusBar_PreferencesHook'; |
114 | 114 | function wfOnlineStatusBar_PreferencesHook( $user, &$preferences ) { |
115 | | - global $wgOnlineStatusBarModes; |
| 115 | + global $wgOnlineStatusBarDefaultOnline, $wgOnlineStatusBarDefaultEnabled, $wgOnlineStatusBarModes; |
116 | 116 | $preferences['OnlineStatusBar_active'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-used', 'section' => 'misc/onlinestatus' ); |
117 | 117 | $preferences['OnlineStatusBar_status'] = array( 'type' => 'radio', 'label-message' => 'onlinestatusbar-status', 'section' => 'misc/onlinestatus', |
118 | 118 | 'options' => array( |
— | — | @@ -122,5 +122,11 @@ |
123 | 123 | ), |
124 | 124 | 'default' => 'online', |
125 | 125 | ); |
| 126 | + if ( $wgOnlineStatusBarDefaultEnabled == true ) { |
| 127 | + if ($user->getOption ( "OnlineStatusBar_active" ) == null) { |
| 128 | + $user->setOption ( "OnlineStatusBar_active", true ); |
| 129 | + $user->setOption ( "OnlineStatusBar_status", $wgOnlineStatusBarDefaultOnline ); |
| 130 | + } |
| 131 | + } |
126 | 132 | return true; |
127 | 133 | } |