mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 03:02:43 +01:00
309e40b4d7
Summary: I'll build out a PHUI Class for this soonish. Test Plan: UIExamples Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6023
59 lines
1.4 KiB
PHP
59 lines
1.4 KiB
PHP
<?php
|
|
|
|
final class PhabricatorButtonsExample extends PhabricatorUIExample {
|
|
|
|
public function getName() {
|
|
return 'Buttons';
|
|
}
|
|
|
|
public function getDescription() {
|
|
return hsprintf('Use <tt><button></tt> to render buttons.');
|
|
}
|
|
|
|
public function renderExample() {
|
|
$request = $this->getRequest();
|
|
$user = $request->getUser();
|
|
|
|
$colors = array('', 'green', 'grey', 'black', 'disabled');
|
|
$sizes = array('', 'small');
|
|
$tags = array('a', 'button');
|
|
|
|
$view = array();
|
|
foreach ($tags as $tag) {
|
|
foreach ($colors as $color) {
|
|
foreach ($sizes as $size) {
|
|
$class = implode(' ', array($color, $size));
|
|
|
|
if ($tag == 'a') {
|
|
$class .= ' button';
|
|
}
|
|
|
|
$view[] = phutil_tag(
|
|
$tag,
|
|
array(
|
|
'class' => $class,
|
|
),
|
|
phutil_utf8_ucwords($size.' '.$color.' '.$tag));
|
|
|
|
$view[] = hsprintf('<br /><br />');
|
|
}
|
|
}
|
|
}
|
|
|
|
foreach ($colors as $color) {
|
|
$caret = phutil_tag('span', array('class' => 'caret'), '');
|
|
$view[] = phutil_tag(
|
|
'a',
|
|
array(
|
|
'class' => $color.' button dropdown'
|
|
),
|
|
array(
|
|
phutil_utf8_ucwords($color.' Dropdown'),
|
|
$caret,
|
|
));
|
|
$view[] = hsprintf('<br /><br />');
|
|
}
|
|
|
|
return phutil_tag('div', array('style' => 'margin: 1em 2em;'), $view);
|
|
}
|
|
}
|