r100541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100540‎ | r100541 | r100542 >
Date:13:50, 23 October 2011
Author:nikerabbit
Status:deferred
Tags:
Comment:
Indendation updates and use $wgExtensionAssetsPath (forgot to save a file)
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -66,59 +66,56 @@
6767 $wgOnlineStatusBarY = "-35";
6868
6969 $wgHooks['LoadExtensionSchemaUpdates'][] = 'wfOnlineStatusBar_CkSchema';
70 -
71 - function wfOnlineStatusBar_CkSchema($updater = null)
72 - {
 70+function wfOnlineStatusBar_CkSchema($updater = null)
 71+{
7372 global $wgOnlineStatusBarTable;
74 - if ($updater != null)
75 - {
76 - $updater->addExtensionUpdate( array ( 'addtable', $wgOnlineStatusBarTable, dirname( __FILE__) . '/OnlineStatusBar.sql', true));
77 - }
78 - else
79 - {
80 - global $wgExtNewTables;
81 - $wgExtNewTables[] = array(
82 - $wgOnlineStatusBarTable, dirname( __FILE__ ) . '/OnlineStatusBar.sql' );
83 - }
84 - return true;
85 - }
86 -
87 -$wgHooks['UserLogoutComplete'][] = 'wfOnlineStatusBar_Logout';
88 -
89 - function wfOnlineStatusBar_Logout(&$user, &$inject_html, $old_name)
 73+ if ($updater != null)
9074 {
91 - global $wgUser;
92 - OnlineStatusBar::DeleteStatus($old_name);
93 - return true;
 75+ $updater->addExtensionUpdate( array ( 'addtable', $wgOnlineStatusBarTable, dirname( __FILE__) . '/OnlineStatusBar.sql', true));
9476 }
 77+ else
 78+ {
 79+ global $wgExtNewTables;
 80+ $wgExtNewTables[] = array(
 81+ $wgOnlineStatusBarTable, dirname( __FILE__ ) . '/OnlineStatusBar.sql' );
 82+ }
 83+ return true;
 84+}
9585
 86+$wgHooks['UserLogoutComplete'][] = 'wfOnlineStatusBar_Logout';
 87+function wfOnlineStatusBar_Logout(&$user, &$inject_html, $old_name)
 88+{
 89+ global $wgUser;
 90+ OnlineStatusBar::DeleteStatus($old_name);
 91+ return true;
 92+}
 93+
9694 $wgHooks['ArticleViewHeader'][] = 'wfOnlineStatusBar_RenderBar';
97 - function wfOnlineStatusBar_RenderBar(&$article, &$outputDone, &$pcache)
 95+function wfOnlineStatusBar_RenderBar(&$article, &$outputDone, &$pcache)
 96+{
 97+ global $wgOnlineStatusBar_Template, $messages, $wgOnlineStatusBarModes, $wgOut;
 98+ OnlineStatusBar::UpdateStatus();
 99+ $ns=$article->getTitle()->getNamespace();
 100+ if(($ns == NS_USER_TALK) || ($ns == NS_USER))
98101 {
99 - global $wgOnlineStatusBar_Template, $messages, $wgOnlineStatusBarModes, $wgOut;
100 - OnlineStatusBar::UpdateStatus();
101 - $ns=$article->getTitle()->getNamespace();
102 - if(($ns == NS_USER_TALK) || ($ns == NS_USER))
103 - {
104 - // better way to get a username would be great :)
105 - $user = preg_replace('/\/.*/', '', preg_replace('/^.*\:/', "", $article->getTitle()));
106 - $OnlineStatus_Text = $user . language::getMessageFromDB("onlinestatusbar-line");
107 - $OnlineStatus_Mode = OnlineStatusBar::GetStatus($user);
108 - $wgOut->addHtml(OnlineStatusBar::Get_Html($OnlineStatus_Text, $OnlineStatus_Mode));
109 - }
110 - return true;
 102+ // better way to get a username would be great :)
 103+ $user = preg_replace('/\/.*/', '', preg_replace('/^.*\:/', "", $article->getTitle()));
 104+ $OnlineStatus_Text = $user . language::getMessageFromDB("onlinestatusbar-line");
 105+ $OnlineStatus_Mode = OnlineStatusBar::GetStatus($user);
 106+ $wgOut->addHtml(OnlineStatusBar::Get_Html($OnlineStatus_Text, $OnlineStatus_Mode));
111107 }
 108+ return true;
 109+}
112110
113111 $wgHooks['UserLoginComplete'][] = 'wfOnlineStatusBar_UpdateStatus';
 112+function wfOnlineStatusBar_UpdateStatus()
 113+{
 114+ OnlineStatusBar::UpdateDb();
 115+ return true;
 116+}
114117
115 - function wfOnlineStatusBar_UpdateStatus()
116 - {
117 - OnlineStatusBar::UpdateDb();
118 - return true;
119 - }
120 -
121 -
 118+// Unused?
122119 $commonModuleInfo = array(
123120 'localBasePath' => dirname( __FILE__ ) . '/modules',
124121 'remoteExtPath' => 'OnlineStatusBar/modules',
125 - );
 122+);

Status & tagging log