From: Aaron Schulz Date: Mon, 31 Mar 2008 18:13:48 +0000 (+0000) Subject: * Don't show "hide patrolled edits" link for people that can't see the patrol markings X-Git-Tag: 1.31.0-rc.0~48708 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=2f090b8fdca504556987987e6ff232150100d3aa;p=lhc%2Fweb%2Fwiklou.git * Don't show "hide patrolled edits" link for people that can't see the patrol markings * Have this and ChangesList use the same usePatrol() check --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index c2bd5ecda8..115b92263c 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -261,7 +261,7 @@ class ChangesList { * Check whether to enable recent changes patrol features * @return bool */ - function usePatrol() { + public static function usePatrol() { global $wgUseRCPatrol, $wgUser; return( $wgUseRCPatrol && ($wgUser->isAllowed('patrol') || $wgUser->isAllowed('patrolmarks')) ); } diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 5553c18fdb..382833d181 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -139,7 +139,7 @@ function wfSpecialRecentchanges( $par, $specialPage ) { $hidem = $hideminor ? 'AND rc_minor = 0' : ''; $hidem .= $hidebots ? ' AND rc_bot = 0' : ''; $hidem .= $hideliu ? ' AND rc_user = 0' : ''; - $hidem .= ( $wgUseRCPatrol && $hidepatrolled ) ? ' AND rc_patrolled = 0' : ''; + $hidem .= ( ChangesList::usePatrol() && $hidepatrolled ) ? ' AND rc_patrolled = 0' : ''; $hidem .= $hideanons ? ' AND rc_user != 0' : ''; if( $hidemyself ) { @@ -562,7 +562,7 @@ function rcOptionsPanel( $defaults, $nondefaults ) { $links[] = wfMsgHtml( 'rcshowhidebots', $botLink ); $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink ); $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink ); - if( $wgUseRCPatrol ) + if( ChangesList::usePatrol() ) $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink ); $links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink ); $hl = implode( ' | ', $links );