HTMLForm: Implement OOUI version of HTMLTagFilter
authorFlorian Schmidt <florian.schmidt.stargatewissen@gmail.com>
Tue, 20 Sep 2016 18:35:30 +0000 (20:35 +0200)
committerFlorian Schmidt <florian.schmidt.stargatewissen@gmail.com>
Wed, 11 Jan 2017 20:29:01 +0000 (21:29 +0100)
Bug: T117739
Change-Id: Ia9990d1089773f61721cce731bb6cb767a174467

includes/htmlform/fields/HTMLTagFilter.php

index f58acbe..38f9a0a 100644 (file)
@@ -23,6 +23,15 @@ class HTMLTagFilter extends HTMLFormField {
                return '';
        }
 
+       public function getOOUI( $value ) {
+               $this->tagFilter = ChangeTags::buildTagFilterSelector(
+                       $value, true, $this->mParent->getContext() );
+               if ( $this->tagFilter ) {
+                       return parent::getOOUI( $value );
+               }
+               return new OOUI\FieldLayout( new OOUI\Widget() );
+       }
+
        public function getInputHTML( $value ) {
                if ( $this->tagFilter ) {
                        // we only need the select field, HTMLForm should handle the label
@@ -30,4 +39,12 @@ class HTMLTagFilter extends HTMLFormField {
                }
                return '';
        }
+
+       public function getInputOOUI( $value ) {
+               if ( $this->tagFilter ) {
+                       // we only need the select field, HTMLForm should handle the label
+                       return $this->tagFilter[1];
+               }
+               return '';
+       }
 }