mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 08:12:40 +01:00
3f439e25bc
Summary: Ref T10054. Just simplifying this a bit before I start laying in the new profile menus. Test Plan: - Viewed Diviner on desktop and checked the mobile menu. - Viewed Files on desktop and checked the mobile menu. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10054 Differential Revision: https://secure.phabricator.com/D15015
36 lines
890 B
PHP
36 lines
890 B
PHP
<?php
|
|
|
|
abstract class DivinerController extends PhabricatorController {
|
|
|
|
public function buildApplicationMenu() {
|
|
return $this->newApplicationMenu()
|
|
->setSearchEngine(new DivinerAtomSearchEngine());
|
|
}
|
|
|
|
protected function renderAtomList(array $symbols) {
|
|
assert_instances_of($symbols, 'DivinerLiveSymbol');
|
|
|
|
$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;
|
|
}
|
|
|
|
}
|