Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398200 )

Change subject: ChangesListSpecialPage: Add hook to disable structured filters 
UI
......................................................................

ChangesListSpecialPage: Add hook to disable structured filters UI

Extensions can use the ChangesListSpecialPageStructuredFilterUiEnabled
hook to force the structured filters UI to be disabled or enabled.

Bug: T181545
Change-Id: I3a0a139e994a1447b1e783081bcc14e6daee21a1
---
M docs/hooks.txt
M includes/specialpage/ChangesListSpecialPage.php
2 files changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/398200/1

diff --git a/docs/hooks.txt b/docs/hooks.txt
index 29883b2..b3fb92e 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1028,6 +1028,13 @@
 fields.
 $special: ChangesListSpecialPage instance
 
+'ChangesListSpecialPageStructuredFilterUiEnabled': Called to allow extensions 
to
+force-disable or force-enable the structured filters UI. To force-enable, set
+$enabled to true and return false. To force-disable, set $enabled to false and
+return false.
+$special: ChangesListSpecialPage instance
+$enabled: Whether the structured filters UI should be enabled (initially null)
+
 'ChangeTagAfterDelete': Called after a change tag has been deleted (that is,
 removed from all revisions and log entries to which it was applied). This gives
 extensions a chance to take it off their books.
diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index b6d1028..8936b1e 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -1778,6 +1778,13 @@
                        return true;
                }
 
+               // Allow extensions to disable the structured filter UI
+               $enabled = null;
+               Hooks::run( 'ChangesListSpecialPageStructuredFilterUiEnabled', 
[ $this, &$enabled ] );
+               if ( $enabled !== null ) {
+                       return (bool)$enabled;
+               }
+
                return static::checkStructuredFilterUiEnabled(
                        $this->getConfig(),
                        $this->getUser()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a0a139e994a1447b1e783081bcc14e6daee21a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope <r...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to