2013-09-05 21:29:07 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DivinerSectionView extends AphrontTagView {
|
|
|
|
|
|
|
|
private $header;
|
|
|
|
private $content;
|
|
|
|
|
|
|
|
public function addContent($content) {
|
|
|
|
$this->content[] = $content;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setHeader($text) {
|
|
|
|
$this->header = $text;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-01-13 20:54:39 +01:00
|
|
|
protected function getTagName() {
|
2013-09-05 21:29:07 +02:00
|
|
|
return 'div';
|
|
|
|
}
|
|
|
|
|
2015-01-13 20:54:39 +01:00
|
|
|
protected function getTagAttributes() {
|
2013-09-05 21:29:07 +02:00
|
|
|
return array(
|
|
|
|
'class' => 'diviner-document-section',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-01-13 20:54:39 +01:00
|
|
|
protected function getTagContent() {
|
2013-09-05 21:29:07 +02:00
|
|
|
require_celerity_resource('diviner-shared-css');
|
|
|
|
|
2013-09-17 18:12:37 +02:00
|
|
|
$header = id(new PHUIHeaderView())
|
2013-09-05 21:29:07 +02:00
|
|
|
->setBleedHeader(true)
|
|
|
|
->setHeader($this->header);
|
|
|
|
|
|
|
|
$content = id(new PHUIBoxView())
|
|
|
|
->addPadding(PHUI::PADDING_LARGE_LEFT)
|
|
|
|
->addPadding(PHUI::PADDING_LARGE_RIGHT)
|
|
|
|
->appendChild($this->content);
|
|
|
|
|
|
|
|
return array($header, $content);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|