2011-01-24 03:09:16 +01:00
|
|
|
<?php
|
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
abstract class PhabricatorPeopleProfileController
|
2012-03-10 00:46:25 +01:00
|
|
|
extends PhabricatorPeopleController {
|
2011-01-24 03:09:16 +01:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
private $user;
|
|
|
|
private $profileMenu;
|
2015-07-22 18:32:54 +02:00
|
|
|
|
2013-03-19 21:48:50 +01:00
|
|
|
public function shouldRequireAdmin() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
public function setUser(PhabricatorUser $user) {
|
|
|
|
$this->user = $user;
|
|
|
|
return $this;
|
2013-02-05 22:46:02 +01:00
|
|
|
}
|
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
public function getUser() {
|
|
|
|
return $this->user;
|
2011-06-18 10:13:56 +02:00
|
|
|
}
|
2011-02-20 02:33:53 +01:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
public function buildApplicationMenu() {
|
|
|
|
$menu = $this->newApplicationMenu();
|
2011-02-20 03:28:41 +01:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
$profile_menu = $this->getProfileMenu();
|
|
|
|
if ($profile_menu) {
|
|
|
|
$menu->setProfileMenu($profile_menu);
|
|
|
|
}
|
2013-07-10 14:09:59 +02:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
return $menu;
|
2011-12-24 03:17:40 +01:00
|
|
|
}
|
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
protected function getProfileMenu() {
|
|
|
|
if (!$this->profileMenu) {
|
|
|
|
$user = $this->getUser();
|
|
|
|
if ($user) {
|
|
|
|
$viewer = $this->getViewer();
|
2015-07-23 20:46:34 +02:00
|
|
|
|
2016-12-11 18:00:44 +01:00
|
|
|
$engine = id(new PhabricatorPeopleProfileMenuEngine())
|
2015-07-23 20:46:34 +02:00
|
|
|
->setViewer($viewer)
|
2016-01-14 15:47:06 +01:00
|
|
|
->setProfileObject($user);
|
2015-07-23 20:46:34 +02:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
$this->profileMenu = $engine->buildNavigation();
|
2015-07-23 20:46:34 +02:00
|
|
|
}
|
2016-01-14 15:47:06 +01:00
|
|
|
}
|
[Redesign] People, Profile, Feed UI
Summary: Ref T8099, Mostly a Feed cleanup, removing old CSS, relying on modern display objects, adds back the feed to profile (I miss it, but maybe you don't).
Test Plan: Visit Feed on Profiles, Projects, Feed, and Dashboards. Same UI Everywhere. TODO, "Public Feed".
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T8099
Differential Revision: https://secure.phabricator.com/D13101
2015-06-01 20:28:01 +02:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
return $this->profileMenu;
|
|
|
|
}
|
[Redesign] People, Profile, Feed UI
Summary: Ref T8099, Mostly a Feed cleanup, removing old CSS, relying on modern display objects, adds back the feed to profile (I miss it, but maybe you don't).
Test Plan: Visit Feed on Profiles, Projects, Feed, and Dashboards. Same UI Everywhere. TODO, "Public Feed".
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T8099
Differential Revision: https://secure.phabricator.com/D13101
2015-06-01 20:28:01 +02:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
protected function buildApplicationCrumbs() {
|
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
[Redesign] People, Profile, Feed UI
Summary: Ref T8099, Mostly a Feed cleanup, removing old CSS, relying on modern display objects, adds back the feed to profile (I miss it, but maybe you don't).
Test Plan: Visit Feed on Profiles, Projects, Feed, and Dashboards. Same UI Everywhere. TODO, "Public Feed".
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T8099
Differential Revision: https://secure.phabricator.com/D13101
2015-06-01 20:28:01 +02:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
$user = $this->getUser();
|
|
|
|
if ($user) {
|
|
|
|
$crumbs->addTextCrumb(
|
|
|
|
$user->getUsername(),
|
|
|
|
urisprintf('/p/%s/', $user->getUsername()));
|
|
|
|
}
|
[Redesign] People, Profile, Feed UI
Summary: Ref T8099, Mostly a Feed cleanup, removing old CSS, relying on modern display objects, adds back the feed to profile (I miss it, but maybe you don't).
Test Plan: Visit Feed on Profiles, Projects, Feed, and Dashboards. Same UI Everywhere. TODO, "Public Feed".
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T8099
Differential Revision: https://secure.phabricator.com/D13101
2015-06-01 20:28:01 +02:00
|
|
|
|
2016-01-14 15:47:06 +01:00
|
|
|
return $crumbs;
|
[Redesign] People, Profile, Feed UI
Summary: Ref T8099, Mostly a Feed cleanup, removing old CSS, relying on modern display objects, adds back the feed to profile (I miss it, but maybe you don't).
Test Plan: Visit Feed on Profiles, Projects, Feed, and Dashboards. Same UI Everywhere. TODO, "Public Feed".
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T8099
Differential Revision: https://secure.phabricator.com/D13101
2015-06-01 20:28:01 +02:00
|
|
|
}
|
|
|
|
|
2011-01-24 03:09:16 +01:00
|
|
|
}
|