Changeset View
Changeset View
Standalone View
Standalone View
src/applications/home/controller/PhabricatorHomeMainController.php
<?php | <?php | ||||
final class PhabricatorHomeMainController extends PhabricatorHomeController { | final class PhabricatorHomeMainController extends PhabricatorHomeController { | ||||
private $only; | |||||
private $minipanels = array(); | private $minipanels = array(); | ||||
public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
return true; | return true; | ||||
} | } | ||||
public function willProcessRequest(array $data) { | public function isGlobalDragAndDropUploadEnabled() { | ||||
$this->only = idx($data, 'only'); | return true; | ||||
} | } | ||||
public function processRequest() { | public function handleRequest(AphrontRequest $request) { | ||||
$user = $this->getRequest()->getUser(); | $user = $request->getUser(); | ||||
$dashboard = PhabricatorDashboardInstall::getDashboard( | $dashboard = PhabricatorDashboardInstall::getDashboard( | ||||
$user, | $user, | ||||
$user->getPHID(), | $user->getPHID(), | ||||
get_class($this->getCurrentApplication())); | get_class($this->getCurrentApplication())); | ||||
if (!$dashboard) { | if (!$dashboard) { | ||||
$dashboard = PhabricatorDashboardInstall::getDashboard( | $dashboard = PhabricatorDashboardInstall::getDashboard( | ||||
Show All 11 Lines | if ($dashboard) { | ||||
$project_query = new PhabricatorProjectQuery(); | $project_query = new PhabricatorProjectQuery(); | ||||
$project_query->setViewer($user); | $project_query->setViewer($user); | ||||
$project_query->withMemberPHIDs(array($user->getPHID())); | $project_query->withMemberPHIDs(array($user->getPHID())); | ||||
$projects = $project_query->execute(); | $projects = $project_query->execute(); | ||||
$content = $this->buildMainResponse($projects); | $content = $this->buildMainResponse($projects); | ||||
} | } | ||||
if (!$this->only) { | if (!$request->getURIData('only')) { | ||||
$nav = $this->buildNav(); | $nav = $this->buildNav(); | ||||
$nav->appendChild( | $nav->appendChild( | ||||
array( | array( | ||||
$content, | $content, | ||||
id(new PhabricatorGlobalUploadTargetView())->setUser($user), | id(new PhabricatorGlobalUploadTargetView())->setUser($user), | ||||
)); | )); | ||||
$content = $nav; | $content = $nav; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 373 Lines • Show Last 20 Lines |