3 abstract class ConpherenceController
extends PhabricatorController
{
7 public function setConpherence(ConpherenceThread
$conpherence) {
8 $this->conpherence
= $conpherence;
11 public function getConpherence() {
12 return $this->conpherence
;
15 public function buildApplicationMenu() {
16 $nav = new PHUIListView();
17 $conpherence = $this->conpherence
;
22 id(new PHUIListItemView())
23 ->setName(pht('Joined Rooms'))
24 ->setType(PHUIListItemView
::TYPE_LINK
)
25 ->setHref($this->getApplicationURI()));
28 id(new PHUIListItemView())
29 ->setName(pht('Edit Room'))
30 ->setType(PHUIListItemView
::TYPE_LINK
)
32 $this->getApplicationURI('update/'.$conpherence->getID()).'/')
36 id(new PHUIListItemView())
37 ->setName(pht('Add Participants'))
38 ->setType(PHUIListItemView
::TYPE_LINK
)
40 ->addSigil('conpherence-widget-adder')
41 ->setMetadata(array('widget' => 'widgets-people')));
45 $nav->newLabel(pht('Conpherence'));
48 $this->getApplicationURI('new/'));
51 $this->getApplicationURI('search/'));
56 protected function buildHeaderPaneContent(
57 ConpherenceThread
$conpherence) {
58 $viewer = $this->getViewer();
60 $id = $conpherence->getID();
63 $data = $conpherence->getDisplayData($this->getViewer());
65 $header = id(new PHUIHeaderView())
67 ->setHeader($data['title'])
68 ->setPolicyObject($conpherence)
69 ->setImage($data['image']);
71 if (strlen($data['topic'])) {
72 $topic = id(new PHUITagView())
73 ->setName($data['topic'])
74 ->setColor(PHUITagView
::COLOR_VIOLET
)
75 ->setType(PHUITagView
::TYPE_SHADE
)
76 ->addClass('conpherence-header-topic');
77 $header->addTag($topic);
80 $can_edit = PhabricatorPolicyFilter
::hasCapability(
83 PhabricatorPolicyCapability
::CAN_EDIT
);
87 $this->getApplicationURI("picture/{$id}/"));
90 $participating = $conpherence->getParticipantIfExists($viewer->getPHID());
92 $header->addActionItem(
93 id(new PHUIIconCircleView())
95 $this->getApplicationURI('edit/'.$conpherence->getID()).'/')
96 ->setIcon('fa-pencil')
97 ->addClass('hide-on-device')
101 $header->addActionItem(
102 id(new PHUIIconCircleView())
103 ->setHref($this->getApplicationURI("preferences/{$id}/"))
105 ->addClass('hide-on-device')
107 ->setWorkflow(true));
109 $widget_key = PhabricatorConpherenceWidgetVisibleSetting
::SETTINGKEY
;
110 $widget_view = (bool)$viewer->getUserSetting($widget_key, false);
112 Javelin
::initBehavior(
115 'show' => (int)$widget_view,
116 'settingsURI' => '/settings/adjust/?key='.$widget_key,
119 $header->addActionItem(
120 id(new PHUIIconCircleView())
121 ->addSigil('conpherence-widget-toggle')
122 ->setIcon('fa-group')
124 ->addClass('conpherence-participant-toggle'));
126 Javelin
::initBehavior('conpherence-search');
128 $header->addActionItem(
129 id(new PHUIIconCircleView())
130 ->addSigil('conpherence-search-toggle')
131 ->setIcon('fa-search')
134 ->addClass('conpherence-search-toggle'));
136 if (!$participating) {
137 $action = ConpherenceUpdateActions
::JOIN_ROOM
;
138 $uri = $this->getApplicationURI("update/{$id}/");
139 $button = phutil_tag(
143 'class' => 'button button-green mlr',
147 $hidden = phutil_tag(
152 'value' => ConpherenceUpdateActions
::JOIN_ROOM
,
155 $form = phabricator_form(
159 'action' => (string)$uri,
165 $header->addActionItem($form);
172 public function buildSearchForm() {
173 $viewer = $this->getViewer();
174 $conpherence = $this->conpherence
;
175 $name = $conpherence->getTitle();
181 'id' => 'conpherence-search-input',
182 'name' => 'fulltext',
183 'class' => 'conpherence-search-input',
184 'sigil' => 'conpherence-search-input',
185 'placeholder' => pht('Search %s...', $name),
188 $id = $conpherence->getID();
189 $form = phabricator_form(
193 'action' => '/conpherence/threadsearch/'.$id.'/',
194 'sigil' => 'conpherence-search-form',
195 'class' => 'conpherence-search-form',
196 'id' => 'conpherence-search-form',
202 $form_view = phutil_tag(
205 'class' => 'conpherence-search-form-view',
209 $results = phutil_tag(
212 'id' => 'conpherence-search-results',
213 'class' => 'conpherence-search-results',
219 'class' => 'conpherence-search-window',