X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fchanges%2FChangesListBooleanFilterGroup.php;h=4401378b28784b0c7b2587fbaf2487986ae9ffbc;hb=f03d31af05dbe6acaad00bc76ff4aa02aee2f77f;hp=951c4077c2a0e1e9377798107ed79f66684d9860;hpb=10d1b7d12b5d097413cd507740c5c71781c2580b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/changes/ChangesListBooleanFilterGroup.php b/includes/changes/ChangesListBooleanFilterGroup.php index 951c4077c2..4401378b28 100644 --- a/includes/changes/ChangesListBooleanFilterGroup.php +++ b/includes/changes/ChangesListBooleanFilterGroup.php @@ -1,5 +1,7 @@ filters[$filter->getName()] = $filter; } /** - * @inheritdoc + * @inheritDoc + */ + public function modifyQuery( IDatabase $dbr, ChangesListSpecialPage $specialPage, + &$tables, &$fields, &$conds, &$query_options, &$join_conds, + FormOptions $opts, $isStructuredFiltersEnabled + ) { + /** @var ChangesListBooleanFilter $filter */ + foreach ( $this->getFilters() as $filter ) { + if ( $filter->isActive( $opts, $isStructuredFiltersEnabled ) ) { + $filter->modifyQuery( $dbr, $specialPage, $tables, $fields, $conds, + $query_options, $join_conds ); + } + } + } + + /** + * @inheritDoc */ - public function isPerGroupRequestParameter() { - return false; + public function addOptions( FormOptions $opts, $allowDefaults, $isStructuredFiltersEnabled ) { + /** @var ChangesListBooleanFilter $filter */ + foreach ( $this->getFilters() as $filter ) { + $defaultValue = $allowDefaults ? $filter->getDefault( $isStructuredFiltersEnabled ) : false; + $opts->add( $filter->getName(), $defaultValue ); + } } }