r106869 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106868‎ | r106869 | r106870 >
Date:21:37, 20 December 2011
Author:bsitu
Status:deferred
Tags:markashelpful 
Comment:
updated html message with language file and replace db row access with stdclass style
Modified paths:
  • /trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulItem.php (modified) (history)
  • /trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulUtil.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulUtil.php
@@ -4,6 +4,7 @@
55
66 public static function getMarkAsHelpfulTemplate( $user, $isAbleToMark, $helpfulUserList, $type, $item ) {
77 if ( $user->isAnon() ) {
 8+
89 $userList = '';
910
1011 foreach ( $helpfulUserList as $val ) {
@@ -17,7 +18,7 @@
1819 }
1920
2021 return <<<HTML
21 - <div id="markashelpful-$type-$item">
 22+ <div class="mw-mah-wrapper">
2223 $data
2324 </div>
2425 HTML;
@@ -26,20 +27,20 @@
2728 $userId = $user->getId();
2829
2930 if ( isset( $helpfulUserList[$userId] ) ) {
30 - $data = wfMessage( 'mah-you-marked-text' )->escaped();
31 - $undo = wfMessage( 'mah-undo-mark-text' )->escaped();
 31+ $mahMarkedText = wfMessage( 'mah-you-marked-text' )->escaped();
 32+ $undoLinkText = wfMessage( 'mah-undo-mark-text' )->escaped();
3233
3334 return <<<HTML
34 - <div id="markashelpful-$type-$item">
35 - $data | $undo
 35+ <div class="mw-mah-wrapper">
 36+ <a class='mah-helpful-state'><div class='.mah-helpful-marked-icon'></div>$mahMarkedText</a> ($undoLinkText)
3637 </div>
3738 HTML;
3839 } else {
3940 if ( $isAbleToMark ) {
40 - $linkText = wfMessage( 'mah-mark-text' )->escaped();
 41+ $mahLinkText = wfMessage( 'mah-mark-text' )->escaped();
4142 return <<<HTML
42 - <div id="markashelpful-$type-$item">
43 - $linkText
 43+ <div class="mw-mah-wrapper">
 44+ <a class='mah-helpful-state'><div class='.mah-helpful-icon'></div>$mahLinkText</a>
4445 </div>
4546 HTML;
4647 }
Index: trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulItem.php
@@ -253,16 +253,14 @@
254254
255255 $list = array();
256256
257 - foreach( $res as $val ) {
258 - $list[$val['user_id']] = array(
259 - 'user_name' => $val['user_name'],
260 - 'user_id' => $val['user_id'],
261 - 'user_ip' => $val['mah_user_ip']
262 - );
 257+ foreach( $res AS $val ) {
 258+ $list[$val->user_id] = array( 'user_name' => $val->user_name,
 259+ 'user_id' => $val->user_id,
 260+ 'user_ip' => $val->mah_user_ip );
263261 }
264262
265263 return $list;
266264 }
267265 }
268266
269 -class MWMarkAsHelpFulItemPropertyException extends MWException {}
\ No newline at end of file
 267+class MWMarkAsHelpFulItemPropertyException extends MWException {}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106843Mark As Helpful APIs and backendbsitu19:30, 20 December 2011

Status & tagging log