Merge "Removed old HTMLCacheUpdateJob b/c code"
[lhc/web/wiklou.git] / includes / logging / LogPage.php
index ce5b972..30dee81 100644 (file)
@@ -288,24 +288,8 @@ class LogPage {
                                        $details = '';
                                        array_unshift( $params, $titleLink );
 
-                                       // User suppression
-                                       if ( preg_match( '/^(block|suppress)\/(block|reblock)$/', $key ) ) {
-                                               if ( $skin ) {
-                                                       // Localize the duration, and add a tooltip
-                                                       // in English to help visitors from other wikis.
-                                                       // The lrm is needed to make sure that the number
-                                                       // is shown on the correct side of the tooltip text.
-                                                       $durationTooltip = '‎' . htmlspecialchars( $params[1] );
-                                                       $params[1] = "<span class='blockExpiry' title='$durationTooltip'>" .
-                                                               $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
-                                               } else {
-                                                       $params[1] = $wgContLang->translateBlockExpiry( $params[1] );
-                                               }
-
-                                               $params[2] = isset( $params[2] ) ?
-                                                       self::formatBlockFlags( $params[2], $langObj ) : '';
                                        // Page protections
-                                       } elseif ( $type == 'protect' && count( $params ) == 3 ) {
+                                       if ( $type == 'protect' && count( $params ) == 3 ) {
                                                // Restrictions and expiries
                                                if ( $skin ) {
                                                        $details .= $wgLang->getDirMark() . htmlspecialchars( " {$params[1]}" );
@@ -370,69 +354,22 @@ class LogPage {
                        return $title->getPrefixedText();
                }
 
-               switch ( $type ) {
-                       case 'move':
-                               $titleLink = Linker::link(
-                                       $title,
-                                       htmlspecialchars( $title->getPrefixedText() ),
-                                       array(),
-                                       array( 'redirect' => 'no' )
-                               );
-
-                               $targetTitle = Title::newFromText( $params[0] );
-
-                               if ( !$targetTitle ) {
-                                       # Workaround for broken database
-                                       $params[0] = htmlspecialchars( $params[0] );
-                               } else {
-                                       $params[0] = Linker::link(
-                                               $targetTitle,
-                                               htmlspecialchars( $params[0] )
-                                       );
-                               }
-                               break;
-                       case 'block':
-                               if ( substr( $title->getText(), 0, 1 ) == '#' ) {
-                                       $titleLink = $title->getText();
-                               } else {
-                                       // @todo Store the user identifier in the parameters
-                                       // to make this faster for future log entries
-                                       $id = User::idFromName( $title->getText() );
-                                       $titleLink = Linker::userLink( $id, $title->getText() )
-                                               . Linker::userToolLinks( $id, $title->getText(), false, Linker::TOOL_LINKS_NOBLOCK );
-                               }
-                               break;
-                       case 'merge':
-                               $titleLink = Linker::link(
-                                       $title,
-                                       $title->getPrefixedText(),
-                                       array(),
-                                       array( 'redirect' => 'no' )
-                               );
-                               $params[0] = Linker::link(
-                                       Title::newFromText( $params[0] ),
-                                       htmlspecialchars( $params[0] )
-                               );
-                               $params[1] = $lang->timeanddate( $params[1] );
-                               break;
-                       default:
-                               if ( $title->isSpecialPage() ) {
-                                       list( $name, $par ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
-
-                                       # Use the language name for log titles, rather than Log/X
-                                       if ( $name == 'Log' ) {
-                                               $logPage = new LogPage( $par );
-                                               $titleLink = Linker::link( $title, $logPage->getName()->escaped() );
-                                               $titleLink = wfMessage( 'parentheses' )
-                                                       ->inLanguage( $lang )
-                                                       ->rawParams( $titleLink )
-                                                       ->escaped();
-                                       } else {
-                                               $titleLink = Linker::link( $title );
-                                       }
-                               } else {
-                                       $titleLink = Linker::link( $title );
-                               }
+               if ( $title->isSpecialPage() ) {
+                       list( $name, $par ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
+
+                       # Use the language name for log titles, rather than Log/X
+                       if ( $name == 'Log' ) {
+                               $logPage = new LogPage( $par );
+                               $titleLink = Linker::link( $title, $logPage->getName()->escaped() );
+                               $titleLink = wfMessage( 'parentheses' )
+                                       ->inLanguage( $lang )
+                                       ->rawParams( $titleLink )
+                                       ->escaped();
+                       } else {
+                               $titleLink = Linker::link( $title );
+                       }
+               } else {
+                       $titleLink = Linker::link( $title );
                }
 
                return $titleLink;
@@ -549,61 +486,6 @@ class LogPage {
                }
        }
 
-       /**
-        * Convert a comma-delimited list of block log flags
-        * into a more readable (and translated) form
-        *
-        * @param string $flags Flags to format
-        * @param Language $lang
-        * @return string
-        */
-       public static function formatBlockFlags( $flags, $lang ) {
-               $flags = trim( $flags );
-               if ( $flags === '' ) {
-                       return ''; //nothing to do
-               }
-               $flags = explode( ',', $flags );
-               $flagsCount = count( $flags );
-
-               for ( $i = 0; $i < $flagsCount; $i++ ) {
-                       $flags[$i] = self::formatBlockFlag( $flags[$i], $lang );
-               }
-
-               return wfMessage( 'parentheses' )->inLanguage( $lang )
-                       ->rawParams( $lang->commaList( $flags ) )->escaped();
-       }
-
-       /**
-        * Translate a block log flag if possible
-        *
-        * @param int $flag Flag to translate
-        * @param Language $lang Language object to use
-        * @return string
-        */
-       public static function formatBlockFlag( $flag, $lang ) {
-               static $messages = array();
-
-               if ( !isset( $messages[$flag] ) ) {
-                       $messages[$flag] = htmlspecialchars( $flag ); // Fallback
-
-                       // For grepping. The following core messages can be used here:
-                       // * block-log-flags-angry-autoblock
-                       // * block-log-flags-anononly
-                       // * block-log-flags-hiddenname
-                       // * block-log-flags-noautoblock
-                       // * block-log-flags-nocreate
-                       // * block-log-flags-noemail
-                       // * block-log-flags-nousertalk
-                       $msg = wfMessage( 'block-log-flags-' . $flag )->inLanguage( $lang );
-
-                       if ( $msg->exists() ) {
-                               $messages[$flag] = $msg->escaped();
-                       }
-               }
-
-               return $messages[$flag];
-       }
-
        /**
         * Name of the log.
         * @return Message