Merge "Add link to protect log to action=info"
[lhc/web/wiklou.git] / includes / htmlform / fields / HTMLInfoField.php
index 6dc5d08..a98f112 100644 (file)
@@ -19,7 +19,7 @@ class HTMLInfoField extends HTMLFormField {
                parent::__construct( $info );
        }
 
-       function getDefault() {
+       public function getDefault() {
                $default = parent::getDefault();
                if ( $default instanceof Closure ) {
                        $default = call_user_func( $default, $this->mParams );
@@ -75,6 +75,22 @@ class HTMLInfoField extends HTMLFormField {
                return parent::getRaw( $value );
        }
 
+       /**
+        * @param mixed $value
+        * @return OOUI\FieldLayout
+        * @since 1.32
+        */
+       public function getOOUI( $value ) {
+               if ( !empty( $this->mParams['rawrow'] ) ) {
+                       if ( !( $value instanceof OOUI\FieldLayout ) ) {
+                               throw new Exception( "'default' must be a FieldLayout or subclass when using 'rawrow'" );
+                       }
+                       return $value;
+               }
+
+               return parent::getOOUI( $value );
+       }
+
        protected function needsLabel() {
                return false;
        }