Show protection details in RC too
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 10 Sep 2008 22:06:41 +0000 (22:06 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 10 Sep 2008 22:06:41 +0000 (22:06 +0000)
includes/LogEventsList.php
includes/LogPage.php

index 075860a..b189667 100644 (file)
@@ -239,18 +239,7 @@ class LogEventsList {
                                'action=unblock&ip=' . urlencode( $row->log_title ) ) . ')';
                // Show change protection link
                } else if( self::typeAction($row,'protect',array('modify','protect','unprotect')) ) {
-                       if( $row->log_type == 'protect' && count($paramArray) == 3 ) {
-                               $revert .= " [{$paramArray[0]}]"; // the restrictions
-                               if( $paramArray[1] != 'infinity' ) {
-                                       $revert .= ' (' . wfMsgForContent( 'protect-expiring', 
-                                               $wgContLang->timeanddate( $paramArray[1], false, false ) ).')';
-                               }
-                               if( $paramArray[2] ) {
-                                       $revert .= ' ['.wfMsg('protect-summary-cascade').']';
-                               }
-                       }
-                       $revert = $revert ? "$revert " : "";
-                       $revert .= '(' .  $this->skin->makeKnownLinkObj( $title, $this->message['hist'], 
+                       $revert .= ' (' .  $this->skin->makeKnownLinkObj( $title, $this->message['hist'], 
                                'action=history&offset=' . urlencode($row->log_timestamp) ) . ')';
                        if( $wgUser->isAllowed('protect') && $row->log_action != 'unprotect' ) {
                                $revert .= ' (' .  $this->skin->makeKnownLinkObj( $title, $this->message['protect_change'], 
index 983b952..e039e33 100644 (file)
@@ -242,18 +242,28 @@ class LogPage {
                                                $rv = wfMsgForContent( $wgLogActions[$key], $titleLink );
                                        }
                                } else {
+                                       $details = '';
                                        array_unshift( $params, $titleLink );
                                        if ( $key == 'block/block' || $key == 'suppress/block' ) {
                                                if ( $skin ) {
-                                                       $params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' . $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
+                                                       $params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' . 
+                                                               $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
                                                } else {
                                                        $params[1] = $wgContLang->translateBlockExpiry( $params[1] );
                                                }
-                                               $params[2] = isset( $params[2] )
-                                                                               ? self::formatBlockFlags( $params[2], is_null( $skin ) )
-                                                                               : '';
+                                               $params[2] = isset( $params[2] ) ? 
+                                                       self::formatBlockFlags( $params[2], is_null( $skin ) ) : '';
+                                       } else if ( $type == 'protect' && count($params) == 4 ) {
+                                               $details .= " [{$params[1]}]"; // the restrictions
+                                               if( $params[2] != 'infinity' ) {
+                                                       $details .= ' (' . wfMsgForContent( 'protect-expiring', 
+                                                               $wgContLang->timeanddate( $params[2], false, false ) ).')';
+                                               }
+                                               if( $params[3] ) {
+                                                       $details .= ' ['.wfMsg('protect-summary-cascade').']';
+                                               }
                                        }
-                                       $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin );
+                                       $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin ) . $details;
                                }
                        }
                } else {