mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 11:12:42 +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
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
abstract class PhabricatorPeopleController extends PhabricatorController {
|
|
|
|
public function shouldRequireAdmin() {
|
|
return true;
|
|
}
|
|
|
|
public function buildSideNavView($for_app = false) {
|
|
$nav = new AphrontSideNavFilterView();
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
$name = null;
|
|
if ($for_app) {
|
|
$name = $this->getRequest()->getURIData('username');
|
|
if ($name) {
|
|
$nav->setBaseURI(new PhutilURI('/p/'));
|
|
$nav->addFilter("{$name}/", $name);
|
|
$nav->addFilter("{$name}/calendar/", pht('Calendar'));
|
|
}
|
|
}
|
|
|
|
if (!$name) {
|
|
$viewer = $this->getRequest()->getUser();
|
|
id(new PhabricatorPeopleSearchEngine())
|
|
->setViewer($viewer)
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
if ($viewer->getIsAdmin()) {
|
|
$nav->addLabel(pht('User Administration'));
|
|
if (PhabricatorLDAPAuthProvider::getLDAPProvider()) {
|
|
$nav->addFilter('ldap', pht('Import from LDAP'));
|
|
}
|
|
|
|
$nav->addFilter('logs', pht('Activity Logs'));
|
|
$nav->addFilter('invite', pht('Email Invitations'));
|
|
}
|
|
}
|
|
|
|
return $nav;
|
|
}
|
|
|
|
public function buildApplicationMenu() {
|
|
return $this->buildSideNavView(true)->getMenu();
|
|
}
|
|
|
|
}
|