Go to the documentation of this file.
43 const TYPE =
'string_options';
114 if ( !isset( $groupDefinition[
'isFullCoverage'] ) ) {
115 throw new MWException(
'You must specify isFullCoverage' );
120 parent::__construct( $groupDefinition );
122 $this->queryCallable = $groupDefinition[
'queryCallable'];
124 if ( isset( $groupDefinition[
'default'] ) ) {
125 $this->
setDefault( $groupDefinition[
'default'] );
127 throw new MWException(
'You must specify a default' );
169 $this->filters[$filter->
getName()] = $filter;
188 &
$tables, &$fields, &$conds, &$query_options, &$join_conds,
$value
190 $allowedFilterNames = [];
191 foreach ( $this->filters
as $filter ) {
192 $allowedFilterNames[] = $filter->getName();
195 if (
$value === self::ALL ) {
196 $selectedValues = $allowedFilterNames;
198 $selectedValues = explode( self::SEPARATOR, strtolower(
$value ) );
201 $selectedValues = array_intersect(
212 if (
count( $selectedValues ) === 0 ) {
216 sort( $selectedValues );
218 call_user_func_array(
219 $this->queryCallable,
221 get_class( $specialPage ),
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
An individual filter in a ChangesListStringOptionsFilterGroup.
modifyQuery(IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, $value)
Modifies the query to include the filter group.
createFilter(array $filterDefinition)
@inheritDoc
isPerGroupRequestParameter()
@inheritDoc
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
Special page which uses a ChangesList to show query results.
Represents a filter group (used on ChangesListSpecialPage and descendants)
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
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
const SEPARATOR
Delimiter.
__construct(array $groupDefinition)
Create a new filter group with the specified configuration.
const ALL
Signifies that all options in the group are selected.
getContext()
Gets the context this SpecialPage is executed in.
$defaultValue
Defaul parameter value.
setDefault( $defaultValue)
Sets default of filter group.
$queryCallable
Callable used to do the actual query modification; see constructor.
const NONE
Signifies that no options in the group are selected, meaning the group has no effect.
getDefault()
Gets default of filter group.
registerFilter(ChangesListStringOptionsFilter $filter)
Registers a filter in this group.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Represents a filter group with multiple string options.
const TYPE
Type marker, used by JavaScript.
the array() calling protocol came about after MediaWiki 1.4rc1.