Differential D17694 Diff 42554 src/applications/phortune/controller/account/PhortuneAccountProfileController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phortune/controller/account/PhortuneAccountProfileController.php
| <?php | <?php | ||||
| abstract class PhortuneAccountProfileController | abstract class PhortuneAccountProfileController | ||||
| extends PhortuneController { | extends PhortuneAccountController { | ||||
| private $account; | |||||
| public function setAccount(PhortuneAccount $account) { | |||||
| $this->account = $account; | |||||
| return $this; | |||||
| } | |||||
| public function getAccount() { | |||||
| return $this->account; | |||||
| } | |||||
| public function buildApplicationMenu() { | public function buildApplicationMenu() { | ||||
| return $this->buildSideNavView()->getMenu(); | return $this->buildSideNavView()->getMenu(); | ||||
| } | } | ||||
| protected function buildHeaderView() { | protected function buildHeaderView() { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $account = $this->getAccount(); | $account = $this->getAccount(); | ||||
| $title = $account->getName(); | $title = $account->getName(); | ||||
| $header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->setHeader($title) | ->setHeader($title) | ||||
| ->setHeaderIcon('fa-user-circle'); | ->setHeaderIcon('fa-user-circle'); | ||||
| return $header; | return $header; | ||||
| } | } | ||||
| protected function buildApplicationCrumbs() { | protected function buildApplicationCrumbs() { | ||||
| $crumbs = parent::buildApplicationCrumbs(); | $crumbs = parent::buildApplicationCrumbs(); | ||||
| $crumbs->setBorder(true); | $crumbs->setBorder(true); | ||||
| $account = $this->getAccount(); | |||||
| if ($account) { | |||||
| $crumbs->addTextCrumb($account->getName(), $account->getURI()); | |||||
| } | |||||
| return $crumbs; | return $crumbs; | ||||
| } | } | ||||
| protected function buildSideNavView($filter = null) { | protected function buildSideNavView($filter = null) { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $account = $this->getAccount(); | $account = $this->getAccount(); | ||||
| $id = $account->getID(); | $id = $account->getID(); | ||||
| Show All 35 Lines | |||||