mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 03:02:43 +01:00
a0f534b87c
Summary: - Render functions as `func()` for consistency/clarity. - Sort articles first. - Sort case insensitively. - Label the "no group" symbols. Test Plan: Regenerated and examined docs. Reviewers: btrahan, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D8480
55 lines
1.2 KiB
PHP
55 lines
1.2 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 = array();
|
|
foreach ($symbols as $symbol) {
|
|
|
|
switch ($symbol->getType()) {
|
|
case DivinerAtom::TYPE_FUNCTION:
|
|
$title = $symbol->getTitle().'()';
|
|
break;
|
|
default:
|
|
$title = $symbol->getTitle();
|
|
break;
|
|
}
|
|
|
|
$item = id(new DivinerBookItemView())
|
|
->setTitle($title)
|
|
->setHref($symbol->getURI())
|
|
->setSubtitle($symbol->getSummary())
|
|
->setType(DivinerAtom::getAtomTypeNameString(
|
|
$symbol->getType()));
|
|
|
|
$list[] = $item;
|
|
}
|
|
|
|
return $list;
|
|
}
|
|
|
|
}
|