MediaWiki
1.30.0
|
Represents a filter group with multiple string options. More...
Public Member Functions | |
__construct (array $groupDefinition) | |
Create a new filter group with the specified configuration. More... | |
getDefault () | |
Gets default of filter group. More... | |
getJsData () | |
@inheritDoc More... | |
isPerGroupRequestParameter () | |
@inheritDoc More... | |
modifyQuery (IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, $value) | |
Modifies the query to include the filter group. More... | |
registerFilter (ChangesListStringOptionsFilter $filter) | |
Registers a filter in this group. More... | |
setDefault ( $defaultValue) | |
Sets default of filter group. More... | |
Public Member Functions inherited from ChangesListFilterGroup | |
anySelected (FormOptions $opts) | |
Check if any filter in this group is selected. More... | |
conflictsWith ( $other, $globalKey, $forwardKey, $backwardKey) | |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. More... | |
getConflictingFilters () | |
Get filters conflicting with this filter group. More... | |
getConflictingGroups () | |
Get groups conflicting with this filter group. More... | |
getFilter ( $name) | |
Get filter by name. More... | |
getFilters () | |
getName () | |
getPriority () | |
getTitle () | |
getType () | |
setUnidirectionalConflict ( $other, $globalDescription, $contextDescription) | |
Marks that the given ChangesListFilterGroup or ChangesListFilter conflicts with this object. More... | |
Public Attributes | |
const | ALL = 'all' |
Signifies that all options in the group are selected. More... | |
const | NONE = '' |
Signifies that no options in the group are selected, meaning the group has no effect. More... | |
const | SEPARATOR = ';' |
Delimiter. More... | |
const | TYPE = 'string_options' |
Type marker, used by JavaScript. More... | |
Public Attributes inherited from ChangesListFilterGroup | |
const | DEFAULT_PRIORITY = -100 |
const | RESERVED_NAME_CHAR = '_' |
Protected Member Functions | |
createFilter (array $filterDefinition) | |
@inheritDoc More... | |
Protected Attributes | |
$defaultValue | |
Defaul parameter value. More... | |
$queryCallable | |
Callable used to do the actual query modification; see constructor. More... | |
Protected Attributes inherited from ChangesListFilterGroup | |
$conflictingFilters = [] | |
Array of associative arrays with conflict information. More... | |
$conflictingGroups = [] | |
Array of associative arrays with conflict information. More... | |
$filters | |
Associative array of filters, as ChangesListFilter objects, with filter name as key. More... | |
$isFullCoverage | |
Whether this group is full coverage. More... | |
$name | |
Name (internal identifier) More... | |
$priority | |
Priority integer. More... | |
$title | |
i18n key for title More... | |
$type | |
Type, from a TYPE constant of a subclass. More... | |
$whatsThisBody | |
i18n key for body of What's This? More... | |
$whatsThisHeader | |
i18n key for header of What's This? More... | |
$whatsThisLinkText | |
i18n key for What's This? link More... | |
$whatsThisUrl | |
URL of What's This? link. More... | |
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 39 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 113 of file ChangesListStringOptionsFilterGroup.php.
References setDefault(), and TYPE.
|
protected |
@inheritDoc
Reimplemented from ChangesListFilterGroup.
Definition at line 159 of file ChangesListStringOptionsFilterGroup.php.
ChangesListStringOptionsFilterGroup::getDefault | ( | ) |
Gets default of filter group.
Definition at line 152 of file ChangesListStringOptionsFilterGroup.php.
References $defaultValue.
Referenced by getJsData().
ChangesListStringOptionsFilterGroup::getJsData | ( | ) |
@inheritDoc
Reimplemented from ChangesListFilterGroup.
Definition at line 237 of file ChangesListStringOptionsFilterGroup.php.
References $output, getDefault(), and SEPARATOR.
ChangesListStringOptionsFilterGroup::isPerGroupRequestParameter | ( | ) |
@inheritDoc
Reimplemented from ChangesListFilterGroup.
Definition at line 134 of file ChangesListStringOptionsFilterGroup.php.
ChangesListStringOptionsFilterGroup::modifyQuery | ( | IDatabase | $dbr, |
ChangesListSpecialPage | $specialPage, | ||
& | $tables, | ||
& | $fields, | ||
& | $conds, | ||
& | $query_options, | ||
& | $join_conds, | ||
$value | |||
) |
Modifies the query to include the filter group.
The modification is only done if the filter group is in effect. This means that one or more valid and allowed filters were selected.
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 |
string | $value | URL parameter value |
Definition at line 187 of file ChangesListStringOptionsFilterGroup.php.
References $dbr, $tables, $value, as, captcha-old\count, and SpecialPage\getContext().
ChangesListStringOptionsFilterGroup::registerFilter | ( | ChangesListStringOptionsFilter | $filter | ) |
Registers a filter in this group.
ChangesListStringOptionsFilter | $filter | ChangesListStringOptionsFilter |
Definition at line 168 of file ChangesListStringOptionsFilterGroup.php.
References ChangesListFilter\getName().
ChangesListStringOptionsFilterGroup::setDefault | ( | $defaultValue | ) |
Sets default of filter group.
string | $defaultValue |
Definition at line 143 of file ChangesListStringOptionsFilterGroup.php.
References $defaultValue.
Referenced by __construct().
|
protected |
Defaul parameter value.
Definition at line 68 of file ChangesListStringOptionsFilterGroup.php.
Referenced by getDefault(), and setDefault().
|
protected |
Callable used to do the actual query modification; see constructor.
Definition at line 75 of file ChangesListStringOptionsFilterGroup.php.
const ChangesListStringOptionsFilterGroup::ALL = 'all' |
Signifies that all options in the group are selected.
Definition at line 53 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 61 of file ChangesListStringOptionsFilterGroup.php.
Referenced by SpecialRecentChanges\__construct(), ChangesListSpecialPage\__construct(), SpecialWatchlist\registerFilters(), and ChangesListSpecialPageTest\testGetStructuredFilterJsData().
const ChangesListStringOptionsFilterGroup::SEPARATOR = ';' |
Delimiter.
Definition at line 48 of file ChangesListStringOptionsFilterGroup.php.
Referenced by getJsData(), and ChangesListStringOptionsFilter\isSelected().
const ChangesListStringOptionsFilterGroup::TYPE = 'string_options' |
Type marker, used by JavaScript.
Definition at line 43 of file ChangesListStringOptionsFilterGroup.php.
Referenced by __construct(), ChangesListStringOptionsFilterGroupTest\testGetJsData(), and ChangesListSpecialPageTest\testGetStructuredFilterJsData().