Gerrit Patch Uploader has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/129933

Change subject: Allow namespace inversion on Whatlinkshere
......................................................................

Allow namespace inversion on Whatlinkshere

This is basically the same as change 49365.

Bug: 16848
Change-Id: Id6cbdaca50c81129352962996dc5360f64026ed1
---
M includes/specials/SpecialWhatlinkshere.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 22 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/129933/1

diff --git a/includes/specials/SpecialWhatlinkshere.php 
b/includes/specials/SpecialWhatlinkshere.php
index 0587649..10bce69 100644
--- a/includes/specials/SpecialWhatlinkshere.php
+++ b/includes/specials/SpecialWhatlinkshere.php
@@ -59,6 +59,7 @@
                $opts->add( 'hidetrans', false );
                $opts->add( 'hidelinks', false );
                $opts->add( 'hideimages', false );
+               $opts->add( 'invert', false );
 
                $opts->fetchValuesFromRequest( $this->getRequest() );
                $opts->validateIntBounds( 'limit', 0, 5000 );
@@ -138,9 +139,15 @@
 
                $namespace = $this->opts->getValue( 'namespace' );
                if ( is_int( $namespace ) ) {
-                       $plConds['page_namespace'] = $namespace;
-                       $tlConds['page_namespace'] = $namespace;
-                       $ilConds['page_namespace'] = $namespace;
+                       if ( $this->opts->getValue( 'invert' ) ) {
+                               $plConds[] = 'page_namespace != ' . 
$dbr->addQuotes( $namespace );
+                               $tlConds[] = 'page_namespace != ' . 
$dbr->addQuotes( $namespace );
+                               $ilConds[] = 'page_namespace != ' . 
$dbr->addQuotes( $namespace );
+                       } else {
+                               $plConds['page_namespace'] = $namespace;
+                               $tlConds['page_namespace'] = $namespace;
+                               $ilConds['page_namespace'] = $namespace;
+                       }
                }
 
                if ( $from ) {
@@ -410,6 +417,7 @@
 
                $target = $this->target ? $this->target->getPrefixedText() : '';
                $namespace = $this->opts->consumeValue( 'namespace' );
+               $nsinvert = $this->opts->consumeValue( 'invert' );
 
                # Build up the form
                $f = Xml::openElement( 'form', array( 'action' => $wgScript ) );
@@ -441,6 +449,15 @@
                        )
                );
 
+               $f .= ' ' .
+                       Xml::checkLabel(
+                               $this->msg( 'invert' )->text(),
+                               'invert',
+                               'nsinvert',
+                               $nsinvert,
+                               array( 'title' => $this->msg( 
'tooltip-whatlinkshere-invert' )->text() )
+                       );
+
                $f .= ' ';
 
                # Submit
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index b3ada83..940c855 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1986,6 +1986,7 @@
     "namespace": "Namespace:",
     "invert": "Invert selection",
     "tooltip-invert": "Check this box to hide changes to pages within the 
selected namespace (and the associated namespace if checked)",
+    "tooltip-whatlinkshere-invert": "Check this box to hide links from pages 
within the selected namespace",
     "namespace_association": "Associated namespace",
     "tooltip-namespace_association": "Check this box to also include the talk 
or subject namespace associated with the selected namespace",
     "blanknamespace": "(Main)",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 86737f4..d711922 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -2148,6 +2148,7 @@
        "namespace": "This message is located at 
[[Special:Contributions]].\n{{Identical|Namespace}}",
        "invert": "Displayed in [[Special:RecentChanges|RecentChanges]], 
[[Special:RecentChangesLinked|RecentChangesLinked]] and 
[[Special:Watchlist|Watchlist]].\n\nThis message means \"Invert selection of 
namespace\".\n\nThis message has a tooltip 
{{msg-mw|tooltip-invert}}\n{{Identical|Invert selection}}",
        "tooltip-invert": "Used in [[Special:Recentchanges]] as a tooltip for 
the invert checkbox. See also the message {{msg-mw|invert}}",
+       "tooltip-whatlinkshere-invert": "Used in [[Special:Whatlinkshere]] as a 
tooltip for the invert checkbox.\n\nSee also:\n* {{msg-mw|tooltip-invert}}\n* 
{{msg-mw|invert}}",
        "namespace_association": "Used in [[Special:Recentchanges]] with a 
checkbox which selects the associated namespace to be added to the selected 
namespace, so that both are searched (or excluded depending on another checkbox 
selection). The association is between a namespace and its talk 
namespace.\n\nThis message has a tooltip {{msg-mw|tooltip-namespace 
association}}",
        "tooltip-namespace_association": "Used in [[Special:Recentchanges]] as 
a tooltip for the associated namespace checkbox.\n\nSee also:\n* 
{{msg-mw|Namespace association}}",
        "blanknamespace": "Name for main namespace (blank namespace) in 
drop-down menus at [[Special:RecentChanges]] and other special 
pages.\n{{Identical|Main}}",

-- 
To view, visit https://gerrit.wikimedia.org/r/129933
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6cbdaca50c81129352962996dc5360f64026ed1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: Gerrit Patch Uploader <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to