MediaWiki
1.29.1
|
An individual filter in a boolean group. 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 () | ||||
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. More... | ||||
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... | ||||
Public Member Functions inherited from ChangesListFilter | ||||
__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, $globalKey, $forwardKey, $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... | ||||
setUnidirectionalConflict ( $other, $globalDescription, $contextDescription) | ||||
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. More... | ||||
Protected Attributes | |
$defaultValue | |
Default. More... | |
$isReplacedInStructuredUi | |
Whether there is a feature designed to replace this filter available on the structured UI. More... | |
$queryCallable | |
Callable used to do the actual query modification; see constructor. More... | |
$showHide | |
Main unstructured UI i18n key. More... | |
Protected Attributes inherited from ChangesListFilter | |
$conflictingFilters = [] | |
$conflictingGroups = [] | |
$cssClassSuffix | |
CSS class suffix used for attribution, e.g. More... | |
$description | |
i18n key of description for structured UI More... | |
$group | |
Group. More... | |
$isRowApplicableCallable | |
Callable that returns true if and only if a row is attributed to this filter. More... | |
$label | |
i18n key of label for structured UI More... | |
$name | |
Filter name. More... | |
$priority | |
Priority integer. More... | |
$subsetFilters = [] | |
Additional Inherited Members | |
Public Attributes inherited from ChangesListFilter | |
const | RESERVED_NAME_CHAR = '_' |
Protected Member Functions inherited from ChangesListFilter | |
getCssClass () | |
Gets the CSS class. More... | |
getSiblings () | |
Get filters in the same group. More... | |
An individual filter in a boolean group.
Definition at line 32 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 |
$filterDefinition['name'] string Name. Used as URL parameter. $filterDefinition['group'] ChangesListFilterGroup Group. Filter group this belongs to. $filterDefinition['label'] string i18n key of label for structured UI. $filterDefinition['description'] string i18n key of description for structured UI. $filterDefinition['showHide'] string Main i18n key used for unstructured UI. $filterDefinition['isReplacedInStructuredUi'] bool Whether there is an equivalent feature available in the structured UI; this is optional, defaulting to true. It does not need to be set if the exact same filter is simply visible on both. $filterDefinition['default'] bool Default $filterDefinition['priority'] int Priority integer. Higher value means higher up in the group's filter list. $filterDefinition['queryCallable'] callable Callable accepting parameters, used to implement filter's DB query modification. Callback parameters: string $specialPageClassName Class name of current special page IContextSource $context Context, for e.g. user IDatabase $dbr Database, for addQuotes, makeList, and similar 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 Optional only for legacy filters that still use the query hooks directly
Definition at line 114 of file ChangesListBooleanFilter.php.
ChangesListBooleanFilter::displaysOnUnstructuredUi | ( | ) |
Checks whether the filter should display on the unstructured UI.
Reimplemented from ChangesListFilter.
Definition at line 169 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 144 of file ChangesListBooleanFilter.php.
References $defaultValue, and false.
ChangesListBooleanFilter::getJsData | ( | ) |
Gets the JS data required by the front-end of the structured UI.
Reimplemented from ChangesListFilter.
Definition at line 218 of file ChangesListBooleanFilter.php.
References $defaultValue, and $output.
ChangesListBooleanFilter::getShowHide | ( | ) |
Definition at line 162 of file ChangesListBooleanFilter.php.
References $showHide.
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 176 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 229 of file ChangesListBooleanFilter.php.
References ChangesListFilter\getName(), ChangesListFilter\getSiblings(), and use.
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 193 of file ChangesListBooleanFilter.php.
References $dbr, $tables, and SpecialPage\getContext().
ChangesListBooleanFilter::setDefault | ( | $defaultValue | ) |
Sets default.
bool | Default value |
Definition at line 155 of file ChangesListBooleanFilter.php.
References $defaultValue.
|
protected |
Default.
Definition at line 66 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 59 of file ChangesListBooleanFilter.php.
|
protected |
Callable used to do the actual query modification; see constructor.
Definition at line 73 of file ChangesListBooleanFilter.php.
|
protected |
Main unstructured UI i18n key.
Definition at line 51 of file ChangesListBooleanFilter.php.
Referenced by displaysOnUnstructuredUi(), and getShowHide().