Differential D17174 Diff 41305 src/applications/favorites/menuitem/PhabricatorFavoritesManageProfileMenuItem.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/favorites/menuitem/PhabricatorFavoritesManageProfileMenuItem.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | return array( | ||||
->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
->setPlaceholder($this->getDefaultName()) | ->setPlaceholder($this->getDefaultName()) | ||||
->setValue($config->getMenuItemProperty('name')), | ->setValue($config->getMenuItemProperty('name')), | ||||
); | ); | ||||
} | } | ||||
protected function newNavigationMenuItems( | protected function newNavigationMenuItems( | ||||
PhabricatorProfileMenuItemConfiguration $config) { | PhabricatorProfileMenuItemConfiguration $config) { | ||||
$viewer = $this->getViewer(); | |||||
if ($viewer->isLoggedIn()) { | |||||
$admin = $viewer->getIsAdmin(); | |||||
$name = $this->getDisplayName($config); | $name = $this->getDisplayName($config); | ||||
$icon = 'fa-pencil'; | $icon = 'fa-pencil'; | ||||
$href = '/favorites/personal/item/configure/'; | $href = '/favorites/personal/item/configure/'; | ||||
if ($admin) { | |||||
$href = '/favorites/'; | |||||
} | |||||
$item = $this->newItem() | $item = $this->newItem() | ||||
->setHref($href) | ->setHref($href) | ||||
->setName($name) | ->setName($name) | ||||
->setIcon($icon); | ->setIcon($icon); | ||||
} | |||||
return array( | return array( | ||||
$item, | $item, | ||||
); | ); | ||||
} | } | ||||
} | } |