Index: trunk/extensions/SocialProfile/UserStatus/UserStatus_AjaxFunctions.php |
— | — | @@ -10,8 +10,7 @@ |
11 | 11 | $user_status_array = $us_class->getStatus( $u_id ); |
12 | 12 | $buf = $user_status_array['us_status']; |
13 | 13 | $us = $buf; |
14 | | - // @todo FIXME: i18n |
15 | | - $us .= " <a href=\"javascript:UserStatus.toEditMode('$buf','$u_id');\">Edit</a>"; |
| 14 | + $us .= "<br> <a id=\"us-link\" href=\"javascript:UserStatus.toEditMode('$buf','$u_id');\">".wfMsg('userstatus-edit')."</a>"; |
16 | 15 | return $us; |
17 | 16 | } |
18 | 17 | |
— | — | @@ -20,13 +19,41 @@ |
21 | 20 | function wfGetHistory( $u_id ) { |
22 | 21 | $us_class = new UserStatusClass( $u_id ); |
23 | 22 | $historyArray = $us_class->useStatusHistory('select', $u_id); |
24 | | - $output='<table>'; |
25 | | - /*Under construction*/ |
26 | | - foreach ($historyArray as $row ) { |
| 23 | + $output='<table id="user-status-history">'; |
| 24 | + foreach ($historyArray as $row ) { |
27 | 25 | $output .= '<tr><td id="status-history-time">'.$row['ush_timestamp'].' </td>'; |
28 | 26 | $output .= '<td><a href="javascript:UserStatus.fromHistoryToStatus(\''.$row['ush_status'].'\');">' |
29 | 27 | .$row['ush_status'].'</a></td></tr>'; |
30 | | - } |
31 | | - $output.='</table>'; |
| 28 | + } |
| 29 | + $output.='</table>'; |
32 | 30 | return $output; |
| 31 | +} |
| 32 | + |
| 33 | +$wgHooks['MakeGlobalVariablesScript'][] = 'addJSGlobals'; |
| 34 | + |
| 35 | +function addJSGlobals( $vars ) { |
| 36 | + $vars['_US_EDIT'] = wfMsg( 'userstatus-edit' ); |
| 37 | + $vars['_US_SAVE'] = wfMsg( 'userstatus-save' ); |
| 38 | + $vars['_US_CANCEL'] = wfMsg( 'userstatus-cancel' ); |
| 39 | + $vars['_US_HISTORY'] = wfMsg( 'userstatus-history' ); |
| 40 | + $vars['_US_LETTERS'] = wfMsg( 'userstatus-letters-left' ); |
| 41 | + return true; |
| 42 | +} |
| 43 | + |
| 44 | + |
| 45 | +$wgHooks['UserProfileBeginRight'][] = 'wfUserProfileStatusOutput'; |
| 46 | + |
| 47 | +function wfUserProfileStatusOutput( $user_profile ) { |
| 48 | + global $wgOut , $wgEnableUserStatus; |
| 49 | + if ( $wgEnableUserStatus ) { |
| 50 | + $userStatus = $user_profile->getStatus( $user_profile->user_id ); |
| 51 | + $output = '<div id="status-box"> |
| 52 | + <div id="status-box-top"></div> |
| 53 | + <div id="status-box-content"> |
| 54 | + <div id="user-status-block">' . $userStatus . '</div> |
| 55 | + </div> |
| 56 | + </div>'; |
| 57 | + $wgOut->addHTML($output); |
| 58 | + } |
| 59 | + return true; |
33 | 60 | } |
\ No newline at end of file |
Index: trunk/extensions/SocialProfile/UserStatus/UserStatus.i18n.php |
— | — | @@ -12,10 +12,11 @@ |
13 | 13 | * @author Yevhenii Vlasenko |
14 | 14 | */ |
15 | 15 | $messages['en'] = array( |
16 | | - 'userstatus-edit' => "Edit", |
17 | | - 'userstatus-save' => "Save", |
18 | | - 'userstatus-cancel' => "Cancel", |
19 | | - 'userstatus-history' => "History", |
| 16 | + 'userstatus-edit' => 'Edit', |
| 17 | + 'userstatus-save' => 'Save', |
| 18 | + 'userstatus-cancel' => 'Cancel', |
| 19 | + 'userstatus-history' => 'History', |
| 20 | + 'userstatus-letters-left' => 'letters left', |
20 | 21 | ); |
21 | 22 | |
22 | 23 | /** Message documentation (Message documentation) |
— | — | @@ -137,6 +138,7 @@ |
138 | 139 | 'userstatus-save' => 'Сохранить', |
139 | 140 | 'userstatus-cancel' => 'Отмена', |
140 | 141 | 'userstatus-history' => 'История', |
| 142 | + 'userstatus-letters-left' => 'символов осталось', |
141 | 143 | ); |
142 | 144 | |
143 | 145 | /** Ukrainian (Українська) |
— | — | @@ -147,5 +149,6 @@ |
148 | 150 | 'userstatus-save' => 'Зберегти', |
149 | 151 | 'userstatus-cancel' => 'Відмінити', |
150 | 152 | 'userstatus-history' => 'Історія', |
| 153 | + 'userstatus-history' => 'символів залишилось', |
151 | 154 | ); |
152 | 155 | |
Index: trunk/extensions/SocialProfile/UserStatus/UserStatus.css |
— | — | @@ -1,4 +1,61 @@ |
2 | | -#status-history-time{ |
3 | | - font-size: 9px; |
4 | | - color: #665; |
| 2 | +#status-history-time |
| 3 | +{ |
| 4 | + font-size: 9px; |
| 5 | + color: #665; |
| 6 | +} |
| 7 | + |
| 8 | +#status-box |
| 9 | +{ |
| 10 | + width : 400px; |
| 11 | + padding: 0px; |
| 12 | + margin: 0px; |
| 13 | +} |
| 14 | + |
| 15 | +#status-box-top |
| 16 | +{ |
| 17 | + overflow:visible; |
| 18 | + margin-left: 34px; |
| 19 | + width: 30px; |
| 20 | + height:24px; |
| 21 | + background-color:orange; |
| 22 | + background-image: url('../images/status-corner.png'); |
| 23 | +} |
| 24 | + |
| 25 | +#status-box-content |
| 26 | +{ |
| 27 | + background-color:orange; |
| 28 | + padding:10px; |
| 29 | + border-radius: 22px; |
| 30 | + /*height: 38px;*/ |
| 31 | +} |
| 32 | + |
| 33 | +#user-status-block |
| 34 | +{ |
| 35 | + text-align: center; |
| 36 | + color: white; |
| 37 | +} |
| 38 | + |
| 39 | +#us-link |
| 40 | +{ |
| 41 | + color: white; |
| 42 | + font-size: 8pt; |
| 43 | + text-decoration: underline |
| 44 | +} |
| 45 | + |
| 46 | +#user-status-history |
| 47 | +{ |
| 48 | + background-color: orange; |
| 49 | +} |
| 50 | + |
| 51 | +#status-letter-count |
| 52 | +{ |
| 53 | + float:right; |
| 54 | + margin-right: 20px; |
| 55 | + font-size: 8pt; |
| 56 | +} |
| 57 | + |
| 58 | +#status-bar |
| 59 | +{ |
| 60 | + margin-left: 20px; |
| 61 | + text-align: left; |
5 | 62 | } |
\ No newline at end of file |
Index: trunk/extensions/SocialProfile/UserStatus/UserStatus.js |
— | — | @@ -1,16 +1,30 @@ |
2 | 2 | var UserStatus = { |
3 | 3 | historyOpened : false, |
4 | | - |
| 4 | + maxStatusLength : 70, |
| 5 | + |
5 | 6 | toShowMode: function( status, id ) { |
6 | 7 | document.getElementById( 'user-status-block' ).innerHTML = status; |
7 | | - document.getElementById( 'user-status-block' ).innerHTML += ' <a href="javascript:UserStatus.toEditMode(\'' + status + '\',' + id + ');">Edit</a>'; |
| 8 | + document.getElementById( 'user-status-block' ).innerHTML += '<br> <a id="us-link" href="javascript:UserStatus.toEditMode(\'' + status + '\',' + id + ');">Edit</a>'; |
8 | 9 | }, |
| 10 | + |
| 11 | + usLettersLeft: function() { |
| 12 | + var len = this.maxStatusLength - document.getElementById('user-status-input').value.length; |
| 13 | + if ( len < 0 ) { |
| 14 | + var usBlock = document.getElementById('user-status-input'); |
| 15 | + document.getElementById('user-status-input').value = usBlock.value.slice(0,this.maxStatusLength); |
| 16 | + len++; |
| 17 | + } |
| 18 | + document.getElementById('status-letter-count').innerHTML =len + " "+_US_LETTERS; |
| 19 | + }, |
9 | 20 | |
10 | 21 | toEditMode: function( status, id ) { |
11 | | - var editbar = '<input id="user-status-input" type="text" value="' + status + '">'; |
12 | | - editbar += ' <a href="javascript:UserStatus.saveStatus(' + id + ');">Save</a>'; |
13 | | - editbar += ' <a href="javascript:UserStatus.useHistory(' + id + ');">History</a>'; |
14 | | - editbar += ' <a href="javascript:UserStatus.toShowMode(\'' + status + '\',' + id + ');">Cancel</a>'; |
| 22 | + var editbar = '<input id="user-status-input" type="text" size="50" value="' + |
| 23 | + status + '" onkeyup="javascript:UserStatus.usLettersLeft();">'; |
| 24 | + editbar += '<br> <div id="status-bar">'; |
| 25 | + editbar += '<a id="us-link" href="javascript:UserStatus.saveStatus(' + id + ');">'+_US_SAVE+'</a>'; |
| 26 | + editbar += ' <a id="us-link" href="javascript:UserStatus.useHistory(' + id + ');">'+_US_HISTORY+'</a>'; |
| 27 | + editbar += ' <a id="us-link" href="javascript:UserStatus.toShowMode(\'' + status + '\',' + id + ');">'+_US_CANCEL+'</a>'; |
| 28 | + editbar += '<span id="status-letter-count"></span></div>'; |
15 | 29 | document.getElementById( 'user-status-block' ).innerHTML = editbar; |
16 | 30 | }, |
17 | 31 | |
Index: trunk/extensions/SocialProfile/UserStatus/UserStatusClass.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /* private */ function __construct( $u_id ) { |
11 | 11 | global $wgOut, $wgScriptPath; |
12 | | - $wgOut->addExtensionStyle( $wgScriptPath . '/extensions/SocialProfile/UserStatus/UserStatus.css' ); |
| 12 | + $wgOut->addExtensionStyle( $wgScriptPath . '/extensions/SocialProfile/UserStatus/UserStatus.css' ); |
13 | 13 | $wgOut->addScriptFile( $wgScriptPath . '/extensions/SocialProfile/UserStatus/UserStatus.js' ); |
14 | 14 | |
15 | 15 | } |
— | — | @@ -45,9 +45,9 @@ |
46 | 46 | * @param $message String: user-supplied status message |
47 | 47 | */ |
48 | 48 | public function setStatus( $u_id, $message ) { |
49 | | - if ( mb_strlen( $message ) > 140 ) { // change |
| 49 | + if (( mb_strlen( $message ) > 70 ) || ( mb_strlen( $message ) < 1 )) { |
50 | 50 | // ERROR. Message length is too long |
51 | | - // @todo Communicate failure to the end-user somehow... |
| 51 | + // @todo Communicate failure to the end-user somehow... |
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
Index: trunk/extensions/SocialProfile/UserBoard/SpecialUserBoard.php |
— | — | @@ -1,334 +0,0 @@ |
2 | | -<?php |
3 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
4 | | - die(); |
5 | | -} |
6 | | -/** |
7 | | - * Display User Board messages for a user |
8 | | - * |
9 | | - * @file |
10 | | - * @ingroup Extensions |
11 | | - * @author David Pean <david.pean@gmail.com> |
12 | | - * @copyright Copyright © 2007, Wikia Inc. |
13 | | - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
14 | | - */ |
15 | | - |
16 | | -class SpecialViewUserBoard extends SpecialPage { |
17 | | - |
18 | | - /** |
19 | | - * Constructor |
20 | | - */ |
21 | | - public function __construct() { |
22 | | - parent::__construct( 'UserBoard' ); |
23 | | - } |
24 | | - |
25 | | - /** |
26 | | - * Show the special page |
27 | | - * |
28 | | - * @param $params Mixed: parameter(s) passed to the page or null |
29 | | - */ |
30 | | - public function execute( $params ) { |
31 | | - global $wgUser, $wgOut, $wgRequest, $wgScriptPath, $wgHooks, $wgUserBoardScripts; |
32 | | - |
33 | | - // This hooked function adds a global JS variable that UserBoard.js |
34 | | - // uses to the HTML |
35 | | - $wgHooks['MakeGlobalVariablesScript'][] = 'SpecialViewUserBoard::addJSGlobals'; |
36 | | - |
37 | | - // Add CSS & JS |
38 | | - $wgOut->addExtensionStyle( $wgUserBoardScripts . '/UserBoard.css' ); |
39 | | - $wgOut->addScriptFile( $wgUserBoardScripts . '/UserBoard.js' ); |
40 | | - |
41 | | - $ub_messages_show = 25; |
42 | | - $user_name = $wgRequest->getVal( 'user' ); |
43 | | - $user_name_2 = $wgRequest->getVal( 'conv' ); |
44 | | - $user_id_2 = ''; // Prevent E_NOTICE |
45 | | - $page = $wgRequest->getInt( 'page', 1 ); |
46 | | - |
47 | | - /** |
48 | | - * Redirect Non-logged in users to Login Page |
49 | | - * It will automatically return them to the UserBoard page |
50 | | - */ |
51 | | - if ( $wgUser->getID() == 0 && $user_name == '' ) { |
52 | | - $login = SpecialPage::getTitleFor( 'Userlogin' ); |
53 | | - $wgOut->redirect( $login->getFullURL( 'returnto=Special:UserBoard' ) ); |
54 | | - return false; |
55 | | - } |
56 | | - |
57 | | - /** |
58 | | - * If no user is set in the URL, we assume its the current user |
59 | | - */ |
60 | | - if ( !$user_name ) { |
61 | | - $user_name = $wgUser->getName(); |
62 | | - } |
63 | | - $user_id = User::idFromName( $user_name ); |
64 | | - $user = Title::makeTitle( NS_USER, $user_name ); |
65 | | - $user_safe = str_replace( '&', '%26', $user_name ); |
66 | | - |
67 | | - if ( $user_name_2 ) { |
68 | | - $user_id_2 = User::idFromName( $user_name_2 ); |
69 | | - $user_2 = Title::makeTitle( NS_USER, $user_name ); |
70 | | - $user_safe_2 = urlencode( $user_name_2 ); |
71 | | - } |
72 | | - |
73 | | - /** |
74 | | - * Error message for username that does not exist (from URL) |
75 | | - */ |
76 | | - if ( $user_id == 0 ) { |
77 | | - $wgOut->showErrorPage( 'error', 'userboard_noexist' ); |
78 | | - return false; |
79 | | - } |
80 | | - |
81 | | - /** |
82 | | - * Config for the page |
83 | | - */ |
84 | | - $per_page = $ub_messages_show; |
85 | | - |
86 | | - $b = new UserBoard(); |
87 | | - $ub_messages = $b->getUserBoardMessages( |
88 | | - $user_id, |
89 | | - $user_id_2, |
90 | | - $ub_messages_show, |
91 | | - $page |
92 | | - ); |
93 | | - |
94 | | - if ( !$user_id_2 ) { |
95 | | - $stats = new UserStats( $user_id, $user_name ); |
96 | | - $stats_data = $stats->getUserStats(); |
97 | | - $total = $stats_data['user_board']; |
98 | | - // If user is viewing their own board or is allowed to delete |
99 | | - // others' board messages, show the total count of board messages |
100 | | - // to them (public + private messages) |
101 | | - if ( |
102 | | - $wgUser->getName() == $user_name || |
103 | | - $wgUser->isAllowed( 'userboard-delete' ) |
104 | | - ) |
105 | | - { |
106 | | - $total = $total + $stats_data['user_board_priv']; |
107 | | - } |
108 | | - } else { |
109 | | - $total = $b->getUserBoardToBoardCount( $user_id, $user_id_2 ); |
110 | | - } |
111 | | - |
112 | | - if ( !$user_id_2 ) { |
113 | | - if ( !( $wgUser->getName() == $user_name ) ) { |
114 | | - $wgOut->setPageTitle( wfMsg( 'userboard_owner', $user_name ) ); |
115 | | - } else { |
116 | | - $b->clearNewMessageCount( $wgUser->getID() ); |
117 | | - $wgOut->setPageTitle( wfMsg( 'userboard_yourboard' ) ); |
118 | | - } |
119 | | - } else { |
120 | | - if ( $wgUser->getName() == $user_name ) { |
121 | | - $wgOut->setPageTitle( wfMsg( 'userboard_yourboardwith', $user_name_2 ) ); |
122 | | - } else { |
123 | | - $wgOut->setPageTitle( wfMsg( 'userboard_otherboardwith', $user_name, $user_name_2 ) ); |
124 | | - } |
125 | | - } |
126 | | - |
127 | | - $output = '<div class="user-board-top-links">'; |
128 | | - $output .= '<a href="' . $user->escapeFullURL() . '">< ' . |
129 | | - wfMsg( 'userboard_backprofile', $user_name ) . '</a>'; |
130 | | - $output .= '</div>'; |
131 | | - |
132 | | - $board_to_board = ''; // Prevent E_NOTICE |
133 | | - |
134 | | - if ( $page == 1 ) { |
135 | | - $start = 1; |
136 | | - } else { |
137 | | - $start = ( $page - 1 ) * $per_page + 1; |
138 | | - } |
139 | | - $end = $start + ( count( $ub_messages ) ) - 1; |
140 | | - |
141 | | - if ( $wgUser->getName() != $user_name ) { |
142 | | - $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $wgUser->getName(), $user_name ) . '">' . |
143 | | - wfMsg( 'userboard_boardtoboard' ) . '</a>'; |
144 | | - } |
145 | | - |
146 | | - if ( $total ) { |
147 | | - $output .= '<div class="user-page-message-top"> |
148 | | - <span class="user-page-message-count" style="font-size:11px;color:#666666;">' |
149 | | - . wfMsg( 'userboard_showingmessages', $total, $start, $end, $end - $start + 1 ) . |
150 | | - ".</span> {$board_to_board}</span> |
151 | | - </div>"; |
152 | | - } |
153 | | - |
154 | | - /** |
155 | | - * Build next/prev nav |
156 | | - */ |
157 | | - $qs = ''; |
158 | | - if ( $user_id_2 ) { |
159 | | - $qs = "&conv={$user_safe_2}"; |
160 | | - } |
161 | | - $numofpages = $total / $per_page; |
162 | | - |
163 | | - if ( $numofpages > 1 ) { |
164 | | - $output .= '<div class="page-nav">'; |
165 | | - if ( $page > 1 ) { |
166 | | - $output .= '<a href="' . $wgScriptPath . "/index.php?title=Special:UserBoard&user={$user_safe}&page=" . ( $page - 1 ) . "{$qs}\">" . wfMsg( 'userboard_prevpage' ) . '</a>'; |
167 | | - } |
168 | | - |
169 | | - if ( ( $total % $per_page ) != 0 ) { |
170 | | - $numofpages++; |
171 | | - } |
172 | | - if ( $numofpages >= 9 && $page < $total ) { |
173 | | - $numofpages = 9 + $page; |
174 | | - if ( $numofpages >= ( $total / $per_page ) ) { |
175 | | - $numofpages = ( $total / $per_page ) + 1; |
176 | | - } |
177 | | - } |
178 | | - |
179 | | - for ( $i = 1; $i <= $numofpages; $i++ ) { |
180 | | - if ( $i == $page ) { |
181 | | - $output .= ( $i . ' ' ); |
182 | | - } else { |
183 | | - $output .= '<a href="' . $wgScriptPath . "/index.php?title=Special:UserBoard&user={$user_safe}&page=$i{$qs}\">$i</a> "; |
184 | | - } |
185 | | - } |
186 | | - |
187 | | - if ( ( $total - ( $per_page * $page ) ) > 0 ) { |
188 | | - $output .= ' <a href="' . $wgScriptPath . "/index.php?title=Special:UserBoard&user={$user_safe}&page=" . ( $page + 1 ) . "{$qs}\">" . wfMsg( 'userboard_nextpage' ) . '</a>'; |
189 | | - } |
190 | | - $output .= '</div><p>'; |
191 | | - } |
192 | | - |
193 | | - /** |
194 | | - * Build next/prev nav |
195 | | - */ |
196 | | - $can_post = false; |
197 | | - $user_name_from = ''; // Prevent E_NOTICE |
198 | | - |
199 | | - if ( !$user_id_2 ) { |
200 | | - if ( $wgUser->getName() != $user_name ) { |
201 | | - $can_post = true; |
202 | | - $user_name_to = htmlspecialchars( $user_name, ENT_QUOTES ); |
203 | | - } |
204 | | - } else { |
205 | | - if ( $wgUser->getName() == $user_name ) { |
206 | | - $can_post = true; |
207 | | - $user_name_to = htmlspecialchars( $user_name_2, ENT_QUOTES ); |
208 | | - $user_name_from = htmlspecialchars( $user_name, ENT_QUOTES ); |
209 | | - } |
210 | | - } |
211 | | - |
212 | | - if ( $wgUser->isBlocked() ) { |
213 | | - // only let them post to admins |
214 | | - $user_to = User::newFromId( $user_id ); |
215 | | - $user_to->loadFromId(); |
216 | | - // if( !$user_to->isAllowed( 'delete' ) ) { |
217 | | - $can_post = false; |
218 | | - // } |
219 | | - } |
220 | | - |
221 | | - if ( $can_post ) { |
222 | | - if ( $wgUser->isLoggedIn() && !$wgUser->isBlocked() ) { |
223 | | - $output .= '<div class="user-page-message-form"> |
224 | | - <input type="hidden" id="user_name_to" name="user_name_to" value="' . $user_name_to . '"/> |
225 | | - <input type="hidden" id="user_name_from" name="user_name_from" value="' . $user_name_from . '"/> |
226 | | - <span style="color:#797979;">' . wfMsg( 'userboard_messagetype' ) . ' </span> |
227 | | - <select id="message_type"> |
228 | | - <option value="0">' . wfMsg( 'userboard_public' ) . '</option> |
229 | | - <option value="1">' . wfMsg( 'userboard_private' ) . '</option> |
230 | | - </select> |
231 | | - <p> |
232 | | - <textarea name="message" id="message" cols="63" rows="4"></textarea> |
233 | | - |
234 | | - <div class="user-page-message-box-button"> |
235 | | - <input type="button" value="' . wfMsg( 'userboard_sendbutton' ) . '" class="site-button" onclick="javascript:UserBoard.sendMessage(' . $per_page . ');" /> |
236 | | - </div> |
237 | | - |
238 | | - </div>'; |
239 | | - } else { |
240 | | - $login_link = SpecialPage::getTitleFor( 'Userlogin' ); |
241 | | - $output .= '<div class="user-page-message-form">' |
242 | | - . wfMsg( 'userboard_loggedout', $login_link->escapeFullURL() ) . |
243 | | - '</div>'; |
244 | | - } |
245 | | - } |
246 | | - $output .= '<div id="user-page-board">'; |
247 | | - |
248 | | - if ( $ub_messages ) { |
249 | | - foreach ( $ub_messages as $ub_message ) { |
250 | | - $user = Title::makeTitle( NS_USER, $ub_message['user_name_from'] ); |
251 | | - $avatar = new wAvatar( $ub_message['user_id_from'], 'm' ); |
252 | | - |
253 | | - $board_to_board = ''; |
254 | | - $board_link = ''; |
255 | | - $ub_message_type_label = ''; |
256 | | - $delete_link = ''; |
257 | | - |
258 | | - if ( $wgUser->getName() != $ub_message['user_name_from'] ) { |
259 | | - $board_to_board = '<a href="' . UserBoard::getUserBoardToBoardURL( $user_name, $ub_message['user_name_from'] ) . '">' . |
260 | | - wfMsg( 'userboard_boardtoboard' ) . '</a>'; |
261 | | - $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . |
262 | | - wfMsg( 'userboard_sendmessage', $ub_message['user_name_from'] ) . '</a>'; |
263 | | - } else { |
264 | | - $board_link = '<a href="' . UserBoard::getUserBoardURL( $ub_message['user_name_from'] ) . '">' . |
265 | | - wfMsg( 'userboard_myboard' ) . '</a>'; |
266 | | - } |
267 | | - |
268 | | - // If the user owns this private message or they are allowed to |
269 | | - // delete board messages, show the "delete" link to them |
270 | | - if ( |
271 | | - $wgUser->getName() == $ub_message['user_name'] || |
272 | | - $wgUser->isAllowed( 'userboard-delete' ) |
273 | | - ) |
274 | | - { |
275 | | - $delete_link = "<span class=\"user-board-red\"> |
276 | | - <a href=\"javascript:void(0);\" onclick=\"javascript:UserBoard.deleteMessage({$ub_message['id']})\">" . |
277 | | - wfMsg( 'userboard_delete' ) . '</a> |
278 | | - </span>'; |
279 | | - } |
280 | | - |
281 | | - // Mark private messages as such |
282 | | - if ( $ub_message['type'] == 1 ) { |
283 | | - $ub_message_type_label = '(' . wfMsg( 'userboard_private' ) . ')'; |
284 | | - } |
285 | | - |
286 | | - // had global function to cut link text if too long and no breaks |
287 | | - // $ub_message_text = preg_replace_callback( "/(<a[^>]*>)(.*?)(<\/a>)/i", 'cut_link_text', $ub_message['message_text'] ); |
288 | | - $ub_message_text = $ub_message['message_text']; |
289 | | - |
290 | | - $output .= "<div class=\"user-board-message\" style=\"width:550px\"> |
291 | | - <div class=\"user-board-message-from\"> |
292 | | - <a href=\"{$user->escapeFullURL()}\" title=\"{$ub_message['user_name_from']}}\">{$ub_message['user_name_from']} </a> {$ub_message_type_label} |
293 | | - </div> |
294 | | - <div class=\"user-board-message-time\">" |
295 | | - . wfMsgHtml( 'userboard_posted_ago', $b->getTimeAgo( $ub_message['timestamp'] ) ) . |
296 | | - "</div> |
297 | | - <div class=\"user-board-message-content\"> |
298 | | - <div class=\"user-board-message-image\"> |
299 | | - <a href=\"{$user->escapeFullURL()}\" title=\"{$ub_message['user_name_from']}\">{$avatar->getAvatarURL()}</a> |
300 | | - </div> |
301 | | - <div class=\"user-board-message-body\"> |
302 | | - {$ub_message_text} |
303 | | - </div> |
304 | | - <div class=\"cleared\"></div> |
305 | | - </div> |
306 | | - <div class=\"user-board-message-links\"> |
307 | | - {$board_link} |
308 | | - {$board_to_board} |
309 | | - {$delete_link} |
310 | | - </div> |
311 | | - </div>"; |
312 | | - } |
313 | | - } else { |
314 | | - $invite_title = SpecialPage::getTitleFor( 'InviteContacts' ); |
315 | | - $output .= '<p>' . wfMsg( 'userboard_nomessages', $invite_title->escapeFullURL() ) . '</p>'; |
316 | | - } |
317 | | - |
318 | | - $output .= '</div>'; |
319 | | - |
320 | | - $wgOut->addHTML( $output ); |
321 | | - } |
322 | | - |
323 | | - /** |
324 | | - * Add a new JS global variable for UserBoard.js to allow localization. |
325 | | - * In the future, when we require ResourceLoader, this function can go |
326 | | - * away. Until that... |
327 | | - * |
328 | | - * @param $vars Array: array of pre-existing JS global variables |
329 | | - * @return Boolean: true |
330 | | - */ |
331 | | - public static function addJSGlobals( $vars ) { |
332 | | - $vars['_DELETE_CONFIRM'] = wfMsg( 'userboard_confirmdelete' ); |
333 | | - return true; |
334 | | - } |
335 | | -} |
Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php |
— | — | @@ -841,11 +841,6 @@ |
842 | 842 | <div id="profile-title">' . |
843 | 843 | $user_name . |
844 | 844 | '</div>'; |
845 | | - // Get the user's status message, if the UserStatus feature is enabled |
846 | | - if ( $wgEnableUserStatus ) { |
847 | | - $userStatus = $this->getStatus( $this->user_id ); |
848 | | - $output .= '<div id="user-status-block">' . $userStatus . '</div>'; |
849 | | - } |
850 | 845 | // Show the user's level and the amount of points they have if |
851 | 846 | // UserLevels has been configured |
852 | 847 | if ( $wgUserLevels ) { |
Index: trunk/extensions/SocialProfile/images/status-corner.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/SocialProfile/images/status-corner.png |
___________________________________________________________________ |
Added: svn:mime-type |
853 | 848 | + image/png |