Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/view/form/control/AphrontFormTextWithSubmitControl.php
12262 views
1
<?php
2
3
final class AphrontFormTextWithSubmitControl extends AphrontFormControl {
4
5
private $submitLabel;
6
7
public function setSubmitLabel($submit_label) {
8
$this->submitLabel = $submit_label;
9
return $this;
10
}
11
12
public function getSubmitLabel() {
13
return $this->submitLabel;
14
}
15
16
protected function getCustomControlClass() {
17
return 'aphront-form-control-text-with-submit';
18
}
19
20
protected function renderInput() {
21
return phutil_tag(
22
'div',
23
array(
24
'class' => 'text-with-submit-control-outer-bounds',
25
),
26
array(
27
phutil_tag(
28
'div',
29
array(
30
'class' => 'text-with-submit-control-text-bounds',
31
),
32
javelin_tag(
33
'input',
34
array(
35
'type' => 'text',
36
'class' => 'text-with-submit-control-text',
37
'name' => $this->getName(),
38
'value' => $this->getValue(),
39
'disabled' => $this->getDisabled() ? 'disabled' : null,
40
'id' => $this->getID(),
41
))),
42
phutil_tag(
43
'div',
44
array(
45
'class' => 'text-with-submit-control-submit-bounds',
46
),
47
javelin_tag(
48
'input',
49
array(
50
'type' => 'submit',
51
'class' => 'text-with-submit-control-submit grey',
52
'value' => coalesce($this->getSubmitLabel(), pht('Submit')),
53
))),
54
));
55
}
56
57
}
58
59