Index: trunk/extensions/LiquidThreads/LqtFunctions.php |
— | — | @@ -38,31 +38,33 @@ |
39 | 39 | } |
40 | 40 | |
41 | 41 | function efVarDump( $value ) { |
42 | | - global $wgOut; |
43 | | - ob_start(); |
44 | | - var_dump( $value ); |
45 | | - $tmp = ob_get_contents(); |
46 | | - ob_end_clean(); |
47 | | - $wgOut->addHTML( /*'<pre>' . htmlspecialchars($tmp,ENT_QUOTES) . '</pre>'*/ $tmp ); |
| 42 | + wfVarDump( $value ); |
48 | 43 | } |
49 | 44 | |
50 | 45 | function efThreadTable( $ts ) { |
51 | 46 | global $wgOut; |
52 | | - $wgOut->addHTML( '<table>' ); |
53 | | - foreach ( $ts as $t ) |
54 | | - efThreadTableHelper( $t, 0 ); |
55 | | - $wgOut->addHTML( '</table>' ); |
| 47 | + $html = ''; |
| 48 | + foreach ( $ts as $t ) { |
| 49 | + $html .= efThreadTableHelper( $t, 0 ); |
| 50 | + } |
| 51 | + $html = "<table><tbody>\n$html\n</tbody></table>"; |
| 52 | + $wgOut->addHTML( $html ); |
56 | 53 | } |
57 | 54 | |
58 | | -function efThreadTableHelper( $t, $indent ) { |
59 | | - global $wgOut; |
60 | | - $wgOut->addHTML( '<tr>' ); |
61 | | - $wgOut->addHTML( '<td>' . $indent ); |
62 | | - $wgOut->addHTML( '<td>' . $t->id() ); |
63 | | - $wgOut->addHTML( '<td>' . $t->title()->getPrefixedText() ); |
64 | | - $wgOut->addHTML( '</tr>' ); |
65 | | - foreach ( $t->subthreads() as $st ) |
66 | | - efThreadTableHelper( $st, $indent + 1 ); |
| 55 | +function efThreadTableHelper( $thread, $indent ) { |
| 56 | + $html = ''; |
| 57 | + |
| 58 | + $html .= Xml::tags( '<td>', null, $indent ); |
| 59 | + $html .= Xml::tags( '<td>', null, $thread->id() ); |
| 60 | + $html .= Xml::tags( '<td>', null, $thread->title()->getPrefixedText() ); |
| 61 | + |
| 62 | + $html = Xml::tags( 'tr', null, $html ); |
| 63 | + |
| 64 | + foreach ( $t->subthreads() as $subthread ) { |
| 65 | + $html .= efThreadTableHelper( $subthread, $indent + 1 ); |
| 66 | + } |
| 67 | + |
| 68 | + return $html; |
67 | 69 | } |
68 | 70 | |
69 | 71 | function wfLqtBeforeWatchlistHook( &$conds, &$tables, &$join_conds, &$fields ) { |
— | — | @@ -85,14 +87,13 @@ |
86 | 88 | |
87 | 89 | LqtView::addJSandCSS(); |
88 | 90 | wfLoadExtensionMessages( 'LiquidThreads' ); |
89 | | - $messages_url = SpecialPage::getPage( 'NewMessages' )->getTitle()->getFullURL(); |
| 91 | + $messages_title = SpecialPage::getPage( 'NewMessages' )->getTitle(); |
90 | 92 | $new_messages = wfMsg ( 'lqt-new-messages' ); |
91 | | - $wgOut->addHTML( <<< HTML |
92 | | - <a href="$messages_url" class="lqt_watchlist_messages_notice"> |
93 | | - ✒ {$new_messages} |
94 | | - </a> |
95 | | -HTML |
96 | | - ); |
| 93 | + |
| 94 | + $sk = $wgUser->getSkin(); |
| 95 | + $link = $sk->link( $messages_title, $new_messages, |
| 96 | + array( 'class' => 'lqt_watchlist_messages_notice' ) ); |
| 97 | + $wgOut->addHTML( $link ); |
97 | 98 | |
98 | 99 | return true; |
99 | 100 | } |
Index: trunk/extensions/LiquidThreads/Lqt.i18n.php |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | 'lqt-messages-sent' => 'Messages sent to you:', |
136 | 136 | 'lqt-other-messages' => 'Messages on other talk pages:', |
137 | 137 | 'lqt-no-new-messages' => 'There are no new messages for you.', |
138 | | - 'lqt-new-messages' => 'There are new messages for you.', |
| 138 | + 'lqt-new-messages' => '✒ There are new messages for you.', |
139 | 139 | 'lqt-email-info-undo' => 'Bring back the thread you just dismissed.', |
140 | 140 | 'lqt-date-info' => 'This link is disabled because you are viewing threads from all dates.', |
141 | 141 | 'lqt_rc_new_discussion' => "New discussion, $1, on $2. • $3 writes:", |