111 parent::__construct( $filterDefinition );
113 if ( isset( $filterDefinition[
'showHide'] ) ) {
114 $this->showHide = $filterDefinition[
'showHide'];
117 $this->isReplacedInStructuredUi = $filterDefinition[
'isReplacedInStructuredUi'] ??
false;
119 if ( isset( $filterDefinition[
'default'] ) ) {
120 $this->
setDefault( $filterDefinition[
'default'] );
122 throw new InvalidArgumentException(
'You must set a default' );
125 if ( isset( $filterDefinition[
'queryCallable'] ) ) {
126 $this->queryCallable = $filterDefinition[
'queryCallable'];
129 $this->activeValue = $filterDefinition[
'activeValue'] ??
true;
139 return $this->isReplacedInStructuredUi && $structuredUI ?
140 !$this->activeValue :
173 return $this->isReplacedInStructuredUi ||
174 parent::isFeatureAvailableOnStructuredUi();
190 &$tables, &$fields, &$conds, &$query_options, &$join_conds
192 if ( $this->queryCallable ===
null ) {
197 get_class( $specialPage ),
212 $output = parent::getJsData();
223 return !$opts[ $this->
getName() ] &&
227 return $opts[ $sibling->
getName() ];
238 if ( $this->isReplacedInStructuredUi && $isStructuredUI ) {
Represents a hide-based boolean filter (used on ChangesListSpecialPage and descendants)
displaysOnUnstructuredUi()
Checks whether the filter should display on the unstructured UI.bool Whether to display
isSelected(FormOptions $opts)
Checks whether this filter is selected in the provided options.bool
isActive(FormOptions $opts, $isStructuredUI)
__construct( $filterDefinition)
Create a new filter with the specified configuration.
modifyQuery(IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds)
Modifies the query to include the filter.
getJsData()
Gets the JS data required by the front-end of the structured UI.array Associative array Data required...
setDefault( $defaultValue)
Sets default.
bool $isReplacedInStructuredUi
Whether there is a feature designed to replace this filter available on the structured UI.
string $showHide
Main unstructured UI i18n key.
bool $defaultValue
Default.
isFeatureAvailableOnStructuredUi()
Checks whether an equivalent feature for this filter is available on the structured UI....
bool $activeValue
Value that defined when this filter is considered active.
getDefault( $structuredUI=false)
Get the default value.
callable $queryCallable
Callable used to do the actual query modification; see constructor.
Represents a filter (used on ChangesListSpecialPage and descendants)
getSiblings()
Get filters in the same group.
Special page which uses a ChangesList to show query results.
getContext()
Gets the context this SpecialPage is executed in.