MediaWiki  master
HTMLTagFilter.php
Go to the documentation of this file.
1 <?php
7 class HTMLTagFilter extends HTMLFormField {
8  protected $tagFilter;
9 
10  public function getTableRow( $value ) {
11  $this->tagFilter = ChangeTags::buildTagFilterSelector(
12  $value, false, $this->mParent->getContext() );
13  if ( $this->tagFilter ) {
14  return parent::getTableRow( $value );
15  }
16  return '';
17  }
18 
19  public function getDiv( $value ) {
20  $this->tagFilter = ChangeTags::buildTagFilterSelector(
21  $value, false, $this->mParent->getContext() );
22  if ( $this->tagFilter ) {
23  return parent::getDiv( $value );
24  }
25  return '';
26  }
27 
28  public function getOOUI( $value ) {
29  $this->tagFilter = ChangeTags::buildTagFilterSelector(
30  $value, true, $this->mParent->getContext() );
31  if ( $this->tagFilter ) {
32  return parent::getOOUI( $value );
33  }
34  return new OOUI\FieldLayout( new OOUI\Widget() );
35  }
36 
37  public function getInputHTML( $value ) {
38  if ( $this->tagFilter ) {
39  // we only need the select field, HTMLForm should handle the label
40  return $this->tagFilter[1];
41  }
42  return '';
43  }
44 
45  public function getInputOOUI( $value ) {
46  if ( $this->tagFilter ) {
47  // we only need the select field, HTMLForm should handle the label
48  return $this->tagFilter[1];
49  }
50  return '';
51  }
52 }
HTMLTagFilter\getTableRow
getTableRow( $value)
Get the complete table row for the input, including help text, labels, and whatever.
Definition: HTMLTagFilter.php:10
ChangeTags\buildTagFilterSelector
static buildTagFilterSelector( $selected='', $ooui=false, IContextSource $context=null)
Build a text box to select a change tag.
Definition: ChangeTags.php:924
HTMLTagFilter\getInputOOUI
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.
Definition: HTMLTagFilter.php:45
HTMLTagFilter\$tagFilter
$tagFilter
Definition: HTMLTagFilter.php:8
HTMLTagFilter\getDiv
getDiv( $value)
Get the complete div for the input, including help text, labels, and whatever.
Definition: HTMLTagFilter.php:19
HTMLFormField
The parent class to generate form fields.
Definition: HTMLFormField.php:9
HTMLTagFilter\getInputHTML
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
Definition: HTMLTagFilter.php:37
HTMLTagFilter\getOOUI
getOOUI( $value)
Get the OOUI version of the div.
Definition: HTMLTagFilter.php:28
HTMLTagFilter
Wrapper for ChangeTags::buildTagFilterSelector to use in HTMLForm.
Definition: HTMLTagFilter.php:7