MediaWiki REL1_39
ChangesListBooleanFilterGroup Class Reference

If the group is active, any unchecked filters will translate to hide parameters in the URL. More...

Inheritance diagram for ChangesListBooleanFilterGroup:
Collaboration diagram for ChangesListBooleanFilterGroup:

Public Member Functions

 __construct (array $groupDefinition)
 Create a new filter group with the specified configuration.
 
 addOptions (FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled)
 All the options represented by this filter group to $opts.
Parameters
FormOptions$opts
bool$allowDefaults
bool$isStructuredFiltersEnabled

 
 modifyQuery (IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, FormOptions $opts, $isStructuredFiltersEnabled)
 Modifies the query to include the filter group.The modification is only done if the filter group is in effect. This means that one or more valid and allowed filters were selected.
Parameters
IDatabase$dbrDatabase, for addQuotes, makeList, and similar
ChangesListSpecialPage$specialPageCurrent special page
array&$tablesArray of tables; see IDatabase::select $table
array&$fieldsArray of fields; see IDatabase::select $vars
array&$condsArray of conditions; see IDatabase::select $conds
array&$query_optionsArray of query options; see IDatabase::select $options
array&$join_condsArray of join conditions; see IDatabase::select $join_conds
FormOptions$optsWrapper for the current request options and their defaults
bool$isStructuredFiltersEnabledTrue if the Structured UI is currently enabled

 
 registerFilter (ChangesListBooleanFilter $filter)
 Registers a filter in this group.
 
- Public Member Functions inherited from ChangesListFilterGroup
 anySelected (FormOptions $opts)
 Check if any filter in this group is selected.
 
 conflictsWith ( $other, $globalKey, $forwardKey, $backwardKey)
 Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object.
 
 getConflictingFilters ()
 Get filters conflicting with this filter group.
 
 getConflictingGroups ()
 Get groups conflicting with this filter group.
 
 getFilter ( $name)
 Get filter by name.
 
 getFilters ()
 
 getJsData ()
 Gets the JS data in the format required by the front-end of the structured UI.
 
 getName ()
 
 getPriority ()
 
 getTitle ()
 
 getType ()
 
 setUnidirectionalConflict ( $other, $globalDescription, $contextDescription)
 Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object.
 

Public Attributes

const TYPE = 'send_unselected_if_any'
 Type marker, used by JavaScript.
 

Protected Member Functions

 createFilter (array $filterDefinition)
 Creates a filter of the appropriate type for this group, from the definition.
Parameters
array$filterDefinition
Returns
ChangesListFilter Filter

 

Additional Inherited Members

- Protected Attributes inherited from ChangesListFilterGroup
array $conflictingFilters = []
 Array of associative arrays with conflict information.
 
array $conflictingGroups = []
 Array of associative arrays with conflict information.
 
ChangesListFilter[] $filters
 Associative array of filters, as ChangesListFilter objects, with filter name as key.
 
bool $isFullCoverage
 Whether this group is full coverage.
 
string $name
 Name (internal identifier)
 
int $priority
 Priority integer.
 
string $title
 i18n key for title
 
string $type
 Type, from a TYPE constant of a subclass.
 
string null $whatsThisBody
 i18n key for body of What's This?
 
string null $whatsThisHeader
 i18n key for header of What's This?
 
string null $whatsThisLinkText
 i18n key for What's This? link
 
string null $whatsThisUrl
 URL of What's This? link.
 

Detailed Description

If the group is active, any unchecked filters will translate to hide parameters in the URL.

E.g. if 'Human (not bot)' is checked, but 'Bot' is unchecked, hidebots=1 will be sent.

Since
1.29 @method ChangesListBooleanFilter[] getFilters()

Definition at line 13 of file ChangesListBooleanFilterGroup.php.

Constructor & Destructor Documentation

◆ __construct()

ChangesListBooleanFilterGroup::__construct ( array $groupDefinition)

