From e351eba7446969a6c600f57cd164d4f86596a0f1 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 9 Mar 2016 19:15:02 -0800 Subject: [PATCH] Add a footer to PHUITwoColumnView Summary: This allows setting of full-width content underneath the two column, or full column all by itself. Maybe these names are bad. Test Plan: Using these in Differential / Diffusion conversions. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15455 --- src/view/phui/PHUITwoColumnView.php | 56 +++++++++++++---------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/src/view/phui/PHUITwoColumnView.php b/src/view/phui/PHUITwoColumnView.php index 1977ddce5e..d174547559 100644 --- a/src/view/phui/PHUITwoColumnView.php +++ b/src/view/phui/PHUITwoColumnView.php @@ -8,9 +8,8 @@ final class PHUITwoColumnView extends AphrontTagView { private $fluid; private $header; private $subheader; + private $footer; private $propertySection = array(); - private $actionList; - private $propertyList; private $curtain; const DISPLAY_LEFT = 'phui-side-column-left'; @@ -36,21 +35,16 @@ final class PHUITwoColumnView extends AphrontTagView { return $this; } + public function setFooter($footer) { + $this->footer = $footer; + return $this; + } + public function addPropertySection($title, $section) { $this->propertySection[] = array($title, $section); return $this; } - public function setActionList(PhabricatorActionListView $list) { - $this->actionList = $list; - return $this; - } - - public function setPropertyList(PHUIPropertyListView $list) { - $this->propertyList = $list; - return $this; - } - public function setCurtain(PHUICurtainView $curtain) { $this->curtain = $curtain; return $this; @@ -101,6 +95,8 @@ final class PHUITwoColumnView extends AphrontTagView { $main = $this->buildMainColumn(); $side = $this->buildSideColumn(); + $footer = $this->buildFooter(); + $order = array($side, $main); $inner = phutil_tag_div('phui-two-column-row grouped', $order); @@ -111,11 +107,6 @@ final class PHUITwoColumnView extends AphrontTagView { $curtain = $this->getCurtain(); if ($curtain) { $action_list = $curtain->getActionList(); - } else { - $action_list = $this->actionList; - } - - if ($action_list) { $this->header->setActionList($action_list); } @@ -138,6 +129,7 @@ final class PHUITwoColumnView extends AphrontTagView { $header, $subheader, $table, + $footer, )); } @@ -169,20 +161,6 @@ final class PHUITwoColumnView extends AphrontTagView { } private function buildSideColumn() { - $property_list = $this->propertyList; - $action_list = $this->actionList; - - $properties = null; - if ($property_list || $action_list) { - if ($property_list) { - $property_list->setStacked(true); - } - - $properties = id(new PHUIObjectBoxView()) - ->appendChild($action_list) - ->appendChild($property_list) - ->addClass('phui-two-column-properties'); - } $curtain = $this->getCurtain(); @@ -192,9 +170,23 @@ final class PHUITwoColumnView extends AphrontTagView { 'class' => 'phui-side-column', ), array( - $properties, $curtain, $this->sideColumn, )); } + + private function buildFooter() { + + $footer = $this->footer; + + return phutil_tag( + 'div', + array( + 'class' => 'phui-two-column-content phui-two-column-footer', + ), + array( + $footer, + )); + + } }