3 final class PHUIButtonBarView
extends AphrontTagView
{
5 private $buttons = array();
8 public function addButton($button) {
9 $this->buttons
[] = $button;
13 public function setBorderless($borderless) {
14 $this->borderless
= $borderless;
18 protected function getTagAttributes() {
20 $classes[] = 'phui-button-bar';
21 if ($this->borderless
) {
22 $classes[] = 'phui-button-bar-borderless';
24 return array('class' => implode(' ', $classes));
27 protected function getTagName() {
31 protected function getTagContent() {
32 require_celerity_resource('phui-button-bar-css');
35 $j = count($this->buttons
);
36 foreach ($this->buttons
as $button) {
37 // LeeLoo Dallas Multi-Pass
40 $button->addClass('phui-button-bar-first');
41 } else if ($i == $j) {
42 $button->addClass('phui-button-bar-last');
44 $button->addClass('phui-button-bar-middle');
47 $this->appendChild($button);
51 return $this->renderChildren();