Go to the documentation of this file.
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 ),
221 return !$opts[ $this->
getName() ] &&
225 return $opts[ $sibling->
getName() ];
236 if ( $this->isReplacedInStructuredUi && $isStructuredUI ) {
getDefault( $structuredUI=false)
Get the default value.
isSelected(FormOptions $opts)
@inheritDoc
Special page which uses a ChangesList to show query results.
this hook is for auditing only 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
Represents a hide-based boolean filter (used on ChangesListSpecialPage and descendants)
isFeatureAvailableOnStructuredUi()
@inheritDoc
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
isActive(FormOptions $opts, $isStructuredUI)
__construct( $filterDefinition)
Create a new filter with the specified configuration.
getSiblings()
Get filters in the same group.
$activeValue
Value that defined when this filter is considered active.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
setDefault( $defaultValue)
Sets default.
getContext()
Gets the context this SpecialPage is executed in.
modifyQuery(IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds)
Modifies the query to include the filter.
$queryCallable
Callable used to do the actual query modification; see constructor.
displaysOnUnstructuredUi()
@inheritDoc
$isReplacedInStructuredUi
Whether there is a feature designed to replace this filter available on the structured UI.
Represents a filter (used on ChangesListSpecialPage and descendants)
$showHide
Main unstructured UI i18n key.