Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUITwoColumnView.php
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | final class PHUITwoColumnView extends AphrontTagView { | ||||
} | } | ||||
public function setFooter($footer) { | public function setFooter($footer) { | ||||
$this->footer = $footer; | $this->footer = $footer; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function addPropertySection($title, $section) { | public function addPropertySection($title, $section) { | ||||
$this->propertySection[] = array($title, $section); | $this->propertySection[] = array( | ||||
'header' => $title, | |||||
'content' => $section, | |||||
); | |||||
return $this; | return $this; | ||||
} | } | ||||
public function setCurtain(PHUICurtainView $curtain) { | public function setCurtain(PHUICurtainView $curtain) { | ||||
$this->curtain = $curtain; | $this->curtain = $curtain; | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | final class PHUITwoColumnView extends AphrontTagView { | ||||
} | } | ||||
private function buildMainColumn() { | private function buildMainColumn() { | ||||
$view = array(); | $view = array(); | ||||
$sections = $this->propertySection; | $sections = $this->propertySection; | ||||
if ($sections) { | if ($sections) { | ||||
foreach ($sections as $content) { | foreach ($sections as $section) { | ||||
if ($content[1]) { | $section_header = $section['header']; | ||||
$section_content = $section['content']; | |||||
if ($section_content === null) { | |||||
continue; | |||||
} | |||||
if ($section_header instanceof PHUIHeaderView) { | |||||
$header = $section_header; | |||||
} else { | |||||
$header = id(new PHUIHeaderView()) | |||||
->setHeader($section_header); | |||||
} | |||||
$view[] = id(new PHUIObjectBoxView()) | $view[] = id(new PHUIObjectBoxView()) | ||||
->setHeaderText($content[0]) | ->setHeader($header) | ||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
->appendChild($content[1]); | ->appendChild($section_content); | ||||
} | |||||
} | } | ||||
} | } | ||||
return phutil_tag( | return phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'phui-main-column', | 'class' => 'phui-main-column', | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |