return false;
}
- if (!$cascade) {
+ if( !$cascade ) {
$cascade = false;
}
$encodedExpiry = Block::encodeExpiry($expiry, $dbw );
- $expiry_description = '';
- if ( $encodedExpiry != 'infinity' ) {
- $expiry_description = ' (' . wfMsgForContent( 'protect-expiring', $wgContLang->timeanddate( $expiry, false, false ) ).')';
- }
-
# Prepare a null revision to be added to the history
$modified = $current != '' && $protect;
if ( $protect ) {
}
}
- $cascade_description = '';
- if ($cascade) {
- $cascade_description = ' ['.wfMsg('protect-summary-cascade').']';
- }
-
if( $reason )
$comment .= ": $reason";
- if( $protect )
- $comment .= " [$updated]";
- if ( $expiry_description && $protect )
- $comment .= "$expiry_description";
- if ( $cascade )
- $comment .= "$cascade_description";
# Update restrictions table
foreach( $limit as $action => $restrictions ) {
# Update the protection log
$log = new LogPage( 'protect' );
if( $protect ) {
- $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle,
- trim( $reason . " [$updated]$cascade_description$expiry_description" ) );
+ $params = array($updated,$encodedExpiry,$cascade ? 'cascade' : '');
+ $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, trim( $reason), $params );
} else {
$log->addEntry( 'unprotect', $this->mTitle, $reason );
}
'action=unblock&ip=' . urlencode( $row->log_title ) ) . ')';
// Show change protection link
} else if( self::typeAction($row,'protect',array('modify','protect','unprotect')) ) {
- $revert = '(' . $this->skin->makeKnownLinkObj( $title, $this->message['hist'],
+ 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'],
'action=history&offset=' . urlencode($row->log_timestamp) ) . ')';
if( $wgUser->isAllowed('protect') && $row->log_action != 'unprotect' ) {
$revert .= ' (' . $this->skin->makeKnownLinkObj( $title, $this->message['protect_change'],