r40716 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40715‎ | r40716 | r40717 >
Date:22:06, 10 September 2008
Author:aaron
Status:old
Tags:
Comment:
Show protection details in RC too
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -239,18 +239,7 @@
240240 'action=unblock&ip=' . urlencode( $row->log_title ) ) . ')';
241241 // Show change protection link
242242 } else if( self::typeAction($row,'protect',array('modify','protect','unprotect')) ) {
243 - if( $row->log_type == 'protect' && count($paramArray) == 3 ) {
244 - $revert .= " [{$paramArray[0]}]"; // the restrictions
245 - if( $paramArray[1] != 'infinity' ) {
246 - $revert .= ' (' . wfMsgForContent( 'protect-expiring',
247 - $wgContLang->timeanddate( $paramArray[1], false, false ) ).')';
248 - }
249 - if( $paramArray[2] ) {
250 - $revert .= ' ['.wfMsg('protect-summary-cascade').']';
251 - }
252 - }
253 - $revert = $revert ? "$revert " : "";
254 - $revert .= '(' . $this->skin->makeKnownLinkObj( $title, $this->message['hist'],
 243+ $revert .= ' (' . $this->skin->makeKnownLinkObj( $title, $this->message['hist'],
255244 'action=history&offset=' . urlencode($row->log_timestamp) ) . ')';
256245 if( $wgUser->isAllowed('protect') && $row->log_action != 'unprotect' ) {
257246 $revert .= ' (' . $this->skin->makeKnownLinkObj( $title, $this->message['protect_change'],
Index: trunk/phase3/includes/LogPage.php
@@ -242,18 +242,28 @@
243243 $rv = wfMsgForContent( $wgLogActions[$key], $titleLink );
244244 }
245245 } else {
 246+ $details = '';
246247 array_unshift( $params, $titleLink );
247248 if ( $key == 'block/block' || $key == 'suppress/block' ) {
248249 if ( $skin ) {
249 - $params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' . $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
 250+ $params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' .
 251+ $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
250252 } else {
251253 $params[1] = $wgContLang->translateBlockExpiry( $params[1] );
252254 }
253 - $params[2] = isset( $params[2] )
254 - ? self::formatBlockFlags( $params[2], is_null( $skin ) )
255 - : '';
 255+ $params[2] = isset( $params[2] ) ?
 256+ self::formatBlockFlags( $params[2], is_null( $skin ) ) : '';
 257+ } else if ( $type == 'protect' && count($params) == 4 ) {
 258+ $details .= " [{$params[1]}]"; // the restrictions
 259+ if( $params[2] != 'infinity' ) {
 260+ $details .= ' (' . wfMsgForContent( 'protect-expiring',
 261+ $wgContLang->timeanddate( $params[2], false, false ) ).')';
 262+ }
 263+ if( $params[3] ) {
 264+ $details .= ' ['.wfMsg('protect-summary-cascade').']';
 265+ }
256266 }
257 - $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin );
 267+ $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin ) . $details;
258268 }
259269 }
260270 } else {