Files
phabricator/src/view/layout/AphrontContextBarView.php
Jakub Vrana fd8d9ff0d6 Replace some hsprintf() with phutil_tag() and phutil_tag_div() Depends on D7545.
Test Plan: This is one of the rare moments where unit tests for views would be useful.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7547
2013-11-09 10:48:19 -08:00

30 lines
733 B
PHP

<?php
final class AphrontContextBarView extends AphrontView {
protected $buttons = array();
public function addButton($button) {
$this->buttons[] = $button;
return $this;
}
public function render() {
$view = new AphrontNullView();
$view->appendChild($this->buttons);
require_celerity_resource('aphront-contextbar-view-css');
return phutil_tag_div(
'aphront-contextbar-view',
array(
phutil_tag_div('aphront-contextbar-core', array(
phutil_tag_div('aphront-contextbar-buttons', $view->render()),
phutil_tag_div('aphront-contextbar-content', $this->renderChildren()),
)),
phutil_tag('div', array('style' => 'clear: both;')),
));
}
}