(bug 47070) check content model namespace on import.
[lhc/web/wiklou.git] / includes / htmlform / HTMLInfoField.php
1 <?php
2 /**
3 * An information field (text blob), not a proper input.
4 */
5 class HTMLInfoField extends HTMLFormField {
6 public function __construct( $info ) {
7 $info[ 'nodata' ] = true;
8
9 parent::__construct( $info );
10 }
11
12 public function getInputHTML( $value ) {
13 return ! empty( $this->mParams[ 'raw' ] ) ? $value : htmlspecialchars( $value );
14 }
15
16 public function getTableRow( $value ) {
17 if ( ! empty( $this->mParams[ 'rawrow' ] ) ) {
18 return $value;
19 }
20
21 return parent::getTableRow( $value );
22 }
23
24 /**
25 * @since 1.20
26 */
27 public function getDiv( $value ) {
28 if ( ! empty( $this->mParams[ 'rawrow' ] ) ) {
29 return $value;
30 }
31
32 return parent::getDiv( $value );
33 }
34
35 /**
36 * @since 1.20
37 */
38 public function getRaw( $value ) {
39 if ( ! empty( $this->mParams[ 'rawrow' ] ) ) {
40 return $value;
41 }
42
43 return parent::getRaw( $value );
44 }
45
46 protected function needsLabel() {
47 return false;
48 }
49 }