mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-15 17:21:10 +01:00
49 lines
886 B
PHP
49 lines
886 B
PHP
|
<?php
|
||
|
|
||
|
final class PHUIBadgeBoxView extends AphrontTagView {
|
||
|
|
||
|
private $items = array();
|
||
|
|
||
|
public function addItem($item) {
|
||
|
$this->items[] = $item;
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function addItems($items) {
|
||
|
foreach ($items as $item) {
|
||
|
$this->items[] = $item;
|
||
|
}
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
protected function getTagName() {
|
||
|
return 'ul';
|
||
|
}
|
||
|
|
||
|
protected function getTagAttributes() {
|
||
|
require_celerity_resource('phui-badge-view-css');
|
||
|
|
||
|
$classes = array();
|
||
|
$classes[] = 'phui-badge-flex-view';
|
||
|
$classes[] = 'grouped';
|
||
|
|
||
|
return array(
|
||
|
'class' => implode(' ', $classes),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
protected function getTagContent() {
|
||
|
$items = array();
|
||
|
foreach ($this->items as $item) {
|
||
|
$items[] = phutil_tag(
|
||
|
'li',
|
||
|
array(
|
||
|
'class' => 'phui-badge-flex-item',
|
||
|
),
|
||
|
$item);
|
||
|
}
|
||
|
return $items;
|
||
|
|
||
|
}
|
||
|
}
|