Go to the documentation of this file.
41 const TYPE =
'string_options';
112 if ( !isset( $groupDefinition[
'isFullCoverage'] ) ) {
113 throw new MWException(
'You must specify isFullCoverage' );
118 parent::__construct( $groupDefinition );
120 $this->queryCallable = $groupDefinition[
'queryCallable'];
122 if ( isset( $groupDefinition[
'default'] ) ) {
123 $this->
setDefault( $groupDefinition[
'default'] );
125 throw new MWException(
'You must specify a default' );
167 &
$tables, &$fields, &$conds, &$query_options, &$join_conds,
170 if ( !$this->
isActive( $isStructuredFiltersEnabled ) ) {
175 $allowedFilterNames = [];
177 $allowedFilterNames[] =
$filter->getName();
180 if (
$value === self::ALL ) {
181 $selectedValues = $allowedFilterNames;
183 $selectedValues = explode( self::SEPARATOR, strtolower(
$value ) );
186 $selectedValues = array_intersect(
197 if (
count( $selectedValues ) === 0 ) {
201 sort( $selectedValues );
204 get_class( $specialPage ),
243 return $isStructuredUI;
An individual filter in a ChangesListStringOptionsFilterGroup.
createFilter(array $filterDefinition)
@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
isActive( $isStructuredUI)
Check if this filter group is currently active.
Represents a filter group (used on ChangesListSpecialPage and descendants)
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.
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
const ALL
Signifies that all options in the group are selected.
modifyQuery(IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, FormOptions $opts, $isStructuredFiltersEnabled)
@inheritDoc
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
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
addOptions(FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled)
@inheritDoc
Represents a filter group with multiple string options.
const TYPE
Type marker, used by JavaScript.