MediaWiki  master
ChangesListStringOptionsFilter.php
Go to the documentation of this file.
1 <?php
2 
14  public function displaysOnUnstructuredUi() {
15  return false;
16  }
17 
21  public function isSelected( FormOptions $opts ) {
22  $option = $opts[ $this->getGroup()->getName() ];
23  if ( $option === ChangesListStringOptionsFilterGroup::ALL ) {
24  return true;
25  }
26 
27  $values = explode( ChangesListStringOptionsFilterGroup::SEPARATOR, $option );
28  return in_array( $this->getName(), $values );
29  }
30 }
ChangesListStringOptionsFilter
An individual filter in a ChangesListStringOptionsFilterGroup.
Definition: ChangesListStringOptionsFilter.php:10
ChangesListStringOptionsFilter\displaysOnUnstructuredUi
displaysOnUnstructuredUi()
Checks whether the filter should display on the unstructured UI.bool Whether to display
Definition: ChangesListStringOptionsFilter.php:14
ChangesListFilter\getName
getName()
Definition: ChangesListFilter.php:270
ChangesListStringOptionsFilter\isSelected
isSelected(FormOptions $opts)
Checks whether this filter is selected in the provided options.bool
Definition: ChangesListStringOptionsFilter.php:21
ChangesListFilter\getGroup
getGroup()
Definition: ChangesListFilter.php:277
ChangesListStringOptionsFilterGroup\SEPARATOR
const SEPARATOR
Delimiter.
Definition: ChangesListStringOptionsFilterGroup.php:46
ChangesListStringOptionsFilterGroup\ALL
const ALL
Signifies that all options in the group are selected.
Definition: ChangesListStringOptionsFilterGroup.php:51
ChangesListFilter
Represents a filter (used on ChangesListSpecialPage and descendants)
Definition: ChangesListFilter.php:29
FormOptions
Helper class to keep track of options when mixing links and form elements.
Definition: FormOptions.php:35