addButton( phutil_render_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 render() { if ($this->header !== null) { $header = '

'.$this->header.'

'; } else { $header = null; } $buttons = null; if ($this->buttons) { $buttons = '
'. implode(" ", $this->buttons). '
'; } $table = $this->renderChildren(); require_celerity_resource('aphront-panel-view-css'); $classes = $this->classes; $classes[] = 'aphront-panel-view'; if ($this->width) { $classes[] = 'aphront-panel-width-'.$this->width; } return phutil_render_tag( 'div', array( 'class' => implode(' ', $classes), 'id' => $this->id, ), $buttons.$header.$table); } }