From bf753c8b5a0859ce0d89d1ec5d71b60a017a3862 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 16 May 2017 08:50:55 -0700 Subject: [PATCH] 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 --- .../base/controller/PhabricatorController.php | 10 ++++++---- .../PhabricatorProjectMembersViewController.php | 2 +- .../PhabricatorProjectSubprojectsController.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php index 58d8f6cf6f..c4d1b47c40 100644 --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -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; diff --git a/src/applications/project/controller/PhabricatorProjectMembersViewController.php b/src/applications/project/controller/PhabricatorProjectMembersViewController.php index 30ff425a51..ad553eb664 100644 --- a/src/applications/project/controller/PhabricatorProjectMembersViewController.php +++ b/src/applications/project/controller/PhabricatorProjectMembersViewController.php @@ -70,7 +70,7 @@ final class PhabricatorProjectMembersViewController $viewer = $this->getViewer(); $id = $project->getID(); - $curtain = $this->newCurtainView($project); + $curtain = $this->newCurtainView(); $is_locked = $project->getIsMembershipLocked(); diff --git a/src/applications/project/controller/PhabricatorProjectSubprojectsController.php b/src/applications/project/controller/PhabricatorProjectSubprojectsController.php index 4a89bb4cde..1aa0c0baac 100644 --- a/src/applications/project/controller/PhabricatorProjectSubprojectsController.php +++ b/src/applications/project/controller/PhabricatorProjectSubprojectsController.php @@ -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');