Differential D20358 Diff 48609 src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/menuitem/PhabricatorProjectProfileMenuItem.php
Show All 29 Lines | public function getProject() { | ||||
if (!$project) { | if (!$project) { | ||||
return null; | return null; | ||||
} else if ($project->isArchived()) { | } else if ($project->isArchived()) { | ||||
return null; | return null; | ||||
} | } | ||||
return $project; | return $project; | ||||
} | } | ||||
public function willBuildNavigationItems(array $items) { | public function willGetMenuItemViewList(array $items) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$project_phids = array(); | $project_phids = array(); | ||||
foreach ($items as $item) { | foreach ($items as $item) { | ||||
$project_phids[] = $item->getMenuItemProperty('project'); | $project_phids[] = $item->getMenuItemProperty('project'); | ||||
} | } | ||||
$projects = id(new PhabricatorProjectQuery()) | $projects = id(new PhabricatorProjectQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
Show All 38 Lines | public function buildEditEngineFields( | ||||
); | ); | ||||
} | } | ||||
private function getName( | private function getName( | ||||
PhabricatorProfileMenuItemConfiguration $config) { | PhabricatorProfileMenuItemConfiguration $config) { | ||||
return $config->getMenuItemProperty('name'); | return $config->getMenuItemProperty('name'); | ||||
} | } | ||||
protected function newNavigationMenuItems( | protected function newMenuItemViewList( | ||||
PhabricatorProfileMenuItemConfiguration $config) { | PhabricatorProfileMenuItemConfiguration $config) { | ||||
$project = $this->getProject(); | $project = $this->getProject(); | ||||
if (!$project) { | if (!$project) { | ||||
return array(); | return array(); | ||||
} | } | ||||
$picture = $project->getProfileImageURI(); | $picture = $project->getProfileImageURI(); | ||||
$name = $this->getDisplayName($config); | $name = $this->getDisplayName($config); | ||||
$href = $project->getURI(); | $uri = $project->getURI(); | ||||
$item = $this->newItem() | $item = $this->newItemView() | ||||
->setHref($href) | ->setURI($uri) | ||||
->setName($name) | ->setName($name) | ||||
->setProfileImage($picture); | ->setIconImage($picture); | ||||
return array( | return array( | ||||
$item, | $item, | ||||
); | ); | ||||
} | } | ||||
public function validateTransactions( | public function validateTransactions( | ||||
PhabricatorProfileMenuItemConfiguration $config, | PhabricatorProfileMenuItemConfiguration $config, | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |