MediaWiki REL1_35
UploadSourceField.php
Go to the documentation of this file.
1<?php
25
30 public function getLabelHtml( $cellAttributes = [] ) {
31 $id = $this->mParams['id'];
32 $label = Html::rawElement( 'label', [ 'for' => $id ], $this->mLabel );
33
34 if ( !empty( $this->mParams['radio'] ) ) {
35 $radioId = $this->mParams['radio-id'] ??
36 // Old way. For the benefit of extensions that do not define
37 // the 'radio-id' key.
38 'wpSourceType' . $this->mParams['upload-type'];
39
40 $attribs = [
41 'name' => 'wpSourceType',
42 'type' => 'radio',
43 'id' => $radioId,
44 'value' => $this->mParams['upload-type'],
45 ];
46
47 if ( !empty( $this->mParams['checked'] ) ) {
48 $attribs['checked'] = 'checked';
49 }
50
51 $label .= Html::element( 'input', $attribs );
52 }
53
54 return Html::rawElement( 'td', [ 'class' => 'mw-label' ] + $cellAttributes, $label );
55 }
56
60 public function getSize() {
61 return $this->mParams['size'] ?? 60;
62 }
63}
<input> field.
A form field that contains a radio box in the label.
getLabelHtml( $cellAttributes=[])