forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAphrontFormTextWithSubmitControl.php
57 lines (50 loc) · 1.45 KB
/
AphrontFormTextWithSubmitControl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
final class AphrontFormTextWithSubmitControl extends AphrontFormControl {
private $submitLabel;
public function setSubmitLabel($submit_label) {
$this->submitLabel = $submit_label;
return $this;
}
public function getSubmitLabel() {
return $this->submitLabel;
}
protected function getCustomControlClass() {
return 'aphront-form-control-text-with-submit';
}
protected function renderInput() {
return phutil_tag(
'div',
array(
'class' => 'text-with-submit-control-outer-bounds',
),
array(
phutil_tag(
'div',
array(
'class' => 'text-with-submit-control-text-bounds',
),
javelin_tag(
'input',
array(
'type' => 'text',
'class' => 'text-with-submit-control-text',
'name' => $this->getName(),
'value' => $this->getValue(),
'disabled' => $this->getDisabled() ? 'disabled' : null,
'id' => $this->getID(),
))),
phutil_tag(
'div',
array(
'class' => 'text-with-submit-control-submit-bounds',
),
javelin_tag(
'input',
array(
'type' => 'submit',
'class' => 'text-with-submit-control-submit grey',
'value' => coalesce($this->getSubmitLabel(), pht('Submit')),
))),
));
}
}