Debian Codegraph @

includes/recentchanges/ChangesListStringOptionsFilter.php

raw symbols SCIP
1 <?php
2
3 use MediaWiki\Html\FormOptions;
4
5 /**
6 * An individual filter in a ChangesListStringOptionsFilterGroup.
7 *
8 * This filter type will only be displayed on the structured UI currently.
9 *
10 * @since 1.29
11 * @ingroup RecentChanges
12 */
13 class ChangesListStringOptionsFilter extends ChangesListFilter {
14 /**
15 * @inheritDoc
16 */
17 public function displaysOnUnstructuredUi() {
18 return false;
19 }
20
21 /**
22 * @inheritDoc
23 */
24 public function isSelected( FormOptions $opts ) {
25 $option = $opts[ $this->getGroup()->getName() ];
26 if ( $option === ChangesListStringOptionsFilterGroup::ALL ) {
27 return true;
28 }
29
30 $values = explode( ChangesListStringOptionsFilterGroup::SEPARATOR, $option );
31 return in_array( $this->getName(), $values );
32 }
33 }