Page MenuHomePhabricator
Authored By
bzimport
Nov 21 2014, 9:10 PM
Size
9 KB
Referenced Files
None
Subscribers
None
Index: includes/SpecialRecentchangeslinked.php
===================================================================
--- includes/SpecialRecentchangeslinked.php (revision 13461)
+++ includes/SpecialRecentchangeslinked.php (working copy)
@@ -133,14 +133,15 @@
$wgOut->addHTML("&lt; ".$sk->makeKnownLinkObj($nt, "", "redirect=no" )."<br />\n");
$note = wfMsg( "rcnote", $limit, $days );
$wgOut->addHTML( "<hr />\n{$note}\n<br />" );
-
- $note = rcDayLimitlinks( $days, $limit, "Recentchangeslinked",
+
+ $list = ChangesList::newFromUser( $wgUser );
+
+ $note = rcDayLimitlinks( $days, $limit, $list->usePatrol(), "Recentchangeslinked",
"target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}",
false, $mlink );
$wgOut->addHTML( $note."\n" );
- $list = ChangesList::newFromUser( $wgUser );
$s = $list->beginRecentChangesList();
$count = $dbr->numRows( $res );
Index: includes/SpecialRecentchanges.php
===================================================================
--- includes/SpecialRecentchanges.php (revision 13461)
+++ includes/SpecialRecentchanges.php (working copy)
@@ -34,8 +34,8 @@
/* bool */ 'hidebots' => true,
/* bool */ 'hideanons' => false,
/* bool */ 'hideliu' => false,
+ /* bool */ 'hidemyself' => false,
/* bool */ 'hidepatrolled' => false,
- /* bool */ 'hidemyself' => false,
/* text */ 'from' => '',
/* text */ 'namespace' => null,
/* bool */ 'invert' => false,
@@ -72,8 +72,8 @@
$hidebots = $wgRequest->getBool( 'hidebots', $defaults['hidebots'] );
$hideanons = $wgRequest->getBool( 'hideanons', $defaults['hideanons'] );
$hideliu = $wgRequest->getBool( 'hideliu', $defaults['hideliu'] );
+ $hidemyself = $wgRequest->getBool ( 'hidemyself', $defaults['hidemyself'] );
$hidepatrolled = $wgRequest->getBool( 'hidepatrolled', $defaults['hidepatrolled'] );
- $hidemyself = $wgRequest->getBool ( 'hidemyself', $defaults['hidemyself'] );
$from = $wgRequest->getVal( 'from', $defaults['from'] );
# Get query parameters from path
@@ -84,10 +84,10 @@
if ( 'bots' == $bit ) $hidebots = 0;
if ( 'hideminor' == $bit ) $hideminor = 1;
if ( 'minor' == $bit ) $hideminor = 0;
+ if ( 'hideanons' == $bit ) $hideanons = 1;
if ( 'hideliu' == $bit ) $hideliu = 1;
+ if ( 'hidemyself' == $bit ) $hidemyself = 1;
if ( 'hidepatrolled' == $bit ) $hidepatrolled = 1;
- if ( 'hideanons' == $bit ) $hideanons = 1;
- if ( 'hidemyself' == $bit ) $hidemyself = 1;
if ( is_numeric( $bit ) ) {
$limit = $bit;
@@ -142,10 +142,8 @@
# Form WHERE fragments for all the options
$hidem = $hideminor ? 'AND rc_minor = 0' : '';
$hidem .= $hidebots ? ' AND rc_bot = 0' : '';
+ $hidem .= $hideanons ? ' AND rc_user != 0' : '';
$hidem .= $hideliu ? ' AND rc_user = 0' : '';
- $hidem .= $hidepatrolled ? ' AND rc_patrolled = 0' : '';
- $hidem .= $hideanons ? ' AND rc_user != 0' : '';
-
if( $hidemyself ) {
if( $wgUser->getID() ) {
$hidem .= ' AND rc_user != ' . $wgUser->getID();
@@ -153,6 +151,7 @@
$hidem .= ' AND rc_user_text != ' . $dbr->addQuotes( $wgUser->getName() );
}
}
+ $hidem .= $hidepatrolled ? ' AND rc_patrolled = 0' : '';
# Namespace filtering
$hidem .= is_null( $namespace ) ? '' : ' AND rc_namespace' . ($invert ? '!=' : '=') . $namespace;
@@ -196,7 +195,9 @@
// Run existence checks
$batch->execute();
$any = $wgRequest->getBool( 'categories_any', $defaults['categories_any']);
-
+
+ $list = ChangesList::newFromUser( $wgUser );
+
// Output header
if ( !$specialPage->including() ) {
$wgOut->addWikiText( wfMsgForContent( "recentchangestext" ) );
@@ -210,23 +211,21 @@
wfAppendToArrayIfNotDefault( 'hidebots', $hidebots, $defaults, $nondefaults);
wfAppendToArrayIfNotDefault( 'hideanons', $hideanons, $defaults, $nondefaults );
wfAppendToArrayIfNotDefault( 'hideliu', $hideliu, $defaults, $nondefaults);
+ wfAppendToArrayIfNotDefault( 'hidemyself', $hidemyself, $defaults, $nondefaults);
wfAppendToArrayIfNotDefault( 'hidepatrolled', $hidepatrolled, $defaults, $nondefaults);
- wfAppendToArrayIfNotDefault( 'hidemyself', $hidemyself, $defaults, $nondefaults);
wfAppendToArrayIfNotDefault( 'from', $from, $defaults, $nondefaults);
wfAppendToArrayIfNotDefault( 'namespace', $namespace, $defaults, $nondefaults);
wfAppendToArrayIfNotDefault( 'invert', $invert, $defaults, $nondefaults);
wfAppendToArrayIfNotDefault( 'categories_any', $any, $defaults, $nondefaults);
// Add end of the texts
- $wgOut->addHTML( '<div class="rcoptions">' . rcOptionsPanel( $defaults, $nondefaults ) . "\n" );
+ $wgOut->addHTML( '<div class="rcoptions">' . rcOptionsPanel( $defaults, $nondefaults, $list->usePatrol() ) . "\n" );
$wgOut->addHTML( rcNamespaceForm( $namespace, $invert, $nondefaults, $any ) . '</div>'."\n");
}
// And now for the content
$sk = $wgUser->getSkin();
$wgOut->setSyndicated( true );
-
- $list = ChangesList::newFromUser( $wgUser );
if ( $wgAllowCategorizedRecentChanges ) {
$categories = trim ( $wgRequest->getVal ( 'categories' , "" ) ) ;
@@ -445,8 +444,8 @@
/**
* Used by Recentchangeslinked
*/
-function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall = false, $minorLink = '',
- $botLink = '', $liuLink = '', $patrLink = '', $myselfLink = '' ) {
+function rcDayLimitLinks( $days, $limit, $usePatrol, $page='Recentchanges', $more='', $doall = false,
+ $minorLink = '', $botLink = '', $anonsLink = '', $liuLink = '', $myselfLink = '', $patrLink = '' ) {
if ($more != '') $more .= '&';
$cl = rcCountLink( 50, $days, $page, $more ) . ' | ' .
rcCountLink( 100, $days, $page, $more ) . ' | ' .
@@ -459,7 +458,16 @@
rcDaysLink( $limit, 14, $page, $more ) . ' | ' .
rcDaysLink( $limit, 30, $page, $more ) .
( $doall ? ( ' | ' . rcDaysLink( $limit, 0, $page, $more ) ) : '' );
- $shm = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $myselfLink );
+ $shm = null;
+ if ($usePatrol)
+ {
+ $shm = wfMsg( 'showhidepatrolled', $minorLink, $botLink, $anonsLink, $liuLink, $myselfLink,
+ $patrLink );
+ }
+ else
+ {
+ $shm = wfMsg( 'showhide', $minorLink, $botLink, $liuLink, $anonsLink, $myselfLink );
+ }
$note = wfMsg( 'rclinks', $cl, $dl, $shm );
return $note;
}
@@ -478,7 +486,7 @@
/**
* Creates the options panel
*/
-function rcOptionsPanel( $defaults, $nondefaults ) {
+function rcOptionsPanel( $defaults, $nondefaults, $usePatrol ) {
global $wgLang;
$options = $nondefaults + $defaults;
@@ -518,11 +526,19 @@
array( 'hideanons' => 1 - $options['hideanons'] ), $nondefaults );
$liuLink = makeOptionsLink( $showhide[1-$options['hideliu']],
array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults);
- $patrLink = makeOptionsLink( $showhide[1-$options['hidepatrolled']],
- array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults);
$myselfLink = makeOptionsLink( $showhide[1-$options['hidemyself']],
array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults);
- $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $myselfLink, $anonsLink );
+ $hl = null;
+ if ($usePatrol)
+ {
+ $patrLink = makeOptionsLink( $showhide[1-$options['hidepatrolled']],
+ array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults);
+ $hl = wfMsg( 'showhidepatrolled', $minorLink, $botLink, $anonsLink, $liuLink, $myselfLink, $patrLink );
+ }
+ else
+ {
+ $hl = wfMsg( 'showhide', $minorLink, $botLink, $anonsLink, $liuLink, $myselfLink );
+ }
// show from this onward link
$now = $wgLang->timeanddate( wfTimestampNow(), true );
Index: languages/Messages.php
===================================================================
--- languages/Messages.php (revision 13461)
+++ languages/Messages.php (working copy)
@@ -784,7 +784,8 @@
'rcnote' => "Below are the last <strong>$1</strong> changes in last <strong>$2</strong> days.",
'rcnotefrom' => "Below are the changes since <b>$2</b> (up to <b>$1</b> shown).",
'rclistfrom' => "Show new changes starting from $1",
-'showhideminor' => "$1 minor edits | $2 bots | $3 logged in users | $6 anonymous users | $4 patrolled edits | $5 my edits",
+'showhide' => "$1 minor edits | $2 bots | $3 anonymous users | $4 logged in users | $5 my edits",
+'showhidepatrolled' => "$1 minor edits | $2 bots | $3 anonymous users | $4 logged in users | $5 my edits | $6 patrolled edits",
'rclinks' => "Show last $1 changes in last $2 days<br />$3",
'rchide' => "in $4 form; $1 minor edits; $2 secondary namespaces; $3 multiple edits.",
'rcliu' => "; $1 edits from logged in users",
Index: languages/MessagesHe.php
===================================================================
--- languages/MessagesHe.php (revision 13461)
+++ languages/MessagesHe.php (working copy)
@@ -717,7 +717,8 @@
"rcnote" => "להלן <b>$1</b> השינויים האחרונים שבוצעו ב־$2 הימים האחרונים:",
"rcnotefrom" => "להלן <b>$1</b> השינויים האחרונים שבוצעו החל מתאריך <b>$2</b>:",
"rclistfrom" => "הצג שינויים חדשים החל מ־$1",
-"showhideminor" => "$1 שינויים משניים | $2 בוטים | $3 משתמשים רשומים | $4 עריכות בדוקות | $5 עריכות שלי",
+"showhide" => "$1 שינויים משניים | $2 בוטים |$3 משתמשים אנונימיים | $4 משתמשים רשומים | $5 עריכות שלי",
+'showhidepatrolled' => "$1 שינויים משניים | $2 בוטים |$3 משתמשים אנונימיים | $4 משתמשים רשומים | $5 עריכות שלי | $6 עריכות בדוקות",
"rclinks" => "הצג $1 שינויים אחרונים ב-$2 הימים האחרונים.<br /> $3",
"rchide" => "ב-$4 טפסים; $1 שינויים משניים; $2 מרחבי שמות מיוחדים; $3 שינויים כפולים.",
'rcliu' => "; $1 עריכות ממשתמשים רשומים",

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2277
Default Alt Text
1.patch (9 KB)

Event Timeline