Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/dashboard/controller/PhabricatorDashboardProfileController.php
12242 views
1
<?php
2
3
abstract class PhabricatorDashboardProfileController
4
extends PhabricatorController {
5
6
private $dashboard;
7
8
public function setDashboard(PhabricatorDashboard $dashboard) {
9
$this->dashboard = $dashboard;
10
return $this;
11
}
12
13
public function getDashboard() {
14
return $this->dashboard;
15
}
16
17
protected function buildHeaderView() {
18
$viewer = $this->getViewer();
19
$dashboard = $this->getDashboard();
20
$id = $dashboard->getID();
21
22
if ($dashboard->isArchived()) {
23
$status_icon = 'fa-ban';
24
$status_color = 'dark';
25
} else {
26
$status_icon = 'fa-check';
27
$status_color = 'bluegrey';
28
}
29
30
$status_name = idx(
31
PhabricatorDashboard::getStatusNameMap(),
32
$dashboard->getStatus());
33
34
return id(new PHUIHeaderView())
35
->setUser($viewer)
36
->setHeader($dashboard->getName())
37
->setPolicyObject($dashboard)
38
->setStatus($status_icon, $status_color, $status_name)
39
->setHeaderIcon($dashboard->getIcon());
40
}
41
42
protected function buildApplicationCrumbs() {
43
$crumbs = parent::buildApplicationCrumbs();
44
$crumbs->setBorder(true);
45
46
$dashboard = $this->getDashboard();
47
if ($dashboard) {
48
$crumbs->addTextCrumb($dashboard->getName(), $dashboard->getURI());
49
}
50
51
return $crumbs;
52
}
53
54
}
55
56