1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

Make passing an object to newCurtain optional

Summary: We seem to already support this, just takes it fully there. We don't need to see things like "Flag", etc, on certain subpages of projects/people/etc.

Test Plan: Review Members, Subproject pages, no longer see "Flag for Later" which only is for the Project itself. Check manage, still there.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17897
This commit is contained in:
Chad Little 2017-05-16 08:50:55 -07:00
parent 1b5a276a02
commit bf753c8b5a
3 changed files with 8 additions and 6 deletions

View file

@ -471,7 +471,7 @@ abstract class PhabricatorController extends AphrontController {
->setViewer($this->getViewer());
}
public function newCurtainView($object) {
public function newCurtainView($object = null) {
$viewer = $this->getViewer();
$action_id = celerity_generate_unique_node_id();
@ -491,9 +491,11 @@ abstract class PhabricatorController extends AphrontController {
->setViewer($viewer)
->setActionList($action_list);
$panels = PHUICurtainExtension::buildExtensionPanels($viewer, $object);
foreach ($panels as $panel) {
$curtain->addPanel($panel);
if ($object) {
$panels = PHUICurtainExtension::buildExtensionPanels($viewer, $object);
foreach ($panels as $panel) {
$curtain->addPanel($panel);
}
}
return $curtain;

View file

@ -70,7 +70,7 @@ final class PhabricatorProjectMembersViewController
$viewer = $this->getViewer();
$id = $project->getID();
$curtain = $this->newCurtainView($project);
$curtain = $this->newCurtainView();
$is_locked = $project->getIsMembershipLocked();

View file

@ -203,7 +203,7 @@ final class PhabricatorProjectSubprojectsController
$allows_milestones = $project->supportsMilestones();
$allows_subprojects = $project->supportsSubprojects();
$curtain = $this->newCurtainView($project);
$curtain = $this->newCurtainView();
if ($allows_milestones && $milestones) {
$milestone_text = pht('Create Next Milestone');