Index: trunk/extensions/LiquidThreads/LqtFunctions.php |
— | — | @@ -97,3 +97,8 @@ |
98 | 98 | |
99 | 99 | return true; |
100 | 100 | } |
| 101 | + |
| 102 | +function lqtFormatMoveLogEntry( $type, $action, $title, $sk, $parameters ) { |
| 103 | + return wfMsgExt( 'lqt-log-action-move', 'parseinline', |
| 104 | + array( $title->getPrefixedText(), $parameters[0], $parameters[1] ) ); |
| 105 | +} |
Index: trunk/extensions/LiquidThreads/LiquidThreads.php |
— | — | @@ -85,6 +85,12 @@ |
86 | 86 | $wgAutoloadClasses['NewUserMessagesView'] = $dir . 'pages/NewUserMessagesView.php'; |
87 | 87 | $wgAutoloadClasses['SpecialNewMessages'] = $dir . 'pages/SpecialNewMessages.php'; |
88 | 88 | |
| 89 | +// Logging |
| 90 | +$wgLogTypes[] = 'liquidthreads'; |
| 91 | +$wgLogNames['liquidthreads'] = 'lqt-log-name'; |
| 92 | +$wgLogHeaders['liquidthreads'] = 'lqt-log-header'; |
| 93 | +$wgLogActionsHandlers['liquidthreads/move'] = 'lqtFormatMoveLogEntry'; |
| 94 | + |
89 | 95 | /** CONFIGURATION SECTION */ |
90 | 96 | |
91 | 97 | /* Number of days a thread needs to have existed to be considered for summarizing and archival */ |
Index: trunk/extensions/LiquidThreads/classes/LqtThread.php |
— | — | @@ -179,6 +179,9 @@ |
180 | 180 | function moveToPage( $title, $reason, $leave_trace ) { |
181 | 181 | $dbr =& wfGetDB( DB_MASTER ); |
182 | 182 | |
| 183 | + $oldTitle = $this->article()->getTitle(); |
| 184 | + $newTitle = $title; |
| 185 | + |
183 | 186 | $new_articleNamespace = $title->getNamespace(); |
184 | 187 | $new_articleTitle = $title->getDBkey(); |
185 | 188 | |
— | — | @@ -196,6 +199,10 @@ |
197 | 200 | $this->articleTitle = $new_articleTitle; |
198 | 201 | $this->revisionNumber += 1; |
199 | 202 | $this->commitRevision( Threads::CHANGE_MOVED_TALKPAGE, null, $reason ); |
| 203 | + |
| 204 | + # Log the move |
| 205 | + $log = new LogPage( 'liquidthreads' ); |
| 206 | + $log->addEntry( 'move', $this->double->title(), $reason, array( $oldTitle, $newTitle ) ); |
200 | 207 | |
201 | 208 | if ( $leave_trace ) { |
202 | 209 | $this->leaveTrace( $reason ); |
— | — | @@ -218,10 +225,6 @@ |
219 | 226 | $redirectRevision->insertOn( $dbw ); |
220 | 227 | $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 ); |
221 | 228 | |
222 | | - # Log the move |
223 | | - $log = new LogPage( 'move' ); |
224 | | - $log->addEntry( 'move', $this->double->title(), $reason, array( 1 => $this->title()->getPrefixedText() ) ); |
225 | | - |
226 | 229 | # Purge caches as per article creation |
227 | 230 | Article::onArticleCreate( $redirectArticle->getTitle() ); |
228 | 231 | |
Index: trunk/extensions/LiquidThreads/Lqt.i18n.php |
— | — | @@ -146,6 +146,11 @@ |
147 | 147 | 'lqt_rc_ellipsis' => ' …', |
148 | 148 | 'lqt_rc_author_original' => '(original author)', |
149 | 149 | 'lqt_rc_author_others' => '(not the author)', |
| 150 | + |
| 151 | + // Logging |
| 152 | + 'lqt-log-name' => 'Threaded discussion log', |
| 153 | + 'lqt-log-header' => 'This log details actions taken on discussion threads.', |
| 154 | + 'lqt-log-action-move' => 'moved [[$1]] from [[$2]] to [[$3]].', |
150 | 155 | ); |
151 | 156 | |
152 | 157 | /** Message documentation (Message documentation) |