Index: trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulUtil.php |
— | — | @@ -4,6 +4,7 @@ |
5 | 5 | |
6 | 6 | public static function getMarkAsHelpfulTemplate( $user, $isAbleToMark, $helpfulUserList, $type, $item ) { |
7 | 7 | if ( $user->isAnon() ) { |
| 8 | + |
8 | 9 | $userList = ''; |
9 | 10 | |
10 | 11 | foreach ( $helpfulUserList as $val ) { |
— | — | @@ -17,7 +18,7 @@ |
18 | 19 | } |
19 | 20 | |
20 | 21 | return <<<HTML |
21 | | - <div id="markashelpful-$type-$item"> |
| 22 | + <div class="mw-mah-wrapper"> |
22 | 23 | $data |
23 | 24 | </div> |
24 | 25 | HTML; |
— | — | @@ -26,20 +27,20 @@ |
27 | 28 | $userId = $user->getId(); |
28 | 29 | |
29 | 30 | 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(); |
32 | 33 | |
33 | 34 | 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) |
36 | 37 | </div> |
37 | 38 | HTML; |
38 | 39 | } else { |
39 | 40 | if ( $isAbleToMark ) { |
40 | | - $linkText = wfMessage( 'mah-mark-text' )->escaped(); |
| 41 | + $mahLinkText = wfMessage( 'mah-mark-text' )->escaped(); |
41 | 42 | 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> |
44 | 45 | </div> |
45 | 46 | HTML; |
46 | 47 | } |
Index: trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulItem.php |
— | — | @@ -253,16 +253,14 @@ |
254 | 254 | |
255 | 255 | $list = array(); |
256 | 256 | |
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 ); |
263 | 261 | } |
264 | 262 | |
265 | 263 | return $list; |
266 | 264 | } |
267 | 265 | } |
268 | 266 | |
269 | | -class MWMarkAsHelpFulItemPropertyException extends MWException {} |
\ No newline at end of file |
| 267 | +class MWMarkAsHelpFulItemPropertyException extends MWException {} |