Differential D17410 Diff 41866 src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/engine/PhabricatorPeopleProfileMenuEngine.php
<?php | <?php | ||||
final class PhabricatorPeopleProfileMenuEngine | final class PhabricatorPeopleProfileMenuEngine | ||||
extends PhabricatorProfileMenuEngine { | extends PhabricatorProfileMenuEngine { | ||||
const ITEM_PROFILE = 'people.profile'; | const ITEM_PROFILE = 'people.profile'; | ||||
const ITEM_MANAGE = 'people.manage'; | const ITEM_MANAGE = 'people.manage'; | ||||
const ITEM_PICTURE = 'people.picture'; | const ITEM_PICTURE = 'people.picture'; | ||||
const ITEM_BADGES = 'people.badges'; | |||||
protected function isMenuEngineConfigurable() { | protected function isMenuEngineConfigurable() { | ||||
return false; | return false; | ||||
} | } | ||||
public function getItemURI($path) { | public function getItemURI($path) { | ||||
$user = $this->getProfileObject(); | $user = $this->getProfileObject(); | ||||
$username = $user->getUsername(); | $username = $user->getUsername(); | ||||
Show All 9 Lines | protected function getBuiltinProfileItems($object) { | ||||
$items[] = $this->newItem() | $items[] = $this->newItem() | ||||
->setBuiltinKey(self::ITEM_PICTURE) | ->setBuiltinKey(self::ITEM_PICTURE) | ||||
->setMenuItemKey(PhabricatorPeoplePictureProfileMenuItem::MENUITEMKEY); | ->setMenuItemKey(PhabricatorPeoplePictureProfileMenuItem::MENUITEMKEY); | ||||
$items[] = $this->newItem() | $items[] = $this->newItem() | ||||
->setBuiltinKey(self::ITEM_PROFILE) | ->setBuiltinKey(self::ITEM_PROFILE) | ||||
->setMenuItemKey(PhabricatorPeopleDetailsProfileMenuItem::MENUITEMKEY); | ->setMenuItemKey(PhabricatorPeopleDetailsProfileMenuItem::MENUITEMKEY); | ||||
$have_badges = PhabricatorApplication::isClassInstalledForViewer( | |||||
'PhabricatorBadgesApplication', | |||||
$viewer); | |||||
if ($have_badges) { | |||||
$items[] = $this->newItem() | |||||
->setBuiltinKey(self::ITEM_BADGES) | |||||
->setMenuItemKey(PhabricatorPeopleBadgesProfileMenuItem::MENUITEMKEY); | |||||
} | |||||
$have_maniphest = PhabricatorApplication::isClassInstalledForViewer( | $have_maniphest = PhabricatorApplication::isClassInstalledForViewer( | ||||
'PhabricatorManiphestApplication', | 'PhabricatorManiphestApplication', | ||||
$viewer); | $viewer); | ||||
if ($have_maniphest) { | if ($have_maniphest) { | ||||
$uri = urisprintf( | $uri = urisprintf( | ||||
'/maniphest/?statuses=open()&assigned=%s#R', | '/maniphest/?statuses=open()&assigned=%s#R', | ||||
$object->getPHID()); | $object->getPHID()); | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |