MediaWiki REL1_30
|
Represents a filter (used on ChangesListSpecialPage and descendants) More...
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, $globalKey, $forwardKey, $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. | |
getConflictingFilters () | |
Get filters conflicting with this filter. | |
getConflictingGroups () | |
Get groups conflicting with this filter. | |
getDescription () | |
getGroup () | |
getJsData () | |
Gets the JS data required by the front-end of the structured UI. | |
getLabel () | |
getName () | |
getPriority () | |
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. | |
setUnidirectionalConflict ( $other, $globalDescription, $contextDescription) | |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. | |
Public Attributes | |
const | RESERVED_NAME_CHAR = '_' |
Protected Member Functions | |
getCssClass () | |
Gets the CSS class. | |
getSiblings () | |
Get filters in the same group. | |
Protected Attributes | |
$conflictingFilters = [] | |
Array of associative arrays with conflict information. | |
$conflictingGroups = [] | |
Array of associative arrays with conflict information. | |
$cssClassSuffix | |
CSS class suffix used for attribution, e.g. | |
$description | |
i18n key of description for structured UI | |
$group | |
Group. | |
$isRowApplicableCallable | |
Callable that returns true if and only if a row is attributed to this filter. | |
$label | |
i18n key of label for structured UI | |
$name | |
Filter name. | |
$priority | |
Priority integer. | |
$subsetFilters = [] | |
Array of associative arrays with subset information. | |
Private Member Functions | |
hasConflictWithFilter (ChangeslistFilter $filter) | |
hasConflictWithGroup (ChangesListFilterGroup $group) | |
Represents a filter (used on ChangesListSpecialPage and descendants)
Definition at line 30 of file ChangesListFilter.php.
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 137 of file ChangesListFilter.php.
References name.
ChangesListFilter::activelyInConflictWithFilter | ( | ChangeslistFilter | $filter, |
FormOptions | $opts | ||
) |
Check if the conflict with a filter is currently "active".
ChangesListFilter | $filter | |
FormOptions | $opts |
Definition at line 464 of file ChangesListFilter.php.
References as, getSiblings(), and isSelected().
ChangesListFilter::activelyInConflictWithGroup | ( | ChangesListFilterGroup | $group, |
FormOptions | $opts | ||
) |
Check if the conflict with a group is currently "active".
ChangesListFilterGroup | $group | |
FormOptions | $opts |
Definition at line 440 of file ChangesListFilter.php.
References $group, as, and getSiblings().
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 345 of file ChangesListFilter.php.
References getCssClass().
ChangesListFilter::conflictsWith | ( | $other, | |
$globalKey, | |||
$forwardKey, | |||
$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 | Other ChangesListFilterGroup or ChangesListFilter |
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 189 of file ChangesListFilter.php.
References setUnidirectionalConflict().
ChangesListFilter::displaysOnStructuredUi | ( | ) |
Checks whether the filter should display on the structured UI This refers to the exact filter.
See also isFeatureAvailableOnStructuredUi.
Definition at line 303 of file ChangesListFilter.php.
Referenced by isFeatureAvailableOnStructuredUi().
|
abstract |
Checks whether the filter should display on the unstructured UI.
Reimplemented in ChangesListBooleanFilter, ChangesListStringOptionsFilter, and MockChangesListFilter.
ChangesListFilter::getConflictingFilters | ( | ) |
Get filters conflicting with this filter.
Definition at line 424 of file ChangesListFilter.php.
References $conflictingFilters.
Referenced by hasConflictWithFilter().
ChangesListFilter::getConflictingGroups | ( | ) |
Get groups conflicting with this filter.
Definition at line 410 of file ChangesListFilter.php.
References $conflictingGroups.
Referenced by hasConflictWithGroup().
|
protected |
Gets the CSS class.
Definition at line 330 of file ChangesListFilter.php.
References $cssClassSuffix, and ChangesList\CSS_CLASS_PREFIX.
Referenced by applyCssClassIfNeeded(), and getJsData().
ChangesListFilter::getDescription | ( | ) |
Definition at line 286 of file ChangesListFilter.php.
References $description.
Referenced by getJsData().
ChangesListFilter::getGroup | ( | ) |
Definition at line 272 of file ChangesListFilter.php.
References $group.
Referenced by getSiblings(), ChangesListStringOptionsFilter\isSelected(), and setAsSupersetOf().
ChangesListFilter::getJsData | ( | ) |
Gets the JS data required by the front-end of the structured UI.
Reimplemented in ChangesListBooleanFilter.
Definition at line 362 of file ChangesListFilter.php.
References $output, $priority, $subsetFilters, as, getCssClass(), getDescription(), getLabel(), and getName().
ChangesListFilter::getLabel | ( | ) |
Definition at line 279 of file ChangesListFilter.php.
References $label.
Referenced by getJsData().
ChangesListFilter::getName | ( | ) |
Definition at line 265 of file ChangesListFilter.php.
References $name.
Referenced by getJsData(), ChangesListBooleanFilter\isActive(), ChangesListBooleanFilter\isSelected(), ChangesListStringOptionsFilter\isSelected(), ChangesListBooleanFilterGroup\registerFilter(), ChangesListStringOptionsFilterGroup\registerFilter(), MockChangesListFilterGroup\registerFilter(), and setAsSupersetOf().
ChangesListFilter::getPriority | ( | ) |
Definition at line 321 of file ChangesListFilter.php.
References $priority.
|
protected |
Get filters in the same group.
Definition at line 489 of file ChangesListFilter.php.
References getGroup().
Referenced by activelyInConflictWithFilter(), activelyInConflictWithGroup(), and ChangesListBooleanFilter\isSelected().
|
private |
Definition at line 480 of file ChangesListFilter.php.
References getConflictingFilters().
|
private |
Definition at line 453 of file ChangesListFilter.php.
References $group, and getConflictingGroups().
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 ChangesListBooleanFilter.
Definition at line 314 of file ChangesListFilter.php.
References displaysOnStructuredUi().
|
abstract |
Checks whether this filter is selected in the provided options.
FormOptions | $opts |
Reimplemented in ChangesListBooleanFilter, ChangesListStringOptionsFilter, and MockChangesListFilter.
Referenced by activelyInConflictWithFilter(), and ChangesListFilterGroup\anySelected().
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 249 of file ChangesListFilter.php.
References getGroup(), and getName().
ChangesListFilter::setUnidirectionalConflict | ( | $other, | |
$globalDescription, | |||
$contextDescription | |||
) |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object.
Internal use ONLY.
ChangesListFilterGroup | ChangesListFilter | $other | Other ChangesListFilterGroup or ChangesListFilter |
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 219 of file ChangesListFilter.php.
Referenced by conflictsWith().
|
protected |
Array of associative arrays with conflict information.
See setUnidirectionalConflict
Definition at line 90 of file ChangesListFilter.php.
Referenced by getConflictingFilters().
|
protected |
Array of associative arrays with conflict information.
See setUnidirectionalConflict
Definition at line 82 of file ChangesListFilter.php.
Referenced by getConflictingGroups().
|
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 46 of file ChangesListFilter.php.
Referenced by getCssClass().
|
protected |
i18n key of description for structured UI
Definition at line 74 of file ChangesListFilter.php.
Referenced by getDescription().
|
protected |
Group.
ChangesListFilterGroup this belongs to
Definition at line 60 of file ChangesListFilter.php.
Referenced by activelyInConflictWithGroup(), getGroup(), and hasConflictWithGroup().
|
protected |
Callable that returns true if and only if a row is attributed to this filter.
Definition at line 53 of file ChangesListFilter.php.
|
protected |
i18n key of label for structured UI
Definition at line 67 of file ChangesListFilter.php.
Referenced by getLabel().
|
protected |
|
protected |
Priority integer.
Higher value means higher up in the group's filter list.
Definition at line 104 of file ChangesListFilter.php.
Referenced by getJsData(), and getPriority().
|
protected |
Array of associative arrays with subset information.
Definition at line 97 of file ChangesListFilter.php.
Referenced by getJsData().
const ChangesListFilter::RESERVED_NAME_CHAR = '_' |
Definition at line 106 of file ChangesListFilter.php.