2015-01-12 19:04:01 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorProjectViewController
|
|
|
|
extends PhabricatorProjectController {
|
|
|
|
|
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$request = $this->getRequest();
|
2015-08-08 19:34:55 +02:00
|
|
|
$viewer = $request->getViewer();
|
2015-01-12 19:04:01 +01:00
|
|
|
|
2015-12-27 11:04:37 +01:00
|
|
|
$response = $this->loadProject();
|
|
|
|
if ($response) {
|
|
|
|
return $response;
|
2015-01-12 19:04:01 +01:00
|
|
|
}
|
2015-12-27 11:04:37 +01:00
|
|
|
$project = $this->getProject();
|
2015-01-12 19:04:01 +01:00
|
|
|
|
2016-01-22 14:33:21 +01:00
|
|
|
$engine = $this->getProfilePanelEngine();
|
|
|
|
$default = $engine->getDefaultPanel();
|
2015-01-12 19:04:01 +01:00
|
|
|
|
2016-01-22 14:33:21 +01:00
|
|
|
switch ($default->getBuiltinKey()) {
|
|
|
|
case PhabricatorProject::PANEL_WORKBOARD:
|
2015-01-12 19:04:01 +01:00
|
|
|
$controller_object = new PhabricatorProjectBoardViewController();
|
|
|
|
break;
|
2016-01-22 14:33:21 +01:00
|
|
|
case PhabricatorProject::PANEL_PROFILE:
|
2015-01-12 19:04:01 +01:00
|
|
|
default:
|
|
|
|
$controller_object = new PhabricatorProjectProfileController();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->delegateToController($controller_object);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|