Changeset View
Changeset View
Standalone View
Standalone View
src/applications/home/controller/PhabricatorHomeMainController.php
| Show All 27 Lines | public function processRequest() { | ||||
| $project_query->withMemberPHIDs(array($user->getPHID())); | $project_query->withMemberPHIDs(array($user->getPHID())); | ||||
| $projects = $project_query->execute(); | $projects = $project_query->execute(); | ||||
| return $this->buildMainResponse($nav, $projects); | return $this->buildMainResponse($nav, $projects); | ||||
| } | } | ||||
| private function buildMainResponse($nav, array $projects) { | private function buildMainResponse($nav, array $projects) { | ||||
| assert_instances_of($projects, 'PhabricatorProject'); | assert_instances_of($projects, 'PhabricatorProject'); | ||||
| $viewer = $this->getRequest()->getUser(); | |||||
| $maniphest = 'PhabricatorApplicationManiphest'; | $has_maniphest = PhabricatorApplication::isClassInstalledForViewer( | ||||
| if (PhabricatorApplication::isClassInstalled($maniphest)) { | 'PhabricatorApplicationManiphest', | ||||
| $viewer); | |||||
| $has_audit = PhabricatorApplication::isClassInstalledForViewer( | |||||
| 'PhabricatorApplicationAudit', | |||||
| $viewer); | |||||
| $has_differential = PhabricatorApplication::isClassInstalledForViewer( | |||||
| 'PhabricatorApplicationDifferential', | |||||
| $viewer); | |||||
| if ($has_maniphest) { | |||||
| $unbreak_panel = $this->buildUnbreakNowPanel(); | $unbreak_panel = $this->buildUnbreakNowPanel(); | ||||
| $triage_panel = $this->buildNeedsTriagePanel($projects); | $triage_panel = $this->buildNeedsTriagePanel($projects); | ||||
| $tasks_panel = $this->buildTasksPanel(); | $tasks_panel = $this->buildTasksPanel(); | ||||
| } else { | } else { | ||||
| $unbreak_panel = null; | $unbreak_panel = null; | ||||
| $triage_panel = null; | $triage_panel = null; | ||||
| $tasks_panel = null; | $tasks_panel = null; | ||||
| } | } | ||||
| $audit = 'PhabricatorApplicationAudit'; | if ($has_audit) { | ||||
| if (PhabricatorApplication::isClassInstalled($audit)) { | |||||
| $audit_panel = $this->buildAuditPanel(); | $audit_panel = $this->buildAuditPanel(); | ||||
| $commit_panel = $this->buildCommitPanel(); | $commit_panel = $this->buildCommitPanel(); | ||||
| } else { | } else { | ||||
| $audit_panel = null; | $audit_panel = null; | ||||
| $commit_panel = null; | $commit_panel = null; | ||||
| } | } | ||||
| if (PhabricatorEnv::getEnvConfig('welcome.html') !== null) { | if (PhabricatorEnv::getEnvConfig('welcome.html') !== null) { | ||||
| $welcome_panel = $this->buildWelcomePanel(); | $welcome_panel = $this->buildWelcomePanel(); | ||||
| } else { | } else { | ||||
| $welcome_panel = null; | $welcome_panel = null; | ||||
| } | } | ||||
| $jump_panel = $this->buildJumpPanel(); | $jump_panel = $this->buildJumpPanel(); | ||||
| if ($has_differential) { | |||||
| $revision_panel = $this->buildRevisionPanel(); | $revision_panel = $this->buildRevisionPanel(); | ||||
| } else { | |||||
| $revision_panel = null; | |||||
| } | |||||
| $content = array( | $content = array( | ||||
| $jump_panel, | $jump_panel, | ||||
| $welcome_panel, | $welcome_panel, | ||||
| $unbreak_panel, | $unbreak_panel, | ||||
| $triage_panel, | $triage_panel, | ||||
| $revision_panel, | $revision_panel, | ||||
| $tasks_panel, | $tasks_panel, | ||||
| ▲ Show 20 Lines • Show All 395 Lines • Show Last 20 Lines | |||||