Create a new filter group with the specified configuration.

Parameters
array$groupDefinitionConfiguration of group
  • $groupDefinition['name'] string Group name
  • $groupDefinition['title'] string i18n key for title (optional, can be omitted only if none of the filters in the group display in the structured UI)
  • $groupDefinition['priority'] int Priority integer. Higher means higher in the group list.
  • $groupDefinition['filters'] array Numeric array of filter definitions, each of which is an associative array to be passed to the filter constructor. However, 'priority' is optional for the filters. Any filter that has priority unset will be put to the bottom, in the order given.
  • $groupDefinition['whatsThisHeader'] string i18n key for header of "What's This" popup (optional).
  • $groupDefinition['whatsThisBody'] string i18n key for body of "What's This" popup (optional).
  • $groupDefinition['whatsThisUrl'] string URL for main link of "What's This" popup (optional).
  • $groupDefinition['whatsThisLinkText'] string i18n key of text for main link of "What's This" popup (optional).

Reimplemented from ChangesListFilterGroup.

Definition at line 41 of file ChangesListBooleanFilterGroup.php.

References TYPE.

Member Function Documentation

◆ addOptions()

ChangesListBooleanFilterGroup::addOptions ( FormOptions $opts,
$allowDefaults,
$isStructuredFiltersEnabled )

All the options represented by this filter group to $opts.

Parameters
FormOptions$opts
bool$allowDefaults
bool$isStructuredFiltersEnabled

Reimplemented from ChangesListFilterGroup.

Definition at line 84 of file ChangesListBooleanFilterGroup.php.

References FormOptions\add(), and ChangesListFilterGroup\getFilters().

◆ createFilter()

ChangesListBooleanFilterGroup::createFilter ( array $filterDefinition)
protected

Creates a filter of the appropriate type for this group, from the definition.

Parameters
array$filterDefinition
Returns
ChangesListFilter Filter

Reimplemented from ChangesListFilterGroup.

Definition at line 51 of file ChangesListBooleanFilterGroup.php.

◆ modifyQuery()

ChangesListBooleanFilterGroup::modifyQuery ( IDatabase $dbr,
ChangesListSpecialPage $specialPage,
& $tables,
& $fields,
& $conds,
& $query_options,
& $join_conds,
FormOptions $opts,
$isStructuredFiltersEnabled )

Modifies the query to include the filter group.The modification is only done if the filter group is in effect. This means that one or more valid and allowed filters were selected.

Parameters
IDatabase$dbrDatabase, for addQuotes, makeList, and similar
ChangesListSpecialPage$specialPageCurrent special page
array&$tablesArray of tables; see IDatabase::select $table
array&$fieldsArray of fields; see IDatabase::select $vars
array&$condsArray of conditions; see IDatabase::select $conds
array&$query_optionsArray of query options; see IDatabase::select $options
array&$join_condsArray of join conditions; see IDatabase::select $join_conds
FormOptions$optsWrapper for the current request options and their defaults
bool$isStructuredFiltersEnabledTrue if the Structured UI is currently enabled

Reimplemented from ChangesListFilterGroup.

Definition at line 68 of file ChangesListBooleanFilterGroup.php.

References $dbr, and ChangesListFilterGroup\getFilters().

◆ registerFilter()

ChangesListBooleanFilterGroup::registerFilter ( ChangesListBooleanFilter $filter)

Registers a filter in this group.

Parameters
ChangesListBooleanFilter$filter

Definition at line 61 of file ChangesListBooleanFilterGroup.php.

References ChangesListFilter\getName().

Member Data Documentation

◆ TYPE

const ChangesListBooleanFilterGroup::TYPE = 'send_unselected_if_any'

Type marker, used by JavaScript.

Definition at line 17 of file ChangesListBooleanFilterGroup.php.

Referenced by __construct().


The documentation for this class was generated from the following file: