MediaWiki master
UploadSourceField.php
Go to the documentation of this file.
1<?php
9
14
19 public function getLabelHtml( $cellAttributes = [] ) {
20 $id = $this->mParams['id'];
21 $label = Html::rawElement( 'label', [ 'for' => $id ], $this->mLabel );
22
23 if ( !empty( $this->mParams['radio'] ) ) {
24 $radioId = $this->mParams['radio-id'] ??
25 // Old way. For the benefit of extensions that do not define
26 // the 'radio-id' key.
27 'wpSourceType' . $this->mParams['upload-type'];
28
29 $attribs = [
30 'name' => 'wpSourceType',
31 'type' => 'radio',
32 'id' => $radioId,
33 'value' => $this->mParams['upload-type'],
34 ];
35
36 if ( !empty( $this->mParams['checked'] ) ) {
37 $attribs['checked'] = 'checked';
38 }
39
40 $label .= Html::element( 'input', $attribs );
41 }
42
43 return Html::rawElement( 'td', [ 'class' => 'mw-label' ] + $cellAttributes, $label );
44 }
45
49 public function getSize() {
50 return $this->mParams['size'] ?? 60;
51 }
52}
This class is a collection of static functions that serve two purposes:
Definition Html.php:43
A form field that contains a radio box in the label.
getLabelHtml( $cellAttributes=[])