r105501 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105500‎ | r105501 | r105502 >
Date:00:37, 8 December 2011
Author:jeroendedauw
Status:reverted
Tags:
Comment:
display date as actual date
Modified paths:
  • /trunk/extensions/Reviews/Reviews.hooks.php (modified) (history)
  • /trunk/extensions/Reviews/includes/Review.php (modified) (history)
  • /trunk/extensions/Reviews/includes/ReviewPager.php (modified) (history)
  • /trunk/extensions/Reviews/includes/ReviewsList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Reviews/includes/ReviewPager.php
@@ -128,7 +128,7 @@
129129 */
130130 function formatRow( $row ) {
131131 $this->currentReview = Review::newFromDBResult( $row );
132 - return '<tr><td>' . $this->currentReview->getHTML( $this->getUser() ) . '</td></tr>';
 132+ return '<tr><td>' . $this->currentReview->getHTML( $this->getUser(), $this->getLanguage() ) . '</td></tr>';
133133 }
134134
135135 /**
Index: trunk/extensions/Reviews/includes/ReviewsList.php
@@ -88,7 +88,8 @@
8989 $reviews = $this->getReviews( $source->getTitle() );
9090
9191 if ( count( $reviews ) > 0 ) {
92 - return $this->getList( $reviews, $source->getUser() );
 92+ $lang = method_exists( $source, 'getLanguage' ) ? $source->getLanguage() : $GLOBALS['wgLang'];
 93+ return $this->getList( $reviews, $source->getUser(), $lang );
9394 }
9495 else {
9596 return is_null( $this->contents['default'] ) ? '' : $this->contents['default'];
@@ -155,14 +156,16 @@
156157 * @since 0.1
157158 *
158159 * @param array $reviews
 160+ * @param User $user
 161+ * @param Language $lang
159162 *
160163 * @return string
161164 */
162 - protected function getList( array /* of Review */ $reviews, User $user ) {
 165+ protected function getList( array /* of Review */ $reviews, User $user, Language $lang ) {
163166 $html = '';
164167
165168 foreach ( $reviews as /* Review */ $review ) {
166 - $html .= $review->getHTML( $user );
 169+ $html .= $review->getHTML( $user, $lang );
167170 }
168171
169172 return $html;
Index: trunk/extensions/Reviews/includes/Review.php
@@ -351,9 +351,12 @@
352352 *
353353 * @since 0.1
354354 *
 355+ * @param User $user
 356+ * @param Language $lang
 357+ *
355358 * @return string
356359 */
357 - public function getHTML( User $user ) {
 360+ public function getHTML( User $user, Language $lang ) {
358361 $ratings = $this->getRatings( true );
359362
360363 $html = '<table class="review-table">';
@@ -375,7 +378,7 @@
376379 $html .= Html::element( 'p', array( 'class' => 'reviews-posted-on' ), wfMsgExt(
377380 'reviews-posted-on',
378381 'parsemag',
379 - $this->getField( 'post_time' )
 382+ $lang->date( $this->getField( 'post_time' ), true )
380383 ) );
381384
382385 $html .= '</td>';
Index: trunk/extensions/Reviews/Reviews.hooks.php
@@ -169,7 +169,7 @@
170170 */
171171 public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) {
172172 if ( property_exists( $out, 'reviewsMagicWord' ) && $out->reviewsMagicWord ) {
173 - $tag = new ReviewsTag();
 173+ $tag = new ReviewsList();
174174 $out->addHTML( $tag->render( $out ) );
175175
176176 /* User */ $user = $out->getUser();

Status & tagging log