MediaWiki REL1_31
|
Represents a filter group with multiple string options. More...
Public Member Functions | |
__construct (array $groupDefinition) | |
Create a new filter group with the specified configuration. | |
addOptions (FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled) | |
@inheritDoc | |
getDefault () | |
Gets default of filter group. | |
getJsData () | |
@inheritDoc | |
modifyQuery (IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, FormOptions $opts, $isStructuredFiltersEnabled) | |
@inheritDoc | |
registerFilter (ChangesListStringOptionsFilter $filter) | |
Registers a filter in this group. | |
setDefault ( $defaultValue) | |
Sets default of filter group. | |
![]() | |
anySelected (FormOptions $opts) | |
Check if any filter in this group is selected. | |
conflictsWith ( $other, $globalKey, $forwardKey, $backwardKey) | |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. | |
getConflictingFilters () | |
Get filters conflicting with this filter group. | |
getConflictingGroups () | |
Get groups conflicting with this filter group. | |
getFilter ( $name) | |
Get filter by name. | |
getFilters () | |
getName () | |
getPriority () | |
getTitle () | |
getType () | |
setUnidirectionalConflict ( $other, $globalDescription, $contextDescription) | |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. | |
Public Attributes | |
const | ALL = 'all' |
Signifies that all options in the group are selected. | |
const | NONE = '' |
Signifies that no options in the group are selected, meaning the group has no effect. | |
const | SEPARATOR = ';' |
Delimiter. | |
const | TYPE = 'string_options' |
Type marker, used by JavaScript. | |
![]() | |
const | DEFAULT_PRIORITY = -100 |
const | RESERVED_NAME_CHAR = '_' |
Protected Member Functions | |
createFilter (array $filterDefinition) | |
@inheritDoc | |
Protected Attributes | |
$defaultValue | |
Defaul parameter value. | |
$queryCallable | |
Callable used to do the actual query modification; see constructor. | |
![]() | |
$conflictingFilters = [] | |
Array of associative arrays with conflict information. | |
$conflictingGroups = [] | |
Array of associative arrays with conflict information. | |
$filters | |
Associative array of filters, as ChangesListFilter objects, with filter name as key. | |
$isFullCoverage | |
Whether this group is full coverage. | |
$name | |
Name (internal identifier) | |
$priority | |
Priority integer. | |
$title | |
i18n key for title | |
$type | |
Type, from a TYPE constant of a subclass. | |
$whatsThisBody | |
i18n key for body of What's This? | |
$whatsThisHeader | |
i18n key for header of What's This? | |
$whatsThisLinkText | |
i18n key for What's This? link | |
$whatsThisUrl | |
URL of What's This? link. | |
Private Member Functions | |
isActive ( $isStructuredUI) | |
Check if this filter group is currently active. | |
Represents a filter group with multiple string options.
They are passed to the server as a single form parameter separated by a delimiter. The parameter name is the group name. E.g. groupname=opt1;opt2 .
If all options are selected they are replaced by the term "all".
There is also a single DB query modification for the whole group.
Definition at line 37 of file ChangesListStringOptionsFilterGroup.php.
ChangesListStringOptionsFilterGroup::__construct | ( | array | $groupDefinition | ) |
Create a new filter group with the specified configuration.
array | $groupDefinition | Configuration of group
|
Reimplemented from ChangesListFilterGroup.
Definition at line 111 of file ChangesListStringOptionsFilterGroup.php.
References setDefault(), and TYPE.
ChangesListStringOptionsFilterGroup::addOptions | ( | FormOptions | $opts, |
$allowDefaults, | |||
$isStructuredFiltersEnabled ) |
@inheritDoc
Reimplemented from ChangesListFilterGroup.
Definition at line 234 of file ChangesListStringOptionsFilterGroup.php.
References FormOptions\add(), getDefault(), and ChangesListFilterGroup\getName().
|
protected |
@inheritDoc
Reimplemented from ChangesListFilterGroup.
Definition at line 150 of file ChangesListStringOptionsFilterGroup.php.
ChangesListStringOptionsFilterGroup::getDefault | ( | ) |
Gets default of filter group.
Definition at line 143 of file ChangesListStringOptionsFilterGroup.php.
References $defaultValue.
Referenced by addOptions(), and getJsData().
ChangesListStringOptionsFilterGroup::getJsData | ( | ) |
@inheritDoc
Reimplemented from ChangesListFilterGroup.
Definition at line 222 of file ChangesListStringOptionsFilterGroup.php.
References $output, getDefault(), and SEPARATOR.
|
private |
Check if this filter group is currently active.
bool | $isStructuredUI | Is structured filters UI current enabled |
Definition at line 244 of file ChangesListStringOptionsFilterGroup.php.
Referenced by modifyQuery().
ChangesListStringOptionsFilterGroup::modifyQuery | ( | IDatabase | $dbr, |
ChangesListSpecialPage | $specialPage, | ||
& | $tables, | ||
& | $fields, | ||
& | $conds, | ||
& | $query_options, | ||
& | $join_conds, | ||
FormOptions | $opts, | ||
$isStructuredFiltersEnabled ) |
@inheritDoc
Reimplemented from ChangesListFilterGroup.
Definition at line 166 of file ChangesListStringOptionsFilterGroup.php.
References $dbr, $tables, $value, SpecialPage\getContext(), ChangesListFilterGroup\getName(), and isActive().
ChangesListStringOptionsFilterGroup::registerFilter | ( | ChangesListStringOptionsFilter | $filter | ) |
Registers a filter in this group.
ChangesListStringOptionsFilter | $filter |
Definition at line 159 of file ChangesListStringOptionsFilterGroup.php.
References ChangesListFilter\getName().
ChangesListStringOptionsFilterGroup::setDefault | ( | $defaultValue | ) |
Sets default of filter group.
string | $defaultValue |
Definition at line 134 of file ChangesListStringOptionsFilterGroup.php.
References $defaultValue.
Referenced by __construct().
|
protected |
Defaul parameter value.
Definition at line 66 of file ChangesListStringOptionsFilterGroup.php.
Referenced by getDefault(), and setDefault().
|
protected |
Callable used to do the actual query modification; see constructor.
Definition at line 73 of file ChangesListStringOptionsFilterGroup.php.
const ChangesListStringOptionsFilterGroup::ALL = 'all' |
Signifies that all options in the group are selected.
Definition at line 51 of file ChangesListStringOptionsFilterGroup.php.
Referenced by ChangesListStringOptionsFilter\isSelected().
const ChangesListStringOptionsFilterGroup::NONE = '' |
Signifies that no options in the group are selected, meaning the group has no effect.
For full-coverage groups, this is the same as ALL if all filters are allowed. For others, it is not.
Definition at line 59 of file ChangesListStringOptionsFilterGroup.php.
Referenced by ChangesListSpecialPage\__construct(), SpecialRecentChanges\__construct(), SpecialWatchlist\registerFilters(), and ChangesListSpecialPageTest\testGetStructuredFilterJsData().
const ChangesListStringOptionsFilterGroup::SEPARATOR = ';' |
Delimiter.
Definition at line 46 of file ChangesListStringOptionsFilterGroup.php.
Referenced by getJsData(), ChangesListStringOptionsFilter\isSelected(), and ChangesListSpecialPage\replaceOldOptions().
const ChangesListStringOptionsFilterGroup::TYPE = 'string_options' |
Type marker, used by JavaScript.
Definition at line 41 of file ChangesListStringOptionsFilterGroup.php.
Referenced by __construct(), ChangesListStringOptionsFilterGroupTest\testGetJsData(), and ChangesListSpecialPageTest\testGetStructuredFilterJsData().