109 parent::__construct( $filterDefinition );
111 if ( isset( $filterDefinition[
'showHide'] ) ) {
112 $this->showHide = $filterDefinition[
'showHide'];
115 $this->isReplacedInStructuredUi = $filterDefinition[
'isReplacedInStructuredUi'] ??
false;
117 if ( isset( $filterDefinition[
'default'] ) ) {
118 $this->
setDefault( $filterDefinition[
'default'] );
123 if ( isset( $filterDefinition[
'queryCallable'] ) ) {
124 $this->queryCallable = $filterDefinition[
'queryCallable'];
127 $this->activeValue = $filterDefinition[
'activeValue'] ??
true;
137 return $this->isReplacedInStructuredUi && $structuredUI ?
138 !$this->activeValue :
171 return $this->isReplacedInStructuredUi ||
172 parent::isFeatureAvailableOnStructuredUi();
188 &$tables, &$fields, &$conds, &$query_options, &$join_conds
190 if ( $this->queryCallable ===
null ) {
195 get_class( $specialPage ),
210 $output = parent::getJsData();
221 return !$opts[ $this->
getName() ] &&
225 return $opts[ $sibling->
getName() ];
236 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.