forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConpherenceController.php
93 lines (79 loc) · 2.37 KB
/
ConpherenceController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
abstract class ConpherenceController extends PhabricatorController {
private $conpherence;
public function setConpherence(ConpherenceThread $conpherence) {
$this->conpherence = $conpherence;
return $this;
}
public function getConpherence() {
return $this->conpherence;
}
public function buildApplicationMenu() {
$nav = new PHUIListView();
$nav->newLink(
pht('New Room'),
$this->getApplicationURI('new/'));
$nav->addMenuItem(
id(new PHUIListItemView())
->setName(pht('Add Participants'))
->setType(PHUIListItemView::TYPE_LINK)
->setHref('#')
->addSigil('conpherence-widget-adder')
->setMetadata(array('widget' => 'widgets-people')));
return $nav;
}
protected function buildApplicationCrumbs() {
return $this->buildConpherenceApplicationCrumbs();
}
protected function buildConpherenceApplicationCrumbs($is_rooms = false) {
$crumbs = parent::buildApplicationCrumbs();
if ($is_rooms) {
$crumbs
->addAction(
id(new PHUIListItemView())
->setName(pht('New Room'))
->setHref($this->getApplicationURI('new/'))
->setIcon('fa-plus-square')
->setWorkflow(true));
} else {
$crumbs
->addAction(
id(new PHUIListItemView())
->setName(pht('New Room'))
->setHref($this->getApplicationURI('new/'))
->setIcon('fa-plus-square')
->setWorkflow(true))
->addAction(
id(new PHUIListItemView())
->setName(pht('Room'))
->setHref('#')
->setIcon('fa-bars')
->setStyle('display: none;')
->addClass('device-widgets-selector')
->addSigil('device-widgets-selector'));
}
return $crumbs;
}
protected function buildHeaderPaneContent(
ConpherenceThread $conpherence,
array $policy_objects) {
assert_instances_of($policy_objects, 'PhabricatorPolicy');
$crumbs = $this->buildApplicationCrumbs();
$data = $conpherence->getDisplayData($this->getViewer());
$crumbs->addCrumb(
id(new PHUICrumbView())
->setName($data['title'])
->setHref('/'.$conpherence->getMonogram()));
return hsprintf(
'%s',
array(
phutil_tag(
'div',
array(
'class' => 'header-loading-mask',
),
''),
$crumbs,
));
}
}