MediaWiki REL1_39
ChangesListBooleanFilterGroup.php
Go to the documentation of this file.
1<?php
2
4
17 public const TYPE = 'send_unselected_if_any';
18
41 public function __construct( array $groupDefinition ) {
42 $groupDefinition['isFullCoverage'] = true;
43 $groupDefinition['type'] = self::TYPE;
44
45 parent::__construct( $groupDefinition );
46 }
47
51 protected function createFilter( array $filterDefinition ) {
52 return new ChangesListBooleanFilter( $filterDefinition );
53 }
54
61 public function registerFilter( ChangesListBooleanFilter $filter ) {
62 $this->filters[$filter->getName()] = $filter;
63 }
64
68 public function modifyQuery( IDatabase $dbr, ChangesListSpecialPage $specialPage,
69 &$tables, &$fields, &$conds, &$query_options, &$join_conds,
70 FormOptions $opts, $isStructuredFiltersEnabled
71 ) {
73 foreach ( $this->getFilters() as $filter ) {
74 if ( $filter->isActive( $opts, $isStructuredFiltersEnabled ) ) {
75 $filter->modifyQuery( $dbr, $specialPage, $tables, $fields, $conds,
76 $query_options, $join_conds );
77 }
78 }
79 }
80
84 public function addOptions( FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled ) {
86 foreach ( $this->getFilters() as $filter ) {
87 $defaultValue = $allowDefaults ? $filter->getDefault( $isStructuredFiltersEnabled ) : false;
88 $opts->add( $filter->getName(), $defaultValue );
89 }
90 }
91}
If the group is active, any unchecked filters will translate to hide parameters in the URL.
modifyQuery(IDatabase $dbr, ChangesListSpecialPage $specialPage, &$tables, &$fields, &$conds, &$query_options, &$join_conds, FormOptions $opts, $isStructuredFiltersEnabled)
Modifies the query to include the filter group.The modification is only done if the filter group is i...
const TYPE
Type marker, used by JavaScript.
registerFilter(ChangesListBooleanFilter $filter)
Registers a filter in this group.
__construct(array $groupDefinition)
Create a new filter group with the specified configuration.
addOptions(FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled)
All the options represented by this filter group to $opts.
createFilter(array $filterDefinition)
Creates a filter of the appropriate type for this group, from the definition.ChangesListFilter Filter
Represents a hide-based boolean filter (used on ChangesListSpecialPage and descendants)
Represents a filter group (used on ChangesListSpecialPage and descendants)
Special page which uses a ChangesList to show query results.
Helper class to keep track of options when mixing links and form elements.
add( $name, $default, $type=self::AUTO)
Add an option to be handled by this FormOptions instance.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:39