[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/view/phui/ -> PHUIButtonBarView.php (source)

   1  <?php
   2  
   3  final class PHUIButtonBarView extends AphrontTagView {
   4  
   5    private $buttons = array();
   6  
   7    public function addButton($button) {
   8      $this->buttons[] = $button;
   9      return $this;
  10    }
  11  
  12    protected function getTagAttributes() {
  13      return array('class' => 'phui-button-bar');
  14    }
  15  
  16    public function getTagName() {
  17      return 'div';
  18    }
  19  
  20    public function getTagContent() {
  21      require_celerity_resource('phui-button-css');
  22  
  23      $i = 1;
  24      $j = count($this->buttons);
  25      foreach ($this->buttons as $button) {
  26        // LeeLoo Dallas Multi-Pass
  27        if ($j > 1) {
  28          if ($i == 1) {
  29            $button->addClass('phui-button-bar-first');
  30          } else if ($i == $j) {
  31            $button->addClass('phui-button-bar-last');
  32          } else if ($j > 1) {
  33            $button->addClass('phui-button-bar-middle');
  34          }
  35        }
  36        $this->appendChild($button);
  37        $i++;
  38      }
  39  
  40      return $this->renderChildren();
  41    }
  42  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1