Index: trunk/phase3/includes/logging/LogPage.php |
— | — | @@ -201,7 +201,8 @@ |
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
205 | | - * Generate text for a log entry |
| 205 | + * Generate text for a log entry. |
| 206 | + * Only LogFormatter should call this function. |
206 | 207 | * |
207 | 208 | * @param $type String: log type |
208 | 209 | * @param $action String: log action |
— | — | @@ -420,6 +421,7 @@ |
421 | 422 | * @param $doer User object: the user doing the action |
422 | 423 | * |
423 | 424 | * @return bool|int|null |
| 425 | + * @TODO: make this use LogEntry::saveContent() |
424 | 426 | */ |
425 | 427 | public function addEntry( $action, $target, $comment, $params = array(), $doer = null ) { |
426 | 428 | global $wgContLang; |
— | — | @@ -449,8 +451,17 @@ |
450 | 452 | |
451 | 453 | $this->doer = $doer; |
452 | 454 | |
453 | | - $this->actionText = LogPage::actionText( $this->type, $action, $target, null, $params ); |
| 455 | + $logEntry = new ManualLogEntry( $this->type, $action ); |
| 456 | + $logEntry->setTarget( $target ); |
| 457 | + $logEntry->setPerformer( $doer ); |
| 458 | + $logEntry->setParameters( $params ); |
454 | 459 | |
| 460 | + $formatter = LogFormatter::newFromEntry( $logEntry ); |
| 461 | + $context = RequestContext::newExtraneousContext( $target ); |
| 462 | + $formatter->setContext( $context ); |
| 463 | + |
| 464 | + $this->actionText = $formatter->getPlainActionText(); |
| 465 | + |
455 | 466 | return $this->saveContent(); |
456 | 467 | } |
457 | 468 | |
Index: trunk/phase3/includes/logging/LogFormatter.php |
— | — | @@ -393,9 +393,9 @@ |
394 | 394 | $entry->getType(), |
395 | 395 | $entry->getSubtype(), |
396 | 396 | $entry->getTarget(), |
397 | | - $this->context->getSkin(), |
| 397 | + $this->plaintext ? null : $this->context->getSkin(), |
398 | 398 | (array)$entry->getParameters(), |
399 | | - true |
| 399 | + !$this->plaintext // whether to filter [[]] links |
400 | 400 | ); |
401 | 401 | |
402 | 402 | $performer = $this->getPerformerElement(); |
Index: trunk/extensions/CheckUser/CheckUser.hooks.php |
— | — | @@ -22,9 +22,11 @@ |
23 | 23 | // If not, then $rc_comment is the actiontext and comment |
24 | 24 | if ( isset( $rc_log_type ) && $rc_type == RC_LOG ) { |
25 | 25 | $target = Title::makeTitle( $rc_namespace, $rc_title ); |
26 | | - $actionText = LogPage::actionText( $rc_log_type, $rc_log_action, $target, |
27 | | - null, LogPage::extractParams( $rc_params ) |
28 | | - ); |
| 26 | + $context = RequestContext::newExtraneousContext( $target ); |
| 27 | + |
| 28 | + $formatter = LogFormatter::newFromRow( $rc->mAttribs ); |
| 29 | + $formatter->setContext( $context ); |
| 30 | + $actionText = $formatter->getPlainActionText(); |
29 | 31 | } else { |
30 | 32 | $actionText = ''; |
31 | 33 | } |