Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/home/controller/PhabricatorHomeMenuItemController.php
12256 views
1
<?php
2
3
final class PhabricatorHomeMenuItemController
4
extends PhabricatorHomeController {
5
6
public function shouldAllowPublic() {
7
return true;
8
}
9
10
public function isGlobalDragAndDropUploadEnabled() {
11
return true;
12
}
13
14
public function handleRequest(AphrontRequest $request) {
15
$viewer = $this->getViewer();
16
17
// Test if we should show mobile users the menu or the page content:
18
// if you visit "/", you just get the menu. If you visit "/home/", you
19
// get the content.
20
$is_content = $request->getURIData('content');
21
22
$application = 'PhabricatorHomeApplication';
23
$home_app = id(new PhabricatorApplicationQuery())
24
->setViewer($viewer)
25
->withClasses(array($application))
26
->withInstalled(true)
27
->executeOne();
28
29
$engine = id(new PhabricatorHomeProfileMenuEngine())
30
->setProfileObject($home_app)
31
->setCustomPHID($viewer->getPHID())
32
->setController($this)
33
->setShowContentCrumbs(false);
34
35
if (!$is_content) {
36
$engine->addContentPageClass('phabricator-home');
37
}
38
39
return $engine->buildResponse();
40
}
41
42
}
43
44