From: Raimond Spekking Date: Fri, 26 Dec 2008 12:07:42 +0000 (+0000) Subject: * Special:Log: Add 'change protection' link for unprotected pages too X-Git-Tag: 1.31.0-rc.0~43766 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=0202aeec2cc4c28c657845062e3bbf2696481172;p=lhc%2Fweb%2Fwiklou.git * Special:Log: Add 'change protection' link for unprotected pages too * For protection log lines: Change format '(hist) (change)' to '(hist | change)' * Precache 'pipe-separator' --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4f050389cf..c65a521a77 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -247,6 +247,7 @@ The following extensions are migrated into MediaWiki 1.14: avoiding the need to manually update for DST. Patch by Brad Jorsch. * (bug 2585) HTTP 404 return code is now given for a page view if the page does not exist, allowing spiders and link checkers to detect broken links. +* Special:Log: Add 'change protection' link for unprotected pages too === Bug fixes in 1.14 === diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index aae44585ab..3a626548dc 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -38,10 +38,10 @@ class LogEventsList { private function preCacheMessages() { // Precache various messages if( !isset( $this->message ) ) { - $messages = array('revertmerge','protect_change','unblocklink','change-blocklink', - 'revertmove','undeletelink','revdel-restore','rev-delundel','hist'); + $messages = array( 'revertmerge', 'protect_change', 'unblocklink', 'change-blocklink', + 'revertmove', 'undeletelink', 'revdel-restore', 'rev-delundel', 'hist', 'pipe-separator' ); foreach( $messages as $msg ) { - $this->message[$msg] = wfMsgExt( $msg, array( 'escape') ); + $this->message[$msg] = wfMsgExt( $msg, array( 'escape' ) ); } } } @@ -276,19 +276,27 @@ class LogEventsList { array(), array( 'action' => 'unblock', 'ip' => $row->log_title ), 'known' ) - . ' ' . wfMsg( 'pipe-separator' ) . ' ' . + . ' ' . $this->message['pipe-separator'] . ' ' . $this->skin->link( SpecialPage::getTitleFor( 'Blockip', $row->log_title ), $this->message['change-blocklink'], array(), array(), 'known' ) . ')'; // Show change protection link - } else if( self::typeAction($row,'protect',array('modify','protect','unprotect')) ) { - $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'], - 'action=unprotect' ) . ')'; + } else if( self::typeAction( $row, 'protect', array( 'modify', 'protect', 'unprotect' ) ) ) { + $revert .= ' (' . + $this->skin->link( $title, + $this->message['hist'], + array(), + array( 'action' => 'history', 'offset' => $row->log_timestamp ) ); + if( $wgUser->isAllowed( 'protect' ) ) { + $revert .= ' ' . $this->message['pipe-separator'] . ' ' . + $this->skin->link( $title, + $this->message['protect_change'], + array(), + array( 'action' => 'protect' ), + 'known' ); } + $revert .= ')'; // Show unmerge link } else if( self::typeAction($row,'merge','merge','mergehistory') ) { $merge = SpecialPage::getTitleFor( 'Mergehistory' );