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:
@@ -471,7 +471,7 @@ abstract class PhabricatorController extends AphrontController {
|
|||||||
->setViewer($this->getViewer());
|
->setViewer($this->getViewer());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newCurtainView($object) {
|
public function newCurtainView($object = null) {
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
$action_id = celerity_generate_unique_node_id();
|
$action_id = celerity_generate_unique_node_id();
|
||||||
@@ -491,9 +491,11 @@ abstract class PhabricatorController extends AphrontController {
|
|||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->setActionList($action_list);
|
->setActionList($action_list);
|
||||||
|
|
||||||
$panels = PHUICurtainExtension::buildExtensionPanels($viewer, $object);
|
if ($object) {
|
||||||
foreach ($panels as $panel) {
|
$panels = PHUICurtainExtension::buildExtensionPanels($viewer, $object);
|
||||||
$curtain->addPanel($panel);
|
foreach ($panels as $panel) {
|
||||||
|
$curtain->addPanel($panel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $curtain;
|
return $curtain;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ final class PhabricatorProjectMembersViewController
|
|||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
$id = $project->getID();
|
$id = $project->getID();
|
||||||
|
|
||||||
$curtain = $this->newCurtainView($project);
|
$curtain = $this->newCurtainView();
|
||||||
|
|
||||||
$is_locked = $project->getIsMembershipLocked();
|
$is_locked = $project->getIsMembershipLocked();
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ final class PhabricatorProjectSubprojectsController
|
|||||||
$allows_milestones = $project->supportsMilestones();
|
$allows_milestones = $project->supportsMilestones();
|
||||||
$allows_subprojects = $project->supportsSubprojects();
|
$allows_subprojects = $project->supportsSubprojects();
|
||||||
|
|
||||||
$curtain = $this->newCurtainView($project);
|
$curtain = $this->newCurtainView();
|
||||||
|
|
||||||
if ($allows_milestones && $milestones) {
|
if ($allows_milestones && $milestones) {
|
||||||
$milestone_text = pht('Create Next Milestone');
|
$milestone_text = pht('Create Next Milestone');
|
||||||
|
|||||||
Reference in New Issue
Block a user