Path: blob/master/src/applications/home/engine/PhabricatorHomeProfileMenuEngine.php
12256 views
<?php12final class PhabricatorHomeProfileMenuEngine3extends PhabricatorProfileMenuEngine {45protected function isMenuEngineConfigurable() {6return true;7}89public function getItemURI($path) {10return "/home/menu/{$path}";11}1213protected function buildItemViewContent(14PhabricatorProfileMenuItemConfiguration $item) {15$viewer = $this->getViewer();1617// Add content to the document so that you can drag-and-drop files onto18// the home page or any home dashboard to upload them.1920$upload = id(new PhabricatorGlobalUploadTargetView())21->setUser($viewer);2223$content = parent::buildItemViewContent($item);2425return array(26$content,27$upload,28);29}3031protected function getBuiltinProfileItems($object) {32$viewer = $this->getViewer();33$items = array();34$custom_phid = $this->getCustomPHID();3536$applications = id(new PhabricatorApplicationQuery())37->setViewer($viewer)38->withInstalled(true)39->withUnlisted(false)40->withLaunchable(true)41->execute();4243// Default Home Dashboard44$items[] = $this->newItem()45->setBuiltinKey(PhabricatorHomeConstants::ITEM_HOME)46->setMenuItemKey(PhabricatorHomeProfileMenuItem::MENUITEMKEY);4748$items[] = $this->newItem()49->setBuiltinKey(PhabricatorHomeConstants::ITEM_APPS_LABEL)50->setMenuItemKey(PhabricatorLabelProfileMenuItem::MENUITEMKEY)51->setMenuItemProperties(array('name' => pht('Favorites')));5253foreach ($applications as $application) {54if (!$application->isPinnedByDefault($viewer)) {55continue;56}5758$properties = array(59'name' => '',60'application' => $application->getPHID(),61);6263$items[] = $this->newItem()64->setBuiltinKey($application->getPHID())65->setMenuItemKey(PhabricatorApplicationProfileMenuItem::MENUITEMKEY)66->setMenuItemProperties($properties);67}6869$items[] = $this->newItem()70->setBuiltinKey(PhabricatorHomeConstants::ITEM_LAUNCHER)71->setMenuItemKey(PhabricatorHomeLauncherProfileMenuItem::MENUITEMKEY);7273$items[] = $this->newDividerItem('tail');7475$items[] = $this->newManageItem();7677return $items;78}7980}818283