From: Aaron Schulz Date: Wed, 2 Apr 2008 19:01:41 +0000 (+0000) Subject: Use isDeleted() X-Git-Tag: 1.31.0-rc.0~48653 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=d789fda50a25b159d2faca9a34a16e9a90be8178;p=lhc%2Fweb%2Fwiklou.git Use isDeleted() --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 27ec3f711f..a81068df5c 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -19,6 +19,7 @@ class LogEventsList { const NO_ACTION_LINK = 1; + private $skin; public $flags; @@ -252,7 +253,7 @@ class LogEventsList { } } // Event description - if( $row->log_deleted & LogPage::DELETED_ACTION ) { + if( self::isDeleted($row,LogPage::DELETED_ACTION) ) { $action = '' . wfMsgHtml('rev-deleted-event') . ''; } else { $action = LogPage::actionText( $row->log_type, $row->log_action, $title, $this->skin, $paramArray, true ); @@ -287,28 +288,6 @@ class LogEventsList { return "($del)"; } - /** - * SQL clause to skip forbidden log types for this user - * @param Database $db - * @returns mixed (string or false) - */ - public static function getExcludeClause( $db ) { - global $wgLogRestrictions, $wgUser; - // Reset the array, clears extra "where" clauses when $par is used - $hiddenLogs = array(); - // Don't show private logs to unpriviledged users - foreach( $wgLogRestrictions as $logtype => $right ) { - if( !$wgUser->isAllowed($right) ) { - $safetype = $db->strencode( $logtype ); - $hiddenLogs[] = "'$safetype'"; - } - } - if( !empty($hiddenLogs) ) { - return 'log_type NOT IN(' . implode(',',$hiddenLogs) . ')'; - } - return false; - } - /** * Determine if the current user is allowed to view a particular * field of this log row, if it's marked as deleted. @@ -337,6 +316,28 @@ class LogEventsList { public static function isDeleted( $row, $field ) { return ($row->log_deleted & $field) == $field; } + + /** + * SQL clause to skip forbidden log types for this user + * @param Database $db + * @returns mixed (string or false) + */ + public static function getExcludeClause( $db ) { + global $wgLogRestrictions, $wgUser; + // Reset the array, clears extra "where" clauses when $par is used + $hiddenLogs = array(); + // Don't show private logs to unpriviledged users + foreach( $wgLogRestrictions as $logtype => $right ) { + if( !$wgUser->isAllowed($right) ) { + $safetype = $db->strencode( $logtype ); + $hiddenLogs[] = "'$safetype'"; + } + } + if( !empty($hiddenLogs) ) { + return 'log_type NOT IN(' . implode(',',$hiddenLogs) . ')'; + } + return false; + } } /**