mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
da5d01e542
Summary: Ref T10054. Primary goal is to be able to remove IconNav from the codebase. I've made these non-editable so users can't customize them yet. We //might// want administrators to customize these globally instead? In any case, we avoid a bunch of product questions by just locking these down for now. Test Plan: {F1061348} Reviewers: chad Reviewed By: chad Maniphest Tasks: T10054 Differential Revision: https://secure.phabricator.com/D15020
63 lines
1.3 KiB
PHP
63 lines
1.3 KiB
PHP
<?php
|
|
|
|
abstract class PhabricatorPeopleProfileController
|
|
extends PhabricatorPeopleController {
|
|
|
|
private $user;
|
|
private $profileMenu;
|
|
|
|
public function shouldRequireAdmin() {
|
|
return false;
|
|
}
|
|
|
|
public function setUser(PhabricatorUser $user) {
|
|
$this->user = $user;
|
|
return $this;
|
|
}
|
|
|
|
public function getUser() {
|
|
return $this->user;
|
|
}
|
|
|
|
public function buildApplicationMenu() {
|
|
$menu = $this->newApplicationMenu();
|
|
|
|
$profile_menu = $this->getProfileMenu();
|
|
if ($profile_menu) {
|
|
$menu->setProfileMenu($profile_menu);
|
|
}
|
|
|
|
return $menu;
|
|
}
|
|
|
|
protected function getProfileMenu() {
|
|
if (!$this->profileMenu) {
|
|
$user = $this->getUser();
|
|
if ($user) {
|
|
$viewer = $this->getViewer();
|
|
|
|
$engine = id(new PhabricatorPeopleProfilePanelEngine())
|
|
->setViewer($viewer)
|
|
->setProfileObject($user);
|
|
|
|
$this->profileMenu = $engine->buildNavigation();
|
|
}
|
|
}
|
|
|
|
return $this->profileMenu;
|
|
}
|
|
|
|
protected function buildApplicationCrumbs() {
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
$user = $this->getUser();
|
|
if ($user) {
|
|
$crumbs->addTextCrumb(
|
|
$user->getUsername(),
|
|
urisprintf('/p/%s/', $user->getUsername()));
|
|
}
|
|
|
|
return $crumbs;
|
|
}
|
|
|
|
}
|