|
MediaWiki master
|
Represents a filter (used on ChangesListSpecialPage and descendants) More...
Inherited by MediaWiki\RecentChanges\ChangesListBooleanFilter, and MediaWiki\RecentChanges\ChangesListStringOptionsFilter.

Public Member Functions | |
| __construct (array $filterDefinition) | |
| Creates a new filter with the specified configuration, and registers it to the specified group. | |
| activelyInConflictWithFilter (ChangesListFilter $filter, FormOptions $opts) | |
| Check if the conflict with a filter is currently "active". | |
| activelyInConflictWithGroup (ChangesListFilterGroup $group, FormOptions $opts) | |
| Check if the conflict with a group is currently "active". | |
| applyCssClassIfNeeded (IContextSource $ctx, RecentChange $rc, array &$classes) | |
| Add CSS class if needed. | |
| conflictsWith ( $other, string $globalKey, string $forwardKey, string $backwardKey) | |
| Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. | |
| displaysOnStructuredUi () | |
| Checks whether the filter should display on the structured UI This refers to the exact filter. | |
| displaysOnUnstructuredUi () | |
| Checks whether the filter should display on the unstructured UI. | |
| getAction () | |
| Get the action to apply to the ChangesListQuery for filtering. | |
| getConflictingFilters () | |
| Get filters conflicting with this filter. | |
| getConflictingGroups () | |
| Get groups conflicting with this filter. | |
| getCssClass () | |
| Gets the CSS class. | |
| getDescription () | |
| getGroup () | |
| getHighlightAction () | |
| Get the action to apply to the ChangesListQuery for highlighting. | |
| getJsData () | |
| Gets the JS data required by the front-end of the structured UI. | |
| getLabel () | |
| getName () | |
| getPriority () | |
| isActive (FormOptions $opts, $isStructuredUI) | |
| isFeatureAvailableOnStructuredUi () | |
| Checks whether an equivalent feature for this filter is available on the structured UI. | |
| isSelected (FormOptions $opts) | |
| Checks whether this filter is selected in the provided options. | |
| setAsSupersetOf (ChangesListFilter $other) | |
| Marks that the current instance is (also) a superset of the filter passed in. | |
| setDefaultHighlightColor ( $defaultHighlightColor) | |
| setUnidirectionalConflict ( $other, $globalDescription, $contextDescription) | |
| Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. | |
Protected Member Functions | |
| getSiblings () | |
| Get filters in the same group. | |
Protected Attributes | |
| array | $conflictingFilters = [] |
| Array of associative arrays with conflict information. | |
| array | $conflictingGroups = [] |
| Array of associative arrays with conflict information. | |
| string null | $cssClassSuffix |
| CSS class suffix used for attribution, e.g. | |
| string | $defaultHighlightColor |
| string | $description |
| i18n key of description for structured UI | |
| ChangesListFilterGroup | $group |
| Group. | |
| callable null | $isRowApplicableCallable |
| Callable that returns true if and only if a row is attributed to this filter. | |
| string | $label |
| i18n key of label for structured UI | |
| string | $name |
| Filter name. | |
| int | $priority |
| Priority integer. | |
| array | $subsetFilters = [] |
| Array of associative arrays with subset information. | |
Represents a filter (used on ChangesListSpecialPage and descendants)
Definition at line 21 of file ChangesListFilter.php.
| MediaWiki\RecentChanges\ChangesListFilter::__construct | ( | array | $filterDefinition | ) |
Creates a new filter with the specified configuration, and registers it to the specified group.
It infers which UI (it can be either or both) to display the filter on based on which messages are provided.
If 'label' is provided, it will be displayed on the structured UI. Thus, 'label', 'description', and sub-class parameters are optional depending on which UI it's for.
| array | $filterDefinition | ChangesListFilter definition
|
Definition at line 147 of file ChangesListFilter.php.
| MediaWiki\RecentChanges\ChangesListFilter::activelyInConflictWithFilter | ( | ChangesListFilter | $filter, |
| FormOptions | $opts ) |
Check if the conflict with a filter is currently "active".
| ChangesListFilter | $filter | |
| FormOptions | $opts |
Definition at line 491 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\isSelected().
| MediaWiki\RecentChanges\ChangesListFilter::activelyInConflictWithGroup | ( | ChangesListFilterGroup | $group, |
| FormOptions | $opts ) |
Check if the conflict with a group is currently "active".
| ChangesListFilterGroup | $group | |
| FormOptions | $opts |
Definition at line 467 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilterGroup\anySelected().
| MediaWiki\RecentChanges\ChangesListFilter::applyCssClassIfNeeded | ( | IContextSource | $ctx, |
| RecentChange | $rc, | ||
| array & | $classes ) |
Add CSS class if needed.
| 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 353 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\getCssClass().
| MediaWiki\RecentChanges\ChangesListFilter::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 200 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\setUnidirectionalConflict().
| MediaWiki\RecentChanges\ChangesListFilter::displaysOnStructuredUi | ( | ) |
Checks whether the filter should display on the structured UI This refers to the exact filter.
See also isFeatureAvailableOnStructuredUi.
Definition at line 311 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\isFeatureAvailableOnStructuredUi().
|
abstract |
Checks whether the filter should display on the unstructured UI.
Reimplemented in MediaWiki\RecentChanges\ChangesListBooleanFilter, and MediaWiki\RecentChanges\ChangesListStringOptionsFilter.
| MediaWiki\RecentChanges\ChangesListFilter::getAction | ( | ) |
Get the action to apply to the ChangesListQuery for filtering.
This may also return an array of actions.
Definition at line 429 of file ChangesListFilter.php.
| MediaWiki\RecentChanges\ChangesListFilter::getConflictingFilters | ( | ) |
Get filters conflicting with this filter.
Definition at line 456 of file ChangesListFilter.php.
| MediaWiki\RecentChanges\ChangesListFilter::getConflictingGroups | ( | ) |
Get groups conflicting with this filter.
Definition at line 447 of file ChangesListFilter.php.
| MediaWiki\RecentChanges\ChangesListFilter::getCssClass | ( | ) |
Gets the CSS class.
Definition at line 338 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\$cssClassSuffix, and MediaWiki\RecentChanges\ChangesList\CSS_CLASS_PREFIX.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\applyCssClassIfNeeded(), and MediaWiki\RecentChanges\ChangesListFilter\getJsData().
| MediaWiki\RecentChanges\ChangesListFilter::getDescription | ( | ) |
Definition at line 294 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\$description.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getJsData().
| MediaWiki\RecentChanges\ChangesListFilter::getGroup | ( | ) |
Definition at line 280 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\$group.
Referenced by MediaWiki\RecentChanges\ChangesListStringOptionsFilter\isSelected(), and MediaWiki\RecentChanges\ChangesListFilter\setAsSupersetOf().
| MediaWiki\RecentChanges\ChangesListFilter::getHighlightAction | ( | ) |
Get the action to apply to the ChangesListQuery for highlighting.
Definition at line 438 of file ChangesListFilter.php.
| MediaWiki\RecentChanges\ChangesListFilter::getJsData | ( | ) |
Gets the JS data required by the front-end of the structured UI.
Reimplemented in MediaWiki\RecentChanges\ChangesListBooleanFilter.
Definition at line 370 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\$defaultHighlightColor, MediaWiki\RecentChanges\ChangesListFilter\$priority, MediaWiki\RecentChanges\ChangesListFilter\$subsetFilters, MediaWiki\RecentChanges\ChangesListFilter\getCssClass(), MediaWiki\RecentChanges\ChangesListFilter\getDescription(), MediaWiki\RecentChanges\ChangesListFilter\getLabel(), and MediaWiki\RecentChanges\ChangesListFilter\getName().
| MediaWiki\RecentChanges\ChangesListFilter::getLabel | ( | ) |
Definition at line 287 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\$label.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getJsData().
| MediaWiki\RecentChanges\ChangesListFilter::getName | ( | ) |
Definition at line 273 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\$name.
Referenced by MediaWiki\RecentChanges\ChangesListFilterGroupContainer\fixContradictoryOptions(), MediaWiki\RecentChanges\ChangesListFilter\getJsData(), MediaWiki\RecentChanges\ChangesListBooleanFilter\isActive(), MediaWiki\RecentChanges\ChangesListBooleanFilter\isSelected(), MediaWiki\RecentChanges\ChangesListStringOptionsFilter\isSelected(), MediaWiki\RecentChanges\ChangesListFilterGroupContainer\popPendingConflicts(), MediaWiki\RecentChanges\ChangesListBooleanFilterGroup\registerFilter(), MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\registerFilter(), and MediaWiki\RecentChanges\ChangesListFilter\setAsSupersetOf().
| MediaWiki\RecentChanges\ChangesListFilter::getPriority | ( | ) |
Definition at line 329 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\$priority.
Referenced by MediaWiki\RecentChanges\ChangesListFilterGroup\getJsData().
|
protected |
Get filters in the same group.
Definition at line 516 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListBooleanFilter\isSelected().
|
abstract |
| FormOptions | $opts | Query parameters merged with defaults |
| bool | $isStructuredUI | Whether the structured UI is currently enabled |
Reimplemented in MediaWiki\RecentChanges\ChangesListBooleanFilter, and MediaWiki\RecentChanges\ChangesListStringOptionsFilter.
| MediaWiki\RecentChanges\ChangesListFilter::isFeatureAvailableOnStructuredUi | ( | ) |
Checks whether an equivalent feature for this filter is available on the structured UI.
This can either be the exact filter, or a new filter that replaces it.
Reimplemented in MediaWiki\RecentChanges\ChangesListBooleanFilter.
Definition at line 322 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\displaysOnStructuredUi().
|
abstract |
Checks whether this filter is selected in the provided options.
| FormOptions | $opts |
Reimplemented in MediaWiki\RecentChanges\ChangesListBooleanFilter, and MediaWiki\RecentChanges\ChangesListStringOptionsFilter.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\activelyInConflictWithFilter(), and MediaWiki\RecentChanges\ChangesListFilterGroup\anySelected().
| MediaWiki\RecentChanges\ChangesListFilter::setAsSupersetOf | ( | ChangesListFilter | $other | ) |
Marks that the current instance is (also) a superset of the filter passed in.
This can be called more than once.
This means that anything in the results for the other filter is also in the results for this one.
| ChangesListFilter | $other | The filter the current instance is a superset of |
Definition at line 257 of file ChangesListFilter.php.
References MediaWiki\RecentChanges\ChangesListFilter\getGroup(), and MediaWiki\RecentChanges\ChangesListFilter\getName().
| MediaWiki\RecentChanges\ChangesListFilter::setDefaultHighlightColor | ( | $defaultHighlightColor | ) |
| string | $defaultHighlightColor |
Definition at line 528 of file ChangesListFilter.php.
| MediaWiki\RecentChanges\ChangesListFilter::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 225 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\conflictsWith().
|
protected |
Array of associative arrays with conflict information.
See setUnidirectionalConflict
Definition at line 81 of file ChangesListFilter.php.
|
protected |
Array of associative arrays with conflict information.
See setUnidirectionalConflict
Definition at line 73 of file ChangesListFilter.php.
|
protected |
CSS class suffix used for attribution, e.g.
'bot'.
In this example, if bot actions are included in the result set, this CSS class will then be included in all bot-flagged actions.
Definition at line 37 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getCssClass().
|
protected |
Definition at line 100 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getJsData().
|
protected |
i18n key of description for structured UI
Definition at line 65 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getDescription().
|
protected |
Group.
ChangesListFilterGroup this belongs to
Definition at line 51 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getGroup().
|
protected |
Callable that returns true if and only if a row is attributed to this filter.
Definition at line 44 of file ChangesListFilter.php.
|
protected |
i18n key of label for structured UI
Definition at line 58 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getLabel().
|
protected |
Filter name.
Definition at line 27 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getName().
|
protected |
Priority integer.
Higher value means higher up in the group's filter list.
Definition at line 95 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getJsData(), and MediaWiki\RecentChanges\ChangesListFilter\getPriority().
|
protected |
Array of associative arrays with subset information.
Definition at line 88 of file ChangesListFilter.php.
Referenced by MediaWiki\RecentChanges\ChangesListFilter\getJsData().