Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
1.2 kB · 47 lines
PHP
at commit b2f3001e
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748<?php
final class PHUIButtonBarExample extends PhabricatorUIExample {
public function getName() { return pht('Button Bar'); }
public function getDescription() { return pht('A minimal UI for Buttons'); }
public function renderExample() { $request = $this->getRequest(); $user = $request->getUser();
// Icon Buttons $icons = array( 'Go Back' => 'chevron-left', 'Choose Date' => 'calendar', 'Edit View' => 'pencil', 'Go Forward' => 'chevron-right'); $button_bar = new PHUIButtonBarView(); foreach ($icons as $text => $icon) { $image = id(new PHUIIconView()) ->setSpriteSheet(PHUIIconView::SPRITE_BUTTONBAR) ->setSpriteIcon($icon); $button = id(new PHUIButtonView()) ->setTag('a') ->setColor(PHUIButtonView::GREY) ->setTitle($text) ->setIcon($image);
$button_bar->addButton($button); }
$layout = id(new PHUIBoxView()) ->appendChild($button_bar) ->addPadding(PHUI::PADDING_LARGE);
$wrap1 = id(new PHUIObjectBoxView()) ->setHeaderText('Button Bar Example') ->appendChild($layout);
return array($wrap1); }}