MediaWiki
master
|
Represents a hide-based boolean filter (used on ChangesListSpecialPage and descendants) More...
Public Member Functions | ||||
__construct ( $filterDefinition) | ||||
Create a new filter with the specified configuration. More... | ||||
displaysOnUnstructuredUi () | ||||
Checks whether the filter should display on the unstructured UI.
| ||||
getDefault ( $structuredUI=false) | ||||
Get the default value. More... | ||||
getJsData () | ||||
Gets the JS data required by the front-end of the structured UI.
| ||||
getShowHide () | ||||
isActive (FormOptions $opts, $isStructuredUI) | ||||
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.
| ||||
isSelected (FormOptions $opts) | ||||
Checks whether this filter is selected in the provided options.
| ||||
modifyQuery (IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds) | ||||
Modifies the query to include the filter. More... | ||||
setDefault ( $defaultValue) | ||||
Sets default. More... | ||||
![]() | ||||
__construct (array $filterDefinition) | ||||
Creates a new filter with the specified configuration, and registers it to the specified group. More... | ||||
activelyInConflictWithFilter (ChangesListFilter $filter, FormOptions $opts) | ||||
Check if the conflict with a filter is currently "active". More... | ||||
activelyInConflictWithGroup (ChangesListFilterGroup $group, FormOptions $opts) | ||||
Check if the conflict with a group is currently "active". More... | ||||
applyCssClassIfNeeded (IContextSource $ctx, RecentChange $rc, array &$classes) | ||||
Add CSS class if needed. More... | ||||
conflictsWith ( $other, string $globalKey, string $forwardKey, string $backwardKey) | ||||
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. More... | ||||
displaysOnStructuredUi () | ||||
Checks whether the filter should display on the structured UI This refers to the exact filter. More... | ||||
getConflictingFilters () | ||||
Get filters conflicting with this filter. More... | ||||
getConflictingGroups () | ||||
Get groups conflicting with this filter. More... | ||||
getDescription () | ||||
getGroup () | ||||
getLabel () | ||||
getName () | ||||
getPriority () | ||||
setAsSupersetOf (ChangesListFilter $other) | ||||
Marks that the current instance is (also) a superset of the filter passed in. More... | ||||
setDefaultHighlightColor ( $defaultHighlightColor) | ||||
setUnidirectionalConflict ( $other, $globalDescription, $contextDescription) | ||||
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. More... | ||||
Protected Attributes | |
bool | $activeValue |
Value that defined when this filter is considered active. More... | |
bool | $defaultValue |
Default. More... | |
bool | $isReplacedInStructuredUi |
Whether there is a feature designed to replace this filter available on the structured UI. More... | |
callable | $queryCallable |
Callable used to do the actual query modification; see constructor. More... | |
string | $showHide |
Main unstructured UI i18n key. More... | |
![]() | |
array | $conflictingFilters = [] |
Array of associative arrays with conflict information. More... | |
array | $conflictingGroups = [] |
Array of associative arrays with conflict information. More... | |
string null | $cssClassSuffix |
CSS class suffix used for attribution, e.g. More... | |
string | $defaultHighlightColor |
string | $description |
i18n key of description for structured UI More... | |
ChangesListFilterGroup | $group |
Group. More... | |
callable | $isRowApplicableCallable |
Callable that returns true if and only if a row is attributed to this filter. More... | |
string | $label |
i18n key of label for structured UI More... | |
string | $name |
Filter name. More... | |
int | $priority |
Priority integer. More... | |
array | $subsetFilters = [] |
Array of associative arrays with subset information. More... | |
Additional Inherited Members | |
![]() | |
getCssClass () | |
Gets the CSS class. More... | |
getSiblings () | |
Get filters in the same group. More... | |
Represents a hide-based boolean filter (used on ChangesListSpecialPage and descendants)
Definition at line 33 of file ChangesListBooleanFilter.php.
ChangesListBooleanFilter::__construct | ( | $filterDefinition | ) |
Create a new filter with the specified configuration.
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. If 'showHide' is provided, it will be displayed on the unstructured UI. Thus, 'label', 'description', and 'showHide' are optional depending on which UI it's for.
array | $filterDefinition | ChangesListFilter definition
|
Definition at line 110 of file ChangesListBooleanFilter.php.
References setDefault().
ChangesListBooleanFilter::displaysOnUnstructuredUi | ( | ) |
Checks whether the filter should display on the unstructured UI.
Reimplemented from ChangesListFilter.
Definition at line 165 of file ChangesListBooleanFilter.php.
References $showHide.
ChangesListBooleanFilter::getDefault | ( | $structuredUI = false | ) |
Get the default value.
bool | $structuredUI | Are we currently showing the structured UI |
Definition at line 138 of file ChangesListBooleanFilter.php.
References $defaultValue.
ChangesListBooleanFilter::getJsData | ( | ) |
Gets the JS data required by the front-end of the structured UI.
Reimplemented from ChangesListFilter.
Definition at line 211 of file ChangesListBooleanFilter.php.
References $defaultValue.
ChangesListBooleanFilter::getShowHide | ( | ) |
Definition at line 158 of file ChangesListBooleanFilter.php.
References $showHide.
ChangesListBooleanFilter::isActive | ( | FormOptions | $opts, |
$isStructuredUI | |||
) |
FormOptions | $opts | Query parameters merged with defaults |
bool | $isStructuredUI | Whether the structured UI is currently enabled |
Definition at line 237 of file ChangesListBooleanFilter.php.
References $activeValue, and ChangesListFilter\getName().
ChangesListBooleanFilter::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 from ChangesListFilter.
Definition at line 172 of file ChangesListBooleanFilter.php.
ChangesListBooleanFilter::isSelected | ( | FormOptions | $opts | ) |
Checks whether this filter is selected in the provided options.
FormOptions | $opts |
Reimplemented from ChangesListFilter.
Definition at line 222 of file ChangesListBooleanFilter.php.
References ChangesListFilter\getName(), and ChangesListFilter\getSiblings().
ChangesListBooleanFilter::modifyQuery | ( | IDatabase | $dbr, |
ChangesListSpecialPage | $specialPage, | ||
& | $tables, | ||
& | $fields, | ||
& | $conds, | ||
& | $query_options, | ||
& | $join_conds | ||
) |
Modifies the query to include the filter.
This is only called if the filter is in effect (taking into account the default).
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 |
Definition at line 189 of file ChangesListBooleanFilter.php.
References $queryCallable, and MediaWiki\SpecialPage\SpecialPage\getContext().
ChangesListBooleanFilter::setDefault | ( | $defaultValue | ) |
Sets default.
It must be a boolean.
It will be coerced to boolean.
bool | $defaultValue |
Definition at line 151 of file ChangesListBooleanFilter.php.
References $defaultValue.
Referenced by __construct().
|
protected |
Value that defined when this filter is considered active.
Definition at line 68 of file ChangesListBooleanFilter.php.
Referenced by isActive().
|
protected |
Default.
Definition at line 54 of file ChangesListBooleanFilter.php.
Referenced by getDefault(), getJsData(), and setDefault().
|
protected |
Whether there is a feature designed to replace this filter available on the structured UI.
Definition at line 47 of file ChangesListBooleanFilter.php.
|
protected |
Callable used to do the actual query modification; see constructor.
Definition at line 61 of file ChangesListBooleanFilter.php.
Referenced by modifyQuery().
|
protected |
Main unstructured UI i18n key.
Definition at line 39 of file ChangesListBooleanFilter.php.
Referenced by displaysOnUnstructuredUi(), and getShowHide().