* Don't show "hide patrolled edits" link for people that can't see the patrol markings
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 31 Mar 2008 18:13:48 +0000 (18:13 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 31 Mar 2008 18:13:48 +0000 (18:13 +0000)
* Have this and ChangesList use the same usePatrol() check

includes/ChangesList.php
includes/SpecialRecentchanges.php

index c2bd5ec..115b922 100644 (file)
@@ -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')) );
        }
index 5553c18..382833d 100644 (file)
@@ -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 );