Page MenuHomePhorge

D25687.1734662117.diff
No OneTemporary

D25687.1734662117.diff

diff --git a/src/applications/people/controller/PhabricatorPeopleController.php b/src/applications/people/controller/PhabricatorPeopleController.php
--- a/src/applications/people/controller/PhabricatorPeopleController.php
+++ b/src/applications/people/controller/PhabricatorPeopleController.php
@@ -6,39 +6,33 @@
return true;
}
+ /**
+ * return AphrontSideNavFilterView
+ */
public function buildSideNavView($for_app = false) {
+ // we are on /people/*
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
- $name = null;
- if ($for_app) {
- $name = $this->getRequest()->getURIData('username');
- if ($name) {
- $nav->setBaseURI(new PhutilURI('/p/'));
- $nav->addFilter("{$name}/", $name);
- if (id(new PhabricatorCalendarApplication())->isInstalled()) {
- $nav->addFilter("{$name}/calendar/", pht('Calendar'));
- }
- }
- }
+ $viewer = $this->getRequest()->getUser();
+ id(new PhabricatorPeopleSearchEngine())
+ ->setViewer($viewer)
+ ->addNavigationItems($nav->getMenu());
- if (!$name) {
- $viewer = $this->getRequest()->getUser();
- id(new PhabricatorPeopleSearchEngine())
- ->setViewer($viewer)
- ->addNavigationItems($nav->getMenu());
-
- if ($viewer->getIsAdmin()) {
- $nav->addLabel(pht('User Administration'));
- $nav->addFilter('logs', pht('Activity Logs'));
- $nav->addFilter('invite', pht('Email Invitations'));
- }
+ if ($viewer->getIsAdmin()) {
+ $nav->addLabel(pht('User Administration'));
+ $nav->addFilter('logs', pht('Activity Logs'));
+ $nav->addFilter('invite', pht('Email Invitations'));
}
return $nav;
}
public function buildApplicationMenu() {
+ if ($this->getRequest()->getURIData('username')) {
+ // we are on /p/name/ so return the default user profile sidebar
+ return parent::buildApplicationMenu();
+ }
return $this->buildSideNavView(true)->getMenu();
}
diff --git a/src/applications/search/engine/PhabricatorProfileMenuEngine.php b/src/applications/search/engine/PhabricatorProfileMenuEngine.php
--- a/src/applications/search/engine/PhabricatorProfileMenuEngine.php
+++ b/src/applications/search/engine/PhabricatorProfileMenuEngine.php
@@ -87,6 +87,9 @@
abstract public function getItemURI($path);
abstract protected function isMenuEngineConfigurable();
+ /**
+ * @return array of PhabricatorProfileMenuItemConfiguration objects
+ */
abstract protected function getBuiltinProfileItems($object);
protected function getBuiltinCustomProfileItems(

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 02:35 (21 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016400
Default Alt Text
D25687.1734662117.diff (2 KB)

Event Timeline