|
MediaWiki master
|
Represents a filter group with multiple string options. More...
Inherits MediaWiki\RecentChanges\ChangesListFilterGroup.

Public Member Functions | ||||||||||||||||||||||||||||
| __construct (array $groupDefinition) | ||||||||||||||||||||||||||||
| Create a new filter group with the specified configuration. | ||||||||||||||||||||||||||||
| addOptions (FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled) | ||||||||||||||||||||||||||||
Add all the options represented by this filter group to $opts.
| ||||||||||||||||||||||||||||
| getDefault () | ||||||||||||||||||||||||||||
| Gets default of filter group. | ||||||||||||||||||||||||||||
| getJsData () | ||||||||||||||||||||||||||||
Gets the JS data in the format required by the front-end of the structured UI.
| ||||||||||||||||||||||||||||
| modifyQuery (IReadableDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, FormOptions $opts, $isStructuredFiltersEnabled) | ||||||||||||||||||||||||||||
Modifies the query to include the filter group (legacy interface).The modification is only done if the filter group is in effect. This means that one or more valid and allowed filters were selected.
| ||||||||||||||||||||||||||||
| registerFilter (ChangesListStringOptionsFilter $filter) | ||||||||||||||||||||||||||||
| Registers a filter in this group. | ||||||||||||||||||||||||||||
| setDefault ( $defaultValue) | ||||||||||||||||||||||||||||
| Sets default of filter group. | ||||||||||||||||||||||||||||
Public Member Functions inherited from MediaWiki\RecentChanges\ChangesListFilterGroup | ||||||||||||||||||||||||||||
| anySelected (FormOptions $opts) | ||||||||||||||||||||||||||||
| Check if any filter in this group is selected. | ||||||||||||||||||||||||||||
| conflictsWith ( $other, string $globalKey, string $forwardKey, string $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 () | ||||||||||||||||||||||||||||
| modifyChangesListQuery (ChangesListQuery $query, FormOptions $opts, $isStructuredFiltersEnabled) | ||||||||||||||||||||||||||||
| Modifies the query to include the filter group. | ||||||||||||||||||||||||||||
| 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. | |
Protected Member Functions | ||||
| createFilter (array $filterDefinition) | ||||
Creates a filter of the appropriate type for this group, from the definition.
| ||||
Protected Attributes | |
| string | $defaultValue |
| Default parameter value. | |
| callable null | $queryCallable |
| Callable used to do the actual query modification; see constructor. | |
Protected Attributes inherited from MediaWiki\RecentChanges\ChangesListFilterGroup | |
| array | $conflictingFilters = [] |
| Array of associative arrays with conflict information. | |
| array | $conflictingGroups = [] |
| Array of associative arrays with conflict information. | |
| ChangesListFilter[] | $filters |
| Associative array of filters, as ChangesListFilter objects, with filter name as key. | |
| bool | $isFullCoverage |
| Whether this group is full coverage. | |
| string | $name |
| Name (internal identifier) | |
| int | $priority |
| Priority integer. | |
| string | $title |
| i18n key for title | |
| string | $type |
| Type, from a TYPE constant of a subclass. | |
| string null | $whatsThisBody |
| i18n key for body of What's This? | |
| string null | $whatsThisHeader |
| i18n key for header of What's This? | |
| string null | $whatsThisLinkText |
| i18n key for What's This? link | |
| string null | $whatsThisUrl |
| URL of What's This? link. | |
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 27 of file ChangesListStringOptionsFilterGroup.php.
| MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::__construct | ( | array | $groupDefinition | ) |
Create a new filter group with the specified configuration.
| array | $groupDefinition | Configuration of group
|
Reimplemented from MediaWiki\RecentChanges\ChangesListFilterGroup.
Definition at line 101 of file ChangesListStringOptionsFilterGroup.php.
References MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\setDefault(), and MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\TYPE.
| MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::addOptions | ( | FormOptions | $opts, |
| $allowDefaults, | |||
| $isStructuredFiltersEnabled ) |
Add all the options represented by this filter group to $opts.
| FormOptions | $opts | |
| bool | $allowDefaults | |
| bool | $isStructuredFiltersEnabled |
Reimplemented from MediaWiki\RecentChanges\ChangesListFilterGroup.
Definition at line 231 of file ChangesListStringOptionsFilterGroup.php.
References MediaWiki\Html\FormOptions\add(), MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\getDefault(), and MediaWiki\RecentChanges\ChangesListFilterGroup\getName().
|
protected |
Creates a filter of the appropriate type for this group, from the definition.
| array | $filterDefinition |
Reimplemented from MediaWiki\RecentChanges\ChangesListFilterGroup.
Definition at line 145 of file ChangesListStringOptionsFilterGroup.php.
| MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::getDefault | ( | ) |
Gets default of filter group.
Definition at line 138 of file ChangesListStringOptionsFilterGroup.php.
References MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\$defaultValue.
Referenced by MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\addOptions(), and MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\getJsData().
| MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::getJsData | ( | ) |
Gets the JS data in the format required by the front-end of the structured UI.
Reimplemented from MediaWiki\RecentChanges\ChangesListFilterGroup.
Definition at line 219 of file ChangesListStringOptionsFilterGroup.php.
References MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\getDefault(), and MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\SEPARATOR.
| MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::modifyQuery | ( | IReadableDatabase | $dbr, |
| ChangesListSpecialPage | $specialPage, | ||
| & | $tables, | ||
| & | $fields, | ||
| & | $conds, | ||
| & | $query_options, | ||
| & | $join_conds, | ||
| FormOptions | $opts, | ||
| $isStructuredFiltersEnabled ) |
Modifies the query to include the filter group (legacy interface).The modification is only done if the filter group is in effect. This means that one or more valid and allowed filters were selected.
| IReadableDatabase | $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 |
| FormOptions | $opts | Wrapper for the current request options and their defaults |
| bool | $isStructuredFiltersEnabled | True if the Structured UI is currently enabled |
Reimplemented from MediaWiki\RecentChanges\ChangesListFilterGroup.
Definition at line 162 of file ChangesListStringOptionsFilterGroup.php.
References MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\$queryCallable, MediaWiki\SpecialPage\SpecialPage\getContext(), and MediaWiki\RecentChanges\ChangesListFilterGroup\getName().
| MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::registerFilter | ( | ChangesListStringOptionsFilter | $filter | ) |
Registers a filter in this group.
| ChangesListStringOptionsFilter | $filter |
Definition at line 155 of file ChangesListStringOptionsFilterGroup.php.
References MediaWiki\RecentChanges\ChangesListFilter\getName().
| MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::setDefault | ( | $defaultValue | ) |
Sets default of filter group.
| string | $defaultValue |
Reimplemented from MediaWiki\RecentChanges\ChangesListFilterGroup.
Definition at line 124 of file ChangesListStringOptionsFilterGroup.php.
References MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\$defaultValue.
Referenced by MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\__construct().
|
protected |
Default parameter value.
Definition at line 56 of file ChangesListStringOptionsFilterGroup.php.
Referenced by MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\getDefault(), and MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\setDefault().
|
protected |
Callable used to do the actual query modification; see constructor.
Definition at line 63 of file ChangesListStringOptionsFilterGroup.php.
Referenced by MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\modifyQuery().
| const MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::ALL = 'all' |
Signifies that all options in the group are selected.
Definition at line 41 of file ChangesListStringOptionsFilterGroup.php.
Referenced by MediaWiki\RecentChanges\ChangesListStringOptionsFilter\isSelected().
| const MediaWiki\RecentChanges\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 49 of file ChangesListStringOptionsFilterGroup.php.
| const MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::SEPARATOR = ';' |
Delimiter.
Definition at line 36 of file ChangesListStringOptionsFilterGroup.php.
Referenced by MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\getJsData(), and MediaWiki\RecentChanges\ChangesListStringOptionsFilter\isSelected().
| const MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup::TYPE = 'string_options' |
Type marker, used by JavaScript.
Definition at line 31 of file ChangesListStringOptionsFilterGroup.php.
Referenced by MediaWiki\RecentChanges\ChangesListStringOptionsFilterGroup\__construct().