}
}
- /**
- * Check whether to enable recent changes patrol features
- * @return bool
- */
- public static function usePatrol() {
- global $wgUseRCPatrol, $wgUser;
- return( $wgUseRCPatrol && ($wgUser->isAllowed('patrol') || $wgUser->isAllowed('patrolmarks')) );
- }
-
/**
* Returns the string which indicates the number of watching users
*/
* Format a line using the old system (aka without any javascript).
*/
public function recentChangesLine( &$rc, $watched = false ) {
- global $wgContLang, $wgRCShowChangedSize;
+ global $wgContLang, $wgRCShowChangedSize, $wgUser;
$fname = 'ChangesList::recentChangesLineOld';
wfProfileIn( $fname );
extract( $rc->mAttribs );
# Should patrol-related stuff be shown?
- $unpatrolled = $this->usePatrol() && $rc_patrolled == 0;
+ $unpatrolled = $wgUser->usePatrol() && $rc_patrolled == 0;
$this->insertDateHeader($s,$rc_timestamp);
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*/
public function recentChangesLine( &$baseRC, $watched = false ) {
- global $wgLang, $wgContLang;
+ global $wgLang, $wgContLang, $wgUser;
# Create a specialised object
$rc = RCCacheEntry::newFromParent( $baseRC );
}
# Should patrol-related stuff be shown?
- if( $this->usePatrol() ) {
+ if( $wgUser->usePatrol() ) {
$rc->unpatrolled = !$rc_patrolled;
} else {
$rc->unpatrolled = false;
$hidem = $hideminor ? 'AND rc_minor = 0' : '';
$hidem .= $hidebots ? ' AND rc_bot = 0' : '';
$hidem .= $hideliu && !$forcebot ? ' AND rc_user = 0' : '';
- $hidem .= ( ChangesList::usePatrol() && $hidepatrolled ) ? ' AND rc_patrolled = 0' : '';
+ $hidem .= ($wgUser->usePatrol() && $hidepatrolled ) ? ' AND rc_patrolled = 0' : '';
$hidem .= $hideanons && !$forcebot ? ' AND rc_user != 0' : '';
$hidem .= $forcebot ? ' AND rc_bot = 1' : '';
* @param $nondefaults
*/
function rcOptionsPanel( $defaults, $nondefaults ) {
- global $wgLang, $wgUseRCPatrol;
+ global $wgLang, $wgUser;
$options = $nondefaults + $defaults;
$links[] = wfMsgHtml( 'rcshowhidebots', $botLink );
$links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink );
$links[] = wfMsgHtml( 'rcshowhideliu', $liuLink );
- if( ChangesList::usePatrol() )
+ if( $wgUser->usePatrol() )
$links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink );
$links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink );
$hl = implode( ' | ', $links );
return in_array( $action, $this->getRights() );
}
+
+ /**
+ * Check whether to enable recent changes patrol features for this user
+ * @return bool
+ */
+ public function useRCPatrol() {
+ global $wgUseRCPatrol;
+ return( $wgUseRCPatrol && ($this->isAllowed('patrol') || $this->isAllowed('patrolmarks')) );
+ }
+
+ /**
+ * Check whether to enable recent changes patrol features for this user
+ * @return bool
+ */
+ public function useNPPatrol() {
+ global $wgUseRCPatrol, $wgUseNPPatrol;
+ return( ($wgUseRCPatrol || $wgUseNPPatrol) && ($this->isAllowed('patrol') || $this->isAllowed('patrolmarks')) );
+ }
/**
* Load a skin if it doesn't exist or return it