3 final class PHUIApplicationMenuView
extends Phobject
{
10 private $items = array();
12 public function setViewer(PhabricatorUser
$viewer) {
13 $this->viewer
= $viewer;
17 public function getViewer() {
21 public function addLabel($name) {
22 $item = id(new PHUIListItemView())
25 return $this->addItem($item);
28 public function addLink($name, $href) {
29 $item = id(new PHUIListItemView())
33 return $this->addItem($item);
36 public function setProfileMenu(
37 AphrontSideNavFilterView
$nav) {
38 $this->profileMenu
= $nav;
42 public function getProfileMenu() {
43 return $this->profileMenu
;
46 public function addItem(PHUIListItemView
$item) {
47 $this->items
[] = $item;
51 public function setSearchEngine(PhabricatorApplicationSearchEngine
$engine) {
52 $this->searchEngine
= $engine;
56 public function getSearchEngine() {
57 return $this->searchEngine
;
60 public function setCrumbs(PHUICrumbsView
$crumbs) {
61 $this->crumbs
= $crumbs;
65 public function getCrumbs() {
69 public function buildListView() {
70 $viewer = $this->getViewer();
72 $view = id(new PHUIListView())
75 $profile_menu = $this->getProfileMenu();
77 foreach ($profile_menu->getMenu()->getItems() as $item) {
78 if ($item->getHideInApplicationMenu()) {
83 $view->addMenuItem($item);
87 $crumbs = $this->getCrumbs();
89 $actions = $crumbs->getActions();
91 $view->newLabel(pht('Create'));
92 foreach ($crumbs->getActions() as $action) {
93 $view->addMenuItem($action);
98 $engine = $this->getSearchEngine();
102 ->addNavigationItems($view);
105 foreach ($this->items
as $item) {
106 $view->addMenuItem($item);