MediaWiki
master
|
Represents a filter group (used on ChangesListSpecialPage and descendants) More...
Public Member Functions | |
__construct (array $groupDefinition) | |
Create a new filter group with the specified configuration. More... | |
addOptions (FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled) | |
All the options represented by this filter group to $opts. More... | |
anySelected (FormOptions $opts) | |
Check if any filter in this group is selected. More... | |
conflictsWith ( $other, string $globalKey, string $forwardKey, string $backwardKey) | |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. More... | |
getConflictingFilters () | |
Get filters conflicting with this filter group. More... | |
getConflictingGroups () | |
Get groups conflicting with this filter group. More... | |
getFilter ( $name) | |
Get filter by name. More... | |
getFilters () | |
getJsData () | |
Gets the JS data in the format required by the front-end of the structured UI. More... | |
getName () | |
getPriority () | |
getTitle () | |
getType () | |
modifyQuery (IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, FormOptions $opts, $isStructuredFiltersEnabled) | |
Modifies the query to include the filter group. More... | |
setUnidirectionalConflict ( $other, $globalDescription, $contextDescription) | |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. More... | |
Protected Member Functions | |
createFilter (array $filterDefinition) | |
Creates a filter of the appropriate type for this group, from the definition. More... | |
Protected Attributes | |
array | $conflictingFilters = [] |
Array of associative arrays with conflict information. More... | |
array | $conflictingGroups = [] |
Array of associative arrays with conflict information. More... | |
ChangesListFilter[] | $filters |
Associative array of filters, as ChangesListFilter objects, with filter name as key. More... | |
bool | $isFullCoverage |
Whether this group is full coverage. More... | |
string | $name |
Name (internal identifier) More... | |
int | $priority |
Priority integer. More... | |
string | $title |
i18n key for title More... | |
string | $type |
Type, from a TYPE constant of a subclass. More... | |
string null | $whatsThisBody |
i18n key for body of What's This? More... | |
string null | $whatsThisHeader |
i18n key for header of What's This? More... | |
string null | $whatsThisLinkText |
i18n key for What's This? link More... | |
string null | $whatsThisUrl |
URL of What's This? link. More... | |
Represents a filter group (used on ChangesListSpecialPage and descendants)
Definition at line 39 of file ChangesListFilterGroup.php.
ChangesListFilterGroup::__construct | ( | array | $groupDefinition | ) |
Create a new filter group with the specified configuration.
array | $groupDefinition | Configuration of group
|
Reimplemented in ChangesListStringOptionsFilterGroup, and ChangesListBooleanFilterGroup.
Definition at line 158 of file ChangesListFilterGroup.php.
References createFilter().
|
abstract |
All the options represented by this filter group to $opts.
FormOptions | $opts | |
bool | $allowDefaults | |
bool | $isStructuredFiltersEnabled |
Reimplemented in ChangesListStringOptionsFilterGroup, and ChangesListBooleanFilterGroup.
ChangesListFilterGroup::anySelected | ( | FormOptions | $opts | ) |
Check if any filter in this group is selected.
FormOptions | $opts |
Definition at line 422 of file ChangesListFilterGroup.php.
References getFilters(), and ChangesListFilter\isSelected().
Referenced by ChangesListFilter\activelyInConflictWithGroup().
ChangesListFilterGroup::conflictsWith | ( | $other, | |
string | $globalKey, | ||
string | $forwardKey, | ||
string | $backwardKey | ||
) |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object.
WARNING: This means there is a conflict when both things are shown (not filtered out), even for the hide-based filters. So e.g. conflicting with 'hideanons' means there is a conflict if only anonymous users are shown.
ChangesListFilterGroup | ChangesListFilter | $other | |
string | $globalKey | i18n key for top-level conflict message |
string | $forwardKey | i18n key for conflict message in this direction (when in UI context of $this object) |
string | $backwardKey | i18n key for conflict message in reverse direction (when in UI context of $other object) |
Definition at line 231 of file ChangesListFilterGroup.php.
References setUnidirectionalConflict().
|
abstractprotected |
Creates a filter of the appropriate type for this group, from the definition.
array | $filterDefinition |
Reimplemented in ChangesListStringOptionsFilterGroup, and ChangesListBooleanFilterGroup.
Referenced by __construct().
ChangesListFilterGroup::getConflictingFilters | ( | ) |
Get filters conflicting with this filter group.
Definition at line 412 of file ChangesListFilterGroup.php.
ChangesListFilterGroup::getConflictingGroups | ( | ) |
Get groups conflicting with this filter group.
Definition at line 403 of file ChangesListFilterGroup.php.
ChangesListFilterGroup::getFilter | ( | $name | ) |
Get filter by name.
string | $name | Filter name |
Definition at line 321 of file ChangesListFilterGroup.php.
References $name.
ChangesListFilterGroup::getFilters | ( | ) |
Definition at line 311 of file ChangesListFilterGroup.php.
References $filters.
Referenced by ChangesListBooleanFilterGroup\addOptions(), anySelected(), and ChangesListBooleanFilterGroup\modifyQuery().
ChangesListFilterGroup::getJsData | ( | ) |
Gets the JS data in the format required by the front-end of the structured UI.
Reimplemented in ChangesListStringOptionsFilterGroup.
Definition at line 332 of file ChangesListFilterGroup.php.
References $isFullCoverage, $name, $priority, $title, $type, $whatsThisBody, $whatsThisHeader, $whatsThisLinkText, $whatsThisUrl, and ChangesListFilter\getPriority().
ChangesListFilterGroup::getName | ( | ) |
Definition at line 282 of file ChangesListFilterGroup.php.
References $name.
Referenced by ChangesListStringOptionsFilterGroup\addOptions(), ChangesListStringOptionsFilterGroup\modifyQuery(), and MediaWiki\SpecialPage\ChangesListSpecialPage\registerFilterGroup().
ChangesListFilterGroup::getPriority | ( | ) |
Definition at line 303 of file ChangesListFilterGroup.php.
References $priority.
Referenced by MediaWiki\SpecialPage\ChangesListSpecialPage\getStructuredFilterJsData().
ChangesListFilterGroup::getTitle | ( | ) |
Definition at line 289 of file ChangesListFilterGroup.php.
References $title.
ChangesListFilterGroup::getType | ( | ) |
Definition at line 296 of file ChangesListFilterGroup.php.
References $type.
|
abstract |
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.
IDatabase | $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 |
Reimplemented in ChangesListStringOptionsFilterGroup, and ChangesListBooleanFilterGroup.
ChangesListFilterGroup::setUnidirectionalConflict | ( | $other, | |
$globalDescription, | |||
$contextDescription | |||
) |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object.
Internal use ONLY.
ChangesListFilterGroup | ChangesListFilter | $other | |
string | $globalDescription | i18n key for top-level conflict message |
string | $contextDescription | i18n key for conflict message in this direction (when in UI context of $this object) |
Definition at line 256 of file ChangesListFilterGroup.php.
Referenced by conflictsWith().
|
protected |
Array of associative arrays with conflict information.
See setUnidirectionalConflict
Definition at line 126 of file ChangesListFilterGroup.php.
|
protected |
Array of associative arrays with conflict information.
See setUnidirectionalConflict
Definition at line 118 of file ChangesListFilterGroup.php.
|
protected |
Associative array of filters, as ChangesListFilter objects, with filter name as key.
Definition at line 102 of file ChangesListFilterGroup.php.
Referenced by getFilters().
|
protected |
Whether this group is full coverage.
This means that checking every item in the group means no changes list (e.g. RecentChanges) entries are filtered out.
Definition at line 110 of file ChangesListFilterGroup.php.
Referenced by getJsData().
|
protected |
Name (internal identifier)
Definition at line 45 of file ChangesListFilterGroup.php.
Referenced by getFilter(), getJsData(), and getName().
|
protected |
Priority integer.
Higher values means higher up in the group list.
Definition at line 95 of file ChangesListFilterGroup.php.
Referenced by getJsData(), and getPriority().
|
protected |
i18n key for title
Definition at line 52 of file ChangesListFilterGroup.php.
Referenced by getJsData(), and getTitle().
|
protected |
Type, from a TYPE constant of a subclass.
Definition at line 87 of file ChangesListFilterGroup.php.
Referenced by getJsData(), and getType().
|
protected |
i18n key for body of What's This?
Definition at line 66 of file ChangesListFilterGroup.php.
Referenced by getJsData().
|
protected |
i18n key for header of What's This?
Definition at line 59 of file ChangesListFilterGroup.php.
Referenced by getJsData().
|
protected |
i18n key for What's This? link
Definition at line 80 of file ChangesListFilterGroup.php.
Referenced by getJsData().
|
protected |
URL of What's This? link.
Definition at line 73 of file ChangesListFilterGroup.php.
Referenced by getJsData().