Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIButtonBarView.php
<?php | <?php | ||||
final class PHUIButtonBarView extends AphrontTagView { | final class PHUIButtonBarView extends AphrontTagView { | ||||
private $buttons = array(); | private $buttons = array(); | ||||
public function addButton($button) { | public function addButton($button) { | ||||
$this->buttons[] = $button; | $this->buttons[] = $button; | ||||
return $this; | return $this; | ||||
} | } | ||||
protected function getTagAttributes() { | protected function getTagAttributes() { | ||||
return array('class' => 'phui-button-bar'); | return array('class' => 'phui-button-bar'); | ||||
} | } | ||||
public function getTagName() { | protected function getTagName() { | ||||
return 'div'; | return 'div'; | ||||
} | } | ||||
public function getTagContent() { | protected function getTagContent() { | ||||
require_celerity_resource('phui-button-css'); | require_celerity_resource('phui-button-css'); | ||||
$i = 1; | $i = 1; | ||||
$j = count($this->buttons); | $j = count($this->buttons); | ||||
foreach ($this->buttons as $button) { | foreach ($this->buttons as $button) { | ||||
// LeeLoo Dallas Multi-Pass | // LeeLoo Dallas Multi-Pass | ||||
if ($j > 1) { | if ($j > 1) { | ||||
if ($i == 1) { | if ($i == 1) { | ||||
Show All 14 Lines |