Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263<?php
final class PHUIFormNumberControl extends AphrontFormControl {
private $disableAutocomplete; private $autofocus; private $readOnly;
public function setDisableAutocomplete($disable_autocomplete) { $this->disableAutocomplete = $disable_autocomplete; return $this; }
public function getDisableAutocomplete() { return $this->disableAutocomplete; }
public function setAutofocus($autofocus) { $this->autofocus = $autofocus; return $this; }
public function getAutofocus() { return $this->autofocus; }
public function setReadOnly($read_only) { $this->readOnly = $read_only; return $this; }
protected function getReadOnly() { return $this->readOnly; }
protected function getCustomControlClass() { return 'phui-form-number'; }
protected function renderInput() { if ($this->getDisableAutocomplete()) { $autocomplete = 'off'; } else { $autocomplete = null; }
return javelin_tag( 'input', array( 'type' => 'text', 'pattern' => '\d*', 'name' => $this->getName(), 'value' => $this->getValue(), 'disabled' => $this->getDisabled() ? 'disabled' : null, 'readonly' => $this->getReadOnly() ? 'readonly' : null, 'autocomplete' => $autocomplete, 'id' => $this->getID(), 'autofocus' => ($this->getAutofocus() ? 'autofocus' : null), )); }
}