mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 11:12:42 +01:00
dfee1352e9
Summary: Ref T11957, builds out `/home/menu/` as a basic structure for adding/editing the homepage menu. Test Plan: visit `/home/menu/` and add items to global and personal. Not wired to anything. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T11957 Differential Revision: https://secure.phabricator.com/D17180
57 lines
1.5 KiB
PHP
57 lines
1.5 KiB
PHP
<?php
|
|
|
|
final class PhabricatorHomeMenuController extends PhabricatorHomeController {
|
|
|
|
public function shouldAllowPublic() {
|
|
return false;
|
|
}
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$viewer = $request->getViewer();
|
|
|
|
$menu = id(new PHUIObjectItemListView())
|
|
->setUser($viewer);
|
|
|
|
$menu->addItem(
|
|
id(new PHUIObjectItemView())
|
|
->setHeader(pht('Personal Menu Items'))
|
|
->setHref($this->getApplicationURI('menu/personal/item/configure/'))
|
|
->setImageURI($viewer->getProfileImageURI())
|
|
->addAttribute(pht('Edit the menu for your personal account.')));
|
|
|
|
$icon = id(new PHUIIconView())
|
|
->setIcon('fa-globe')
|
|
->setBackground('bg-blue');
|
|
|
|
$menu->addItem(
|
|
id(new PHUIObjectItemView())
|
|
->setHeader(pht('Global Menu Items'))
|
|
->setHref($this->getApplicationURI('menu/global/item/configure/'))
|
|
->setImageIcon($icon)
|
|
->addAttribute(pht('Edit the global default menu for all users.')));
|
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
|
$crumbs->addTextCrumb(pht('Manage'));
|
|
$crumbs->setBorder(true);
|
|
|
|
$box = id(new PHUIObjectBoxView())
|
|
->setObjectList($menu);
|
|
|
|
$header = id(new PHUIHeaderView())
|
|
->setHeader(pht('Manage Home Menu'))
|
|
->setHeaderIcon('fa-home');
|
|
|
|
$view = id(new PHUITwoColumnView())
|
|
->setHeader($header)
|
|
->setFooter(array(
|
|
$box,
|
|
));
|
|
|
|
return $this->newPage()
|
|
->setTitle(pht('Manage Home Menu'))
|
|
->setCrumbs($crumbs)
|
|
->appendChild($view);
|
|
|
|
}
|
|
|
|
}
|