Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/dashboard/engine/PhabricatorDashboardPortalProfileMenuEngine.php
12242 views
1
<?php
2
3
final class PhabricatorDashboardPortalProfileMenuEngine
4
extends PhabricatorProfileMenuEngine {
5
6
protected function isMenuEngineConfigurable() {
7
return true;
8
}
9
10
protected function isMenuEnginePersonalizable() {
11
return false;
12
}
13
14
public function getItemURI($path) {
15
$portal = $this->getProfileObject();
16
17
return $portal->getURI().$path;
18
}
19
20
protected function getBuiltinProfileItems($object) {
21
$items = array();
22
23
$items[] = $this->newDividerItem('tail');
24
25
$items[] = $this->newManageItem();
26
27
$items[] = $this->newItem()
28
->setMenuItemKey(PhabricatorDashboardPortalMenuItem::MENUITEMKEY)
29
->setBuiltinKey('manage')
30
->setIsTailItem(true);
31
32
return $items;
33
}
34
35
protected function newNoMenuItemsView(array $items) {
36
$object = $this->getProfileObject();
37
$builtins = $this->getBuiltinProfileItems($object);
38
39
if (count($items) <= count($builtins)) {
40
return $this->newEmptyView(
41
pht('New Portal'),
42
pht('Use "Edit Menu" to add menu items to this portal.'));
43
} else {
44
return $this->newEmptyValue(
45
pht('No Portal Content'),
46
pht(
47
'None of the visible menu items in this portal can render any '.
48
'content.'));
49
}
50
}
51
52
}
53
54