|
MediaWiki master
|
A container holding changes list filter groups. More...
Inherits IteratorAggregate.

Public Member Functions | |
| addOptions (FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled) | |
| Add all the options represented by registered filter groups to $opts. | |
| addPendingConflict ( $sourceFilter, $conflictingGroupName, $conflictingFilterName, $opts) | |
| Register a conflict where the source exists but the destination doesn't exist yet. | |
| applyCssClassIfNeeded (IContextSource $ctx, RecentChange $rc, array &$classes) | |
| Add any necessary CSS classes. | |
| areFiltersInConflict (FormOptions $opts) | |
| Check if filters are in conflict and guaranteed to return no results. | |
| fillPriority (?int $priority) | |
| If a priority is passed, update the current auto-priority and return the passed value. | |
| fixContradictoryOptions (FormOptions $opts) | |
| Fix invalid options by resetting pairs that should never appear together. | |
| getGroup ( $name) | |
| Gets a specified ChangesListFilterGroup by name. | |
| getIterator () | |
| Iterate over defined filter groups. | |
| getJsData () | |
| Gets structured filter information needed by JS. | |
| getLegacyShowHideFilters () | |
| Get the boolean filters which are displayed on the unstructured UI, with the filter name in the key. | |
| getSubpageParams () | |
| Get the parameters which can be set via the subpage. | |
| hasGroup (string $name) | |
| Check if a group with a specific name is registered. | |
| modifyChangesListQuery (ChangesListQuery $query, FormOptions $opts, $isStructuredFiltersEnabled) | |
| Modifies the query according to the current filter groups. | |
| modifyLegacyQuery (IReadableDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, FormOptions $opts, $isStructuredFiltersEnabled) | |
| Modifies the query according to the current filter groups. | |
| popPendingConflicts (ChangesListFilterGroup $group, ChangesListFilter $filter) | |
| Get any pending conflicts for the specified filter which is in the specified group, and remove the conflicts from the container. | |
| registerGroup (ChangesListFilterGroup $group) | |
| Register a structured changes list filter group. | |
| setDefaults (array $defaults) | |
| Apply a set of default overrides to the registered filters. | |
| toArray () | |
| Get the filter groups as an associative array. | |
A container holding changes list filter groups.
Helps ChangesListSpecialPage to iterate over all groups. Provides strongly typed accessors.
Definition at line 18 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::addOptions | ( | FormOptions | $opts, |
| $allowDefaults, | |||
| $isStructuredFiltersEnabled ) |
Add all the options represented by registered filter groups to $opts.
| FormOptions | $opts | |
| bool | $allowDefaults | |
| bool | $isStructuredFiltersEnabled |
Definition at line 205 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::addPendingConflict | ( | $sourceFilter, | |
| $conflictingGroupName, | |||
| $conflictingFilterName, | |||
| $opts ) |
Register a conflict where the source exists but the destination doesn't exist yet.
| ChangesListFilter | $sourceFilter | |
| string | $conflictingGroupName | |
| string | $conflictingFilterName | |
| array | $opts |
Definition at line 101 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::applyCssClassIfNeeded | ( | IContextSource | $ctx, |
| RecentChange | $rc, | ||
| array & | $classes ) |
Add any necessary CSS classes.
| IContextSource | $ctx | Context source |
| RecentChange | $rc | Recent changes object |
| array | &$classes | Non-associative array of CSS class names; appended to if needed |
Definition at line 386 of file ChangesListFilterGroupContainer.php.
References MediaWiki\RecentChanges\RecentChange\isHighlighted().
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::areFiltersInConflict | ( | FormOptions | $opts | ) |
Check if filters are in conflict and guaranteed to return no results.
Definition at line 167 of file ChangesListFilterGroupContainer.php.
References wfLogWarning().
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::fillPriority | ( | ?int | $priority | ) |
If a priority is passed, update the current auto-priority and return the passed value.
If the priority is null, return the next auto-priority value.
| ?int | $priority |
Definition at line 153 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::fixContradictoryOptions | ( | FormOptions | $opts | ) |
Fix invalid options by resetting pairs that should never appear together.
| FormOptions | $opts |
Definition at line 267 of file ChangesListFilterGroupContainer.php.
References MediaWiki\RecentChanges\ChangesListFilter\getName().
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::getGroup | ( | $name | ) |
Gets a specified ChangesListFilterGroup by name.
| string | $name | Name of group |
Definition at line 69 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::getIterator | ( | ) |
Iterate over defined filter groups.
This is mostly for b/c with the FetchChangesList hook. When core needs to iterate over filter groups, there are usually specific wrapper functions.
Definition at line 50 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::getJsData | ( | ) |
Gets structured filter information needed by JS.
Currently, this intentionally only includes filters that display in the structured UI. This can be changed easily, though, if we want to include data on filters that use the unstructured UI. messageKeys is a special top-level value, with the value being an array of the message keys to send to the client.
Definition at line 331 of file ChangesListFilterGroupContainer.php.
References MediaWiki\RecentChanges\ChangesListFilterGroup\getPriority().
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::getLegacyShowHideFilters | ( | ) |
Get the boolean filters which are displayed on the unstructured UI, with the filter name in the key.
Definition at line 304 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::getSubpageParams | ( | ) |
Get the parameters which can be set via the subpage.
Definition at line 363 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::hasGroup | ( | string | $name | ) |
Check if a group with a specific name is registered.
| string | $name |
Definition at line 79 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::modifyChangesListQuery | ( | ChangesListQuery | $query, |
| FormOptions | $opts, | ||
| $isStructuredFiltersEnabled ) |
Modifies the query according to the current filter groups.
The modification is only done if the filter group is in effect. This means that one or more valid and allowed filters were selected.
| ChangesListQuery | $query | |
| FormOptions | $opts | |
| bool | $isStructuredFiltersEnabled |
Definition at line 247 of file ChangesListFilterGroupContainer.php.
References MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery\forceEmptySet().
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::modifyLegacyQuery | ( | IReadableDatabase | $dbr, |
| ChangesListSpecialPage | $specialPage, | ||
| & | $tables, | ||
| & | $fields, | ||
| & | $conds, | ||
| & | $query_options, | ||
| & | $join_conds, | ||
| FormOptions | $opts, | ||
| $isStructuredFiltersEnabled ) |
Modifies the query according to the current filter groups.
The modification is only done if the filter group is in effect. This means that one or more valid and allowed filters were selected.
| IReadableDatabase | $dbr | Database, for addQuotes, makeList, and similar |
| ChangesListSpecialPage | $specialPage | Current special page |
| array | &$tables | Array of tables; see IDatabase::select $table |
| array | &$fields | Array of fields; see IDatabase::select $vars |
| array | &$conds | Array of conditions; see IDatabase::select $conds |
| array | &$query_options | Array of query options; see IDatabase::select $options |
| array | &$join_conds | Array of join conditions; see IDatabase::select $join_conds |
| FormOptions | $opts | Wrapper for the current request options and their defaults |
| bool | $isStructuredFiltersEnabled | True if the Structured UI is currently enabled |
Definition at line 227 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::popPendingConflicts | ( | ChangesListFilterGroup | $group, |
| ChangesListFilter | $filter ) |
Get any pending conflicts for the specified filter which is in the specified group, and remove the conflicts from the container.
| ChangesListFilterGroup | $group | |
| ChangesListFilter | $filter |
Definition at line 119 of file ChangesListFilterGroupContainer.php.
References MediaWiki\RecentChanges\ChangesListFilter\getName(), and MediaWiki\RecentChanges\ChangesListFilterGroup\getName().
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::registerGroup | ( | ChangesListFilterGroup | $group | ) |
Register a structured changes list filter group.
Definition at line 86 of file ChangesListFilterGroupContainer.php.
References MediaWiki\RecentChanges\ChangesListFilterGroup\getName().
Referenced by MediaWiki\RecentChanges\ChangesListFilterFactory\registerFiltersFromDefinitions().
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::setDefaults | ( | array | $defaults | ) |
Apply a set of default overrides to the registered filters.
Ignore any filters that don't exist.
| array<string,array<string,bool>|string> | $defaults The key is the group name. For string options groups, the value is a string. For boolean groups, the value is an array mapping the filter name to the default value. |
Definition at line 140 of file ChangesListFilterGroupContainer.php.
| MediaWiki\RecentChanges\ChangesListFilterGroupContainer::toArray | ( | ) |
Get the filter groups as an associative array.
This can be removed when ChangesListSpecialPage::getFilterGroups() is removed.
Definition at line 59 of file ChangesListFilterGroupContainer.php.