Differential D17174 Diff 41305 src/applications/favorites/engine/PhabricatorFavoritesProfileMenuEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/favorites/engine/PhabricatorFavoritesProfileMenuEngine.php
Show All 14 Lines | if ($custom) { | ||||
return "/favorites/personal/item/{$path}"; | return "/favorites/personal/item/{$path}"; | ||||
} else { | } else { | ||||
return "/favorites/global/item/{$path}"; | return "/favorites/global/item/{$path}"; | ||||
} | } | ||||
} | } | ||||
protected function getBuiltinProfileItems($object) { | protected function getBuiltinProfileItems($object) { | ||||
$items = array(); | $items = array(); | ||||
$custom_phid = $this->getCustomPHID(); | |||||
$custom = $this->getCustomPHID(); | // Built-in Global Defaults | ||||
if (!$custom_phid) { | |||||
$create_task = array( | |||||
'name' => null, | |||||
'formKey' => | |||||
epriestley: Can we use constants for these? e.g. ManiphestEditEngine::whatever? Maybe with a static… | |||||
id(new ManiphestEditEngine())->getProfileMenuItemDefault(), | |||||
); | |||||
$create_project = array( | |||||
'name' => null, | |||||
'formKey' => | |||||
id(new PhabricatorProjectEditEngine())->getProfileMenuItemDefault(), | |||||
); | |||||
$create_repository = array( | |||||
'name' => null, | |||||
'formKey' => | |||||
id(new DiffusionRepositoryEditEngine())->getProfileMenuItemDefault(), | |||||
); | |||||
$items[] = $this->newItem() | |||||
->setBuiltinKey(PhabricatorFavoritesConstants::ITEM_TASK) | |||||
->setMenuItemKey(PhabricatorEditEngineProfileMenuItem::MENUITEMKEY) | |||||
->setMenuItemProperties($create_task); | |||||
$items[] = $this->newItem() | |||||
->setBuiltinKey(PhabricatorFavoritesConstants::ITEM_PROJECT) | |||||
->setMenuItemKey(PhabricatorEditEngineProfileMenuItem::MENUITEMKEY) | |||||
->setMenuItemProperties($create_project); | |||||
if ($custom) { | $items[] = $this->newItem() | ||||
->setBuiltinKey(PhabricatorFavoritesConstants::ITEM_REPOSITORY) | |||||
->setMenuItemKey(PhabricatorEditEngineProfileMenuItem::MENUITEMKEY) | |||||
->setMenuItemProperties($create_repository); | |||||
} | |||||
// Single Manage Item, switches URI based on admin/user | |||||
$items[] = $this->newItem() | $items[] = $this->newItem() | ||||
->setBuiltinKey(PhabricatorFavoritesConstants::ITEM_MANAGE) | ->setBuiltinKey(PhabricatorFavoritesConstants::ITEM_MANAGE) | ||||
->setMenuItemKey( | ->setMenuItemKey( | ||||
PhabricatorFavoritesManageProfileMenuItem::MENUITEMKEY); | PhabricatorFavoritesManageProfileMenuItem::MENUITEMKEY); | ||||
} | |||||
return $items; | return $items; | ||||
} | } | ||||
} | } |
Can we use constants for these? e.g. ManiphestEditEngine::whatever? Maybe with a static function on EditEngine to add the "/" in the middle?