mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-23 12:09:12 +01: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:
parent
bd9f29e0c4
commit
06338db5bb
1 changed files with 31 additions and 25 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class PhabricatorObjectItemListView extends AphrontView {
|
final class PhabricatorObjectItemListView extends AphrontTagView {
|
||||||
|
|
||||||
private $header;
|
private $header;
|
||||||
private $items;
|
private $items;
|
||||||
|
@ -45,10 +45,32 @@ final class PhabricatorObjectItemListView extends AphrontView {
|
||||||
return $this;
|
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');
|
require_celerity_resource('phabricator-object-item-list-view-css');
|
||||||
|
|
||||||
$classes = array();
|
|
||||||
$header = null;
|
$header = null;
|
||||||
if (strlen($this->header)) {
|
if (strlen($this->header)) {
|
||||||
$header = phutil_tag(
|
$header = phutil_tag(
|
||||||
|
@ -73,28 +95,12 @@ final class PhabricatorObjectItemListView extends AphrontView {
|
||||||
$pager = $this->pager;
|
$pager = $this->pager;
|
||||||
}
|
}
|
||||||
|
|
||||||
$classes[] = 'phabricator-object-item-list-view';
|
return array(
|
||||||
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,
|
$header,
|
||||||
$items,
|
$items,
|
||||||
$pager,
|
$pager,
|
||||||
$this->renderChildren(),
|
$this->renderChildren(),
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue