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