Generate file attachment transactions for explicit Remarkup attachments on common...
[phabricator.git] / src / view / form / control / PHUIFormTimerControl.php
blob090de2c8e4b5505a07a36e498d4f9a6623d116ca
1 <?php
3 final class PHUIFormTimerControl extends AphrontFormControl {
5 private $icon;
6 private $updateURI;
8 public function setIcon(PHUIIconView $icon) {
9 $this->icon = $icon;
10 return $this;
13 public function getIcon() {
14 return $this->icon;
17 public function setUpdateURI($update_uri) {
18 $this->updateURI = $update_uri;
19 return $this;
22 public function getUpdateURI() {
23 return $this->updateURI;
26 protected function getCustomControlClass() {
27 return 'phui-form-timer';
30 protected function renderInput() {
31 return $this->newTimerView();
34 public function newTimerView() {
35 $icon_cell = phutil_tag(
36 'td',
37 array(
38 'class' => 'phui-form-timer-icon',
40 $this->getIcon());
42 $content_cell = phutil_tag(
43 'td',
44 array(
45 'class' => 'phui-form-timer-content',
47 $this->renderChildren());
49 $row = phutil_tag('tr', array(), array($icon_cell, $content_cell));
51 $node_id = null;
53 $update_uri = $this->getUpdateURI();
54 if ($update_uri) {
55 $node_id = celerity_generate_unique_node_id();
57 Javelin::initBehavior(
58 'phui-timer-control',
59 array(
60 'nodeID' => $node_id,
61 'uri' => $update_uri,
62 ));
65 return phutil_tag('table', array('id' => $node_id), $row);