Index: trunk/extensions/SocialProfile/UserBoard/UserBoard.i18n.php |
— | — | @@ -9,13 +9,13 @@ |
10 | 10 | $messages = array(); |
11 | 11 | |
12 | 12 | /** English |
13 | | - * @author Wikia, Inc. |
| 13 | + * @author Aaron Wright |
| 14 | + * @author David Pean |
14 | 15 | * @author Purodha |
15 | 16 | */ |
16 | 17 | $messages['en'] = array( |
17 | 18 | 'boardblastlogintitle' => 'You must be logged in to send board blasts', |
18 | | - 'boardblastlogintext' => 'In order to send board blasts, |
19 | | -you must be <a href="index.php?title=Special:UserLogin">logged in</a>.', |
| 19 | + 'boardblastlogintext' => 'In order to send board blasts, you must be [[Special:UserLogin|logged in]].', |
20 | 20 | 'messagesenttitle' => 'Messages sent', |
21 | 21 | 'boardblasttitle' => 'Send board blast', |
22 | 22 | 'boardblaststep1' => 'Step 1 - Write your message', |
Index: trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php |
— | — | @@ -1,6 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * A special page to allow users to send a mass board message by selecting from a list of their friends and foes |
| 4 | + * A special page to allow users to send a mass board message by selecting from |
| 5 | + * a list of their friends and foes |
5 | 6 | * |
6 | 7 | * @file |
7 | 8 | * @ingroup Extensions |
— | — | @@ -35,7 +36,7 @@ |
36 | 37 | // This feature is available only to logged-in users. |
37 | 38 | if ( !$wgUser->isLoggedIn() ) { |
38 | 39 | $wgOut->setPageTitle( wfMsg( 'boardblastlogintitle' ) ); |
39 | | - $output = wfMsg( 'boardblastlogintext' ); |
| 40 | + $output = wfMsgExt( 'boardblastlogintext', 'parse' ); |
40 | 41 | $wgOut->addHTML( $output ); |
41 | 42 | return ''; |
42 | 43 | } |
— | — | @@ -50,7 +51,14 @@ |
51 | 52 | $user = User::newFromId( $user_id ); |
52 | 53 | $user->loadFromId(); |
53 | 54 | $user_name = $user->getName(); |
54 | | - $b->sendBoardMessage( $wgUser->getID(), $wgUser->getName(), $user_id, $user_name, $wgRequest->getVal( 'message' ), 1 ); |
| 55 | + $b->sendBoardMessage( |
| 56 | + $wgUser->getID(), |
| 57 | + $wgUser->getName(), |
| 58 | + $user_id, |
| 59 | + $user_name, |
| 60 | + $wgRequest->getVal( 'message' ), |
| 61 | + 1 |
| 62 | + ); |
55 | 63 | $count++; |
56 | 64 | } |
57 | 65 | $output .= wfMsg( 'messagesentsuccess' ); |
— | — | @@ -70,9 +78,9 @@ |
71 | 79 | |
72 | 80 | $stats = new UserStats( $wgUser->getID(), $wgUser->getName() ); |
73 | 81 | $stats_data = $stats->getUserStats(); |
| 82 | + $friendCount = $stats_data['friend_count']; |
| 83 | + $foeCount = $stats_data['foe_count']; |
74 | 84 | |
75 | | - |
76 | | - |
77 | 85 | $output = '<div class="board-blast-message-form"> |
78 | 86 | <h2>' . wfMsg( 'boardblaststep1' ) . '</h2> |
79 | 87 | <form method="post" name="blast" action=""> |
— | — | @@ -89,16 +97,16 @@ |
90 | 98 | <a href="javascript:void(0);" onclick="javascript:select_all()">' . wfMsg( 'boardlinkselectall' ) . '</a> - |
91 | 99 | <a href="javascript:void(0);" onclick="javascript:unselect_all()">' . wfMsg( 'boardlinkunselectall' ) . '</a> '; |
92 | 100 | |
93 | | - if ( $stats_data['friend_count'] > 0 && $stats_data['foe_count'] > 0 ) { |
94 | | - $output .= '- <a href="javascript:void(0);" onclick="javascript:toggle_friends(1)">' . wfMsg( 'boardlinkselectfriends' ) . '</a> -'; |
95 | | - $output .= '<a href="javascript:void(0);" onclick="javascript:toggle_friends(0)">' . wfMsg( 'boardlinkunselectfriends' ) . '</a>'; |
96 | | - } |
| 101 | + if ( $friendCount > 0 && $foeCount > 0 ) { |
| 102 | + $output .= '- <a href="javascript:void(0);" onclick="javascript:toggle_friends(1)">' . wfMsg( 'boardlinkselectfriends' ) . '</a> -'; |
| 103 | + $output .= '<a href="javascript:void(0);" onclick="javascript:toggle_friends(0)">' . wfMsg( 'boardlinkunselectfriends' ) . '</a>'; |
| 104 | + } |
97 | 105 | |
98 | | - if ( $stats_data['foe_count'] > 0 && $stats_data['friend_count'] > 0 ) { |
99 | | - $output .= '- <a href="javascript:void(0);" onclick="javascript:toggle_foes(1)">' . wfMsg( 'boardlinkselectfoes' ) . '</a> -'; |
100 | | - $output .= '<a href="javascript:void(0);" onclick="javascript:toggle_foes(0)">' . wfMsg( 'boardlinkunselectfoes' ) . '</a>'; |
101 | | - } |
102 | | - $output .= '</div> |
| 106 | + if ( $foeCount > 0 && $friendCount > 0 ) { |
| 107 | + $output .= '- <a href="javascript:void(0);" onclick="javascript:toggle_foes(1)">' . wfMsg( 'boardlinkselectfoes' ) . '</a> -'; |
| 108 | + $output .= '<a href="javascript:void(0);" onclick="javascript:toggle_foes(0)">' . wfMsg( 'boardlinkunselectfoes' ) . '</a>'; |
| 109 | + } |
| 110 | + $output .= '</div> |
103 | 111 | </div>'; |
104 | 112 | |
105 | 113 | $rel = new UserRelationship( $wgUser->getName() ); |
— | — | @@ -110,7 +118,13 @@ |
111 | 119 | $per_row = 3; |
112 | 120 | if ( count( $relationships ) > 0 ) { |
113 | 121 | foreach ( $relationships as $relationship ) { |
114 | | - $output .= '<div class="blast-' . ( ( $relationship['type'] == 1 ) ? 'friend' : 'foe' ) . "-unselected\" id=\"user-{$relationship['user_id']}\" onclick=\"javascript:toggle_user({$relationship['user_id']})\"> |
| 122 | + if ( $relationship['type'] == 1 ) { |
| 123 | + $class = 'friend'; |
| 124 | + } else { |
| 125 | + $class = 'foe'; |
| 126 | + } |
| 127 | + $id = $relationship['user_id']; |
| 128 | + $output .= '<div class="blast-' . $class . "-unselected\" id=\"user-{$id}\" onclick=\"javascript:toggle_user({$id})\"> |
115 | 129 | {$relationship['user_name']} |
116 | 130 | </div>"; |
117 | 131 | if ( $x == count( $relationships ) || $x != 1 && $x % $per_row == 0 ) { |
— | — | @@ -129,6 +143,7 @@ |
130 | 144 | $output .= '<div class="blast-message-box-button"> |
131 | 145 | <input type="button" value="' . wfMsg( 'boardsendbutton' ) . '" class="site-button" onclick="javascript:send_messages();" /> |
132 | 146 | </div>'; |
| 147 | + |
133 | 148 | return $output; |
134 | 149 | } |
135 | 150 | } |