submitURI = $uri; return $this; } public function setTitle($title) { $this->title = $title; return $this; } public function getTitle() { return $this->title; } public function addSubmitButton($text = 'Okay') { $this->submitButton = $text; return $this; } public function addCancelButton($uri) { $this->cancelURI = $uri; return $this; } final public function render() { require_celerity_resource('aphront-dialog-view-css'); $buttons = array(); if ($this->submitButton) { $buttons[] = ''; } if ($this->cancelURI) { $buttons[] = phutil_render_tag( 'a', array( 'href' => $this->cancelURI, 'class' => 'button grey', ), 'Cancel'); } return phutil_render_tag( 'form', array( 'class' => 'aphront-dialog-view', 'action' => $this->submitURI, 'method' => 'post', ), ''. '
'. phutil_escape_html($this->title). '
'. '
'. $this->renderChildren(). '
'. '
'. implode('', $buttons). '
'. '
'); } }