Added a separate error message for mkdir failures
[lhc/web/wiklou.git] / includes / htmlform / HTMLInfoField.php
1 <?php
2
3 /**
4 * An information field (text blob), not a proper input.
5 */
6 class HTMLInfoField extends HTMLFormField {
7 public function __construct( $info ) {
8 $info['nodata'] = true;
9
10 parent::__construct( $info );
11 }
12
13 public function getInputHTML( $value ) {
14 return !empty( $this->mParams['raw'] ) ? $value : htmlspecialchars( $value );
15 }
16
17 public function getInputOOUI( $value ) {
18 if ( !empty( $this->mParams['raw'] ) ) {
19 $value = new OOUI\HtmlSnippet( $value );
20 }
21
22 return new OOUI\LabelWidget( array(
23 'label' => $value,
24 ) );
25 }
26
27 public function getTableRow( $value ) {
28 if ( !empty( $this->mParams['rawrow'] ) ) {
29 return $value;
30 }
31
32 return parent::getTableRow( $value );
33 }
34
35 /**
36 * @param string $value
37 * @return string
38 * @since 1.20
39 */
40 public function getDiv( $value ) {
41 if ( !empty( $this->mParams['rawrow'] ) ) {
42 return $value;
43 }
44
45 return parent::getDiv( $value );
46 }
47
48 /**
49 * @param string $value
50 * @return string
51 * @since 1.20
52 */
53 public function getRaw( $value ) {
54 if ( !empty( $this->mParams['rawrow'] ) ) {
55 return $value;
56 }
57
58 return parent::getRaw( $value );
59 }
60
61 protected function needsLabel() {
62 return false;
63 }
64 }