2011-01-16 13:51:39 -08:00
|
|
|
<?php
|
|
|
|
|
2012-03-13 16:21:04 -07:00
|
|
|
final class AphrontFormTextControl extends AphrontFormControl {
|
2011-01-16 13:51:39 -08:00
|
|
|
|
2012-04-04 16:09:29 -07:00
|
|
|
private $disableAutocomplete;
|
|
|
|
private $sigil;
|
2014-05-22 09:12:54 -07:00
|
|
|
private $placeholder;
|
2012-04-04 16:09:29 -07:00
|
|
|
|
|
|
|
public function setDisableAutocomplete($disable) {
|
|
|
|
$this->disableAutocomplete = $disable;
|
|
|
|
return $this;
|
|
|
|
}
|
2014-05-22 09:12:54 -07:00
|
|
|
|
2012-04-04 16:09:29 -07:00
|
|
|
private function getDisableAutocomplete() {
|
|
|
|
return $this->disableAutocomplete;
|
|
|
|
}
|
2013-04-23 09:41:46 -07:00
|
|
|
|
2014-05-22 09:12:54 -07:00
|
|
|
public function getPlaceholder() {
|
|
|
|
return $this->placeholder;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setPlaceholder($placeholder) {
|
|
|
|
$this->placeholder = $placeholder;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2012-04-04 16:09:29 -07:00
|
|
|
public function getSigil() {
|
|
|
|
return $this->sigil;
|
|
|
|
}
|
2014-05-22 09:12:54 -07:00
|
|
|
|
2012-04-04 16:09:29 -07:00
|
|
|
public function setSigil($sigil) {
|
|
|
|
$this->sigil = $sigil;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2011-01-16 13:51:39 -08:00
|
|
|
protected function getCustomControlClass() {
|
|
|
|
return 'aphront-form-control-text';
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function renderInput() {
|
2013-01-25 12:57:17 -08:00
|
|
|
return javelin_tag(
|
2011-01-16 13:51:39 -08:00
|
|
|
'input',
|
|
|
|
array(
|
2012-04-04 16:09:29 -07:00
|
|
|
'type' => 'text',
|
|
|
|
'name' => $this->getName(),
|
|
|
|
'value' => $this->getValue(),
|
|
|
|
'disabled' => $this->getDisabled() ? 'disabled' : null,
|
|
|
|
'autocomplete' => $this->getDisableAutocomplete() ? 'off' : null,
|
|
|
|
'id' => $this->getID(),
|
|
|
|
'sigil' => $this->getSigil(),
|
2014-05-22 09:12:54 -07:00
|
|
|
'placeholder' => $this->getPlaceholder()
|
2011-01-16 13:51:39 -08:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|