Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectController.php
| Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | if (!$this->profileMenu) { | ||||
| $this->profileMenu = $engine->buildNavigation(); | $this->profileMenu = $engine->buildNavigation(); | ||||
| } | } | ||||
| } | } | ||||
| return $this->profileMenu; | return $this->profileMenu; | ||||
| } | } | ||||
| protected function buildApplicationCrumbs() { | protected function buildApplicationCrumbs() { | ||||
| return $this->newApplicationCrumbs('profile'); | |||||
| } | |||||
| protected function newWorkboardCrumbs() { | |||||
| return $this->newApplicationCrumbs('workboard'); | |||||
| } | |||||
| private function newApplicationCrumbs($mode) { | |||||
| $crumbs = parent::buildApplicationCrumbs(); | $crumbs = parent::buildApplicationCrumbs(); | ||||
| $project = $this->getProject(); | $project = $this->getProject(); | ||||
| if ($project) { | if ($project) { | ||||
| $ancestors = $project->getAncestorProjects(); | $ancestors = $project->getAncestorProjects(); | ||||
| $ancestors = array_reverse($ancestors); | $ancestors = array_reverse($ancestors); | ||||
| $ancestors[] = $project; | $ancestors[] = $project; | ||||
| foreach ($ancestors as $ancestor) { | foreach ($ancestors as $ancestor) { | ||||
| $crumbs->addTextCrumb( | if ($ancestor->getPHID() === $project->getPHID()) { | ||||
| $ancestor->getName(), | // Link the current project's crumb to its profile no matter what, | ||||
| $ancestor->getProfileURI() | // since we're already on the right context page for it and linking | ||||
| ); | // to the current page isn't helpful. | ||||
| $crumb_uri = $ancestor->getProfileURI(); | |||||
| } else { | |||||
| switch ($mode) { | |||||
| case 'workboard': | |||||
| $crumb_uri = $ancestor->getWorkboardURI(); | |||||
| break; | |||||
| case 'profile': | |||||
| default: | |||||
| $crumb_uri = $ancestor->getProfileURI(); | |||||
| break; | |||||
| } | |||||
| } | |||||
| $crumbs->addTextCrumb($ancestor->getName(), $crumb_uri); | |||||
| } | } | ||||
| } | } | ||||
| return $crumbs; | return $crumbs; | ||||
| } | } | ||||
| protected function getProfileMenuEngine() { | protected function getProfileMenuEngine() { | ||||
| if (!$this->profileMenuEngine) { | if (!$this->profileMenuEngine) { | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||