Migrate protect log to new log system
[lhc/web/wiklou.git] / includes / logging / LogFormatter.php
index 0145b02..1d31088 100644 (file)
@@ -263,7 +263,7 @@ class LogFormatter {
                                switch ( $entry->getSubtype() ) {
                                        case 'protect':
                                                $text = wfMessage( 'protectedarticle' )
-                                                       ->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
+                                                       ->rawParams( $target . ' ' . $parameters['4::description'] )->inContentLanguage()->escaped();
                                                break;
                                        case 'unprotect':
                                                $text = wfMessage( 'unprotectedarticle' )
@@ -271,7 +271,11 @@ class LogFormatter {
                                                break;
                                        case 'modify':
                                                $text = wfMessage( 'modifiedarticleprotection' )
-                                                       ->rawParams( $target . ' ' . $parameters[0] )->inContentLanguage()->escaped();
+                                                       ->rawParams( $target . ' ' . $parameters['4::description'] )->inContentLanguage()->escaped();
+                                               break;
+                                       case 'move_prot':
+                                               $text = wfMessage( 'movedarticleprotection' )
+                                                       ->rawParams( $target, $parameters['4::oldtitle'] )->inContentLanguage()->escaped();
                                                break;
                                }
                                break;
@@ -928,32 +932,6 @@ class LegacyLogFormatter extends LogFormatter {
                $type = $this->entry->getType();
                $subtype = $this->entry->getSubtype();
 
-               if ( $type == 'protect'
-                       && ( $subtype == 'protect' || $subtype == 'modify' || $subtype == 'unprotect' )
-               ) {
-                       $links = array(
-                               Linker::link( $title,
-                                       $this->msg( 'hist' )->escaped(),
-                                       array(),
-                                       array(
-                                               'action' => 'history',
-                                               'offset' => $this->entry->getTimestamp()
-                                       )
-                               )
-                       );
-                       if ( $this->context->getUser()->isAllowed( 'protect' ) ) {
-                               $links[] = Linker::linkKnown(
-                                       $title,
-                                       $this->msg( 'protect_change' )->escaped(),
-                                       array(),
-                                       array( 'action' => 'protect' )
-                               );
-                       }
-
-                       return $this->msg( 'parentheses' )->rawParams(
-                               $this->context->getLanguage()->pipeList( $links ) )->escaped();
-               }
-
                // Do nothing. The implementation is handled by the hook modifiying the
                // passed-by-ref parameters. This also changes the default value so that
                // getComment() and getActionLinks() do not call them indefinitely.