Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php
12242 views
1
<?php
2
3
final class PhabricatorChatLogChannelListController
4
extends PhabricatorChatLogController {
5
6
public function shouldAllowPublic() {
7
return true;
8
}
9
10
public function handleRequest(AphrontRequest $request) {
11
$viewer = $request->getViewer();
12
13
$channels = id(new PhabricatorChatLogChannelQuery())
14
->setViewer($viewer)
15
->execute();
16
17
$list = new PHUIObjectItemListView();
18
foreach ($channels as $channel) {
19
$item = id(new PHUIObjectItemView())
20
->setHeader($channel->getChannelName())
21
->setHref('/chatlog/channel/'.$channel->getID().'/')
22
->addAttribute($channel->getServiceName())
23
->addAttribute($channel->getServiceType());
24
$list->addItem($item);
25
}
26
27
$crumbs = $this
28
->buildApplicationCrumbs()
29
->addTextCrumb(pht('Channel List'), $this->getApplicationURI());
30
31
$box = id(new PHUIObjectBoxView())
32
->setHeaderText('Channel List')
33
->setObjectList($list);
34
35
return $this->newPage()
36
->setTitle(pht('Channel List'))
37
->setCrumbs($crumbs)
38
->appendChild($box);
39
40
}
41
}
42
43