1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Make PhabricatorObjectItemListView extend AphrontTagView

Summary: Provide all the setSigil() / setID() sorts of calls. No functional changes.

Test Plan: Viewed object item lists.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6112
This commit is contained in:
epriestley 2013-06-02 09:39:44 -07:00
parent bd9f29e0c4
commit 06338db5bb

View file

@ -1,6 +1,6 @@
<?php
final class PhabricatorObjectItemListView extends AphrontView {
final class PhabricatorObjectItemListView extends AphrontTagView {
private $header;
private $items;
@ -45,10 +45,32 @@ final class PhabricatorObjectItemListView extends AphrontView {
return $this;
}
public function render() {
protected function getTagName() {
return 'ul';
}
protected function getTagAttributes() {
$classes = array();
$classes[] = 'phabricator-object-item-list-view';
if ($this->stackable) {
$classes[] = 'phabricator-object-list-stackable';
}
if ($this->cards) {
$classes[] = 'phabricator-object-list-cards';
}
if ($this->flush) {
$classes[] = 'phabricator-object-list-flush';
}
return array(
'class' => $classes,
);
}
protected function getTagContent() {
require_celerity_resource('phabricator-object-item-list-view-css');
$classes = array();
$header = null;
if (strlen($this->header)) {
$header = phutil_tag(
@ -73,28 +95,12 @@ final class PhabricatorObjectItemListView extends AphrontView {
$pager = $this->pager;
}
$classes[] = 'phabricator-object-item-list-view';
if ($this->stackable) {
$classes[] = 'phabricator-object-list-stackable';
}
if ($this->cards) {
$classes[] = 'phabricator-object-list-cards';
}
if ($this->flush) {
$classes[] = 'phabricator-object-list-flush';
}
return phutil_tag(
'ul',
array(
'class' => implode(' ', $classes),
),
array(
$header,
$items,
$pager,
$this->renderChildren(),
));
return array(
$header,
$items,
$pager,
$this->renderChildren(),
);
}
}