addButton( phutil_tag( 'a', array( 'href' => $href, 'class' => 'button green', ), $create_button)); return $this; } public function addClass($class) { $this->classes[] = $class; return $this; } public function addButton($button) { $this->buttons[] = $button; return $this; } public function setHeader($header) { $this->header = $header; return $this; } public function setWidth($width) { $this->width = $width; return $this; } public function setID($id) { $this->id = $id; return $this; } public function setCaption($caption) { $this->caption = $caption; return $this; } public function setNoBackground() { $this->classes[] = 'aphront-panel-plain'; return $this; } public function render() { if ($this->header !== null) { $header = phutil_tag('h1', array(), $this->header); } else { $header = null; } if ($this->caption !== null) { $caption = phutil_tag( 'div', array('class' => 'aphront-panel-view-caption'), $this->caption); } else { $caption = null; } $buttons = null; if ($this->buttons) { $buttons = hsprintf( '
', phutil_implode_html(" ", $this->buttons)); } $header_elements = hsprintf( '