Allow profile menus to be collapsed and expanded
Summary: Ref T10054. I think this gets everything except: - circles on icons; - I spent ~15 minutes poking at animations but wasn't able to get anything that looked reasonable whatsoever. Test Plan: - Collapsed menus. - Expanded menus. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10054 Differential Revision: https://secure.phabricator.com/D15056
This commit is contained in:
@@ -4,6 +4,7 @@ abstract class PhabricatorProjectController extends PhabricatorController {
|
||||
|
||||
private $project;
|
||||
private $profileMenu;
|
||||
private $profilePanelEngine;
|
||||
|
||||
protected function setProject(PhabricatorProject $project) {
|
||||
$this->project = $project;
|
||||
@@ -98,14 +99,8 @@ abstract class PhabricatorProjectController extends PhabricatorController {
|
||||
|
||||
protected function getProfileMenu() {
|
||||
if (!$this->profileMenu) {
|
||||
$project = $this->getProject();
|
||||
if ($project) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$engine = id(new PhabricatorProjectProfilePanelEngine())
|
||||
->setViewer($viewer)
|
||||
->setProfileObject($project);
|
||||
|
||||
$engine = $this->getProfilePanelEngine();
|
||||
if ($engine) {
|
||||
$this->profileMenu = $engine->buildNavigation();
|
||||
}
|
||||
}
|
||||
@@ -131,4 +126,24 @@ abstract class PhabricatorProjectController extends PhabricatorController {
|
||||
return $crumbs;
|
||||
}
|
||||
|
||||
protected function getProfilePanelEngine() {
|
||||
if (!$this->profilePanelEngine) {
|
||||
$viewer = $this->getViewer();
|
||||
$project = $this->getProject();
|
||||
if ($project) {
|
||||
$engine = id(new PhabricatorProjectProfilePanelEngine())
|
||||
->setViewer($viewer)
|
||||
->setProfileObject($project);
|
||||
$this->profilePanelEngine = $engine;
|
||||
}
|
||||
}
|
||||
return $this->profilePanelEngine;
|
||||
}
|
||||
|
||||
protected function setProfilePanelEngine(
|
||||
PhabricatorProjectProfilePanelEngine $engine) {
|
||||
$this->profilePanelEngine = $engine;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user