r100873 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100872‎ | r100873 | r100874 >
Date:21:07, 26 October 2011
Author:petrb
Status:deferred (Comments)
Tags:
Comment:
fixed
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' );
 116+ $preferences['OnlineStatusBar_active'] = array( 'type' => 'toggle', 'label-message' => 'onlinestatusbar-used', 'section' => 'misc/onlinestatus', 'default' => $wgOnlineStatusBarDefaultEnabled );
117117 $preferences['OnlineStatusBar_status'] = array( 'type' => 'radio', 'label-message' => 'onlinestatusbar-status', 'section' => 'misc/onlinestatus',
118118 'options' => array(
119119 $wgOnlineStatusBarModes['online'] => 'online',
@@ -122,11 +122,5 @@
123123 ),
124124 'default' => 'online',
125125 );
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 - }
132126 return true;
133127 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100868now it overrides default configpetrb20:48, 26 October 2011

Comments

#Comment by Petrb (talk | contribs)   21:09, 26 October 2011

fixed default values for preferences hook

#Comment by Petrb (talk | contribs)   21:21, 26 October 2011

could someone please review if this code is valid? it's following manual but for some reason it stopped working on my installation, it always use default values now (user can't change it), but for instance the second value is same as before, but now doesn't work, so it's rather bug in mediawiki

Status & tagging log