Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | $wgHooks['GetPreferences'][] = 'wfOnlineStatusBar_PreferencesHook'; |
114 | 114 | function wfOnlineStatusBar_PreferencesHook( $user, &$preferences ) { |
115 | 115 | 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' ); |
117 | 117 | $preferences['OnlineStatusBar_status'] = array( 'type' => 'radio', 'label-message' => 'onlinestatusbar-status', 'section' => 'misc/onlinestatus', |
118 | 118 | 'options' => array( |
119 | 119 | $wgOnlineStatusBarModes['online'] => 'online', |
— | — | @@ -120,7 +120,16 @@ |
121 | 121 | $wgOnlineStatusBarModes['away'] => 'away', |
122 | 122 | $wgOnlineStatusBarModes['hidden'] => 'hidden' |
123 | 123 | ), |
124 | | - //'default' => 'online', |
125 | 124 | ); |
126 | 125 | return true; |
127 | 126 | } |
| 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 | +} |