Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php
12242 views
1
<?php
2
3
final class PhabricatorDashboardFavoritesInstallWorkflow
4
extends PhabricatorDashboardApplicationInstallWorkflow {
5
6
const WORKFLOWKEY = 'favorites';
7
8
public function getOrder() {
9
return 4000;
10
}
11
12
protected function newWorkflowMenuItem() {
13
return $this->newMenuItem()
14
->setHeader(pht('Add to Favorites Menu'))
15
->setImageIcon('fa-bookmark')
16
->addAttribute(
17
pht(
18
'Add this dashboard to the favorites menu in the main '.
19
'menu bar.'));
20
}
21
22
protected function newProfileEngine() {
23
return new PhabricatorFavoritesProfileMenuEngine();
24
}
25
26
protected function newApplication() {
27
return new PhabricatorFavoritesApplication();
28
}
29
30
protected function newApplicationModeDialog() {
31
return $this->newDialog()
32
->setTitle(pht('Add Dashboard to Favorites Menu'));
33
}
34
35
protected function newPersonalMenuItem() {
36
return $this->newMenuItem()
37
->setHeader(pht('Add to Personal Favorites'))
38
->setImageIcon('fa-user')
39
->addAttribute(
40
pht(
41
'Add this dashboard to your list of personal favorite menu items, '.
42
'visible to only you.'));
43
}
44
45
protected function newGlobalMenuItem() {
46
return $this->newMenuItem()
47
->setHeader(pht('Add to Global Favorites'))
48
->setImageIcon('fa-globe')
49
->addAttribute(
50
pht(
51
'Add this dashboard to the global favorites menu, visible to all '.
52
'users.'));
53
}
54
55
protected function newGlobalPermissionDialog() {
56
return $this->newDialog()
57
->setTitle(pht('No Permission'))
58
->appendParagraph(
59
pht(
60
'You do not have permission to install items on the global '.
61
'favorites menu.'));
62
}
63
64
protected function newGlobalConfirmDialog() {
65
return $this->newDialog()
66
->setTitle(pht('Add Dashboard to Global Favorites'))
67
->appendParagraph(
68
pht(
69
'Add dashboard %s as a global menu item in the favorites menu?',
70
$this->getDashboardDisplayName()))
71
->addSubmitButton(pht('Add to Favorites'));
72
}
73
74
protected function newPersonalConfirmDialog() {
75
return $this->newDialog()
76
->setTitle(pht('Add Dashboard to Personal Favorites'))
77
->appendParagraph(
78
pht(
79
'Add dashboard %s as a personal menu item in the favorites menu?',
80
$this->getDashboardDisplayName()))
81
->addSubmitButton(pht('Add to Favorites'));
82
}
83
84
85
}
86
87