117 parent::__construct( $filterDefinition );
119 if ( isset( $filterDefinition[
'showHide'] ) ) {
120 $this->showHide = $filterDefinition[
'showHide'];
123 if ( isset( $filterDefinition[
'isReplacedInStructuredUi'] ) ) {
124 $this->isReplacedInStructuredUi = $filterDefinition[
'isReplacedInStructuredUi'];
126 $this->isReplacedInStructuredUi =
false;
129 if ( isset( $filterDefinition[
'default'] ) ) {
130 $this->
setDefault( $filterDefinition[
'default'] );
135 if ( isset( $filterDefinition[
'queryCallable'] ) ) {
136 $this->queryCallable = $filterDefinition[
'queryCallable'];
139 if ( isset( $filterDefinition[
'activeValue'] ) ) {
140 $this->activeValue = $filterDefinition[
'activeValue'];
142 $this->activeValue =
true;
153 return $this->isReplacedInStructuredUi && $structuredUI ?
154 !$this->activeValue :
187 return $this->isReplacedInStructuredUi ||
188 parent::isFeatureAvailableOnStructuredUi();
204 &
$tables, &$fields, &$conds, &$query_options, &$join_conds
206 if ( $this->queryCallable ===
null ) {
210 call_user_func_array(
211 $this->queryCallable,
213 get_class( $specialPage ),
240 return !$opts[ $this->
getName() ] &&
244 return $opts[ $sibling->getName() ];
255 if ( $this->isReplacedInStructuredUi && $isStructuredUI ) {
An individual filter in a boolean group.
displaysOnUnstructuredUi()
@inheritDoc
isSelected(FormOptions $opts)
@inheritDoc
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.
setDefault( $defaultValue)
Sets default.
$isReplacedInStructuredUi
Whether there is a feature designed to replace this filter available on the structured UI.
$showHide
Main unstructured UI i18n key.
isFeatureAvailableOnStructuredUi()
@inheritDoc
$activeValue
Value that defined when this filter is considered active.
getDefault( $structuredUI=false)
Get the default value.
$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.
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables