mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02:41 +01:00
5ba20b8924
Summary: Adds plain support for object lists that just look like lists Test Plan: review UIexamples and a number of other applications Reviewers: epriestley, btrahan Reviewed By: epriestley CC: Korvin, aran Differential Revision: https://secure.phabricator.com/D6922
49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
abstract class DivinerController extends PhabricatorController {
|
|
|
|
protected function buildSideNavView() {
|
|
$menu = $this->buildMenu();
|
|
return AphrontSideNavFilterView::newFromMenu($menu);
|
|
}
|
|
|
|
protected function buildApplicationMenu() {
|
|
return $this->buildMenu();
|
|
}
|
|
|
|
private function buildMenu() {
|
|
$menu = new PHUIListView();
|
|
|
|
id(new DivinerAtomSearchEngine())
|
|
->setViewer($this->getRequest()->getUser())
|
|
->addNavigationItems($menu);
|
|
|
|
return $menu;
|
|
}
|
|
|
|
protected function renderAtomList(array $symbols) {
|
|
assert_instances_of($symbols, 'DivinerLiveSymbol');
|
|
|
|
$request = $this->getRequest();
|
|
$user = $request->getUser();
|
|
|
|
$list = id(new PHUIObjectItemListView())
|
|
->setUser($user);
|
|
|
|
foreach ($symbols as $symbol) {
|
|
$item = id(new PHUIObjectItemView())
|
|
->setHeader($symbol->getTitle())
|
|
->setHref($symbol->getURI())
|
|
->addIcon('none',
|
|
DivinerAtom::getAtomTypeNameString(
|
|
$symbol->getType()));
|
|
|
|
$item->addAttribute($symbol->getSummary());
|
|
|
|
$list->addItem($item);
|
|
}
|
|
|
|
return $list;
|
|
}
|
|
|
|
}
|