MediaWiki REL1_31
UploadSourceField.php
Go to the documentation of this file.
1<?php
25
30 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 if ( isset( $this->mParams['radio-id'] ) ) {
36 $radioId = $this->mParams['radio-id'];
37 } else {
38 // Old way. For the benefit of extensions that do not define
39 // the 'radio-id' key.
40 $radioId = 'wpSourceType' . $this->mParams['upload-type'];
41 }
42
43 $attribs = [
44 'name' => 'wpSourceType',
45 'type' => 'radio',
46 'id' => $radioId,
47 'value' => $this->mParams['upload-type'],
48 ];
49
50 if ( !empty( $this->mParams['checked'] ) ) {
51 $attribs['checked'] = 'checked';
52 }
53
54 $label .= Html::element( 'input', $attribs );
55 }
56
57 return Html::rawElement( 'td', [ 'class' => 'mw-label' ] + $cellAttributes, $label );
58 }
59
63 function getSize() {
64 return isset( $this->mParams['size'] )
65 ? $this->mParams['size']
66 : 60;
67 }
68}
<input> field.
A form field that contains a radio box in the label.
getLabelHtml( $cellAttributes=[])
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
Definition hooks.txt:2014