r99866 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99865‎ | r99866 | r99867 >
Date:09:43, 15 October 2011
Author:ialex
Status:ok
Tags:
Comment:
Use local context instead of global variables
Modified paths:
  • /trunk/phase3/includes/RevisionList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/RevisionList.php
@@ -184,19 +184,19 @@
185185 }
186186
187187 /**
188 - * Get the date, formatted with $wgLang
 188+ * Get the date, formatted in user's languae
189189 */
190190 public function formatDate() {
191 - global $wgLang;
192 - return $wgLang->date( $this->getTimestamp() );
 191+ return $this->list->context->getLang()->userDate( $this->getTimestamp(),
 192+ $this->list->context->getUser() );
193193 }
194194
195195 /**
196 - * Get the time, formatted with $wgLang
 196+ * Get the time, formatted in user's languae
197197 */
198198 public function formatTime() {
199 - global $wgLang;
200 - return $wgLang->time( $this->getTimestamp() );
 199+ return $this->list->context->getLang()->userTime( $this->getTimestamp(),
 200+ $this->list->context->getUser() );
201201 }
202202
203203 /**

Status & tagging log