3 final class PHUIDocumentView
extends AphrontTagView
{
7 private $bookdescription;
14 public function setHeader(PHUIHeaderView
$header) {
15 $header->setTall(true);
16 $this->header
= $header;
20 public function setBook($name, $description) {
21 $this->bookname
= $name;
22 $this->bookdescription
= $description;
26 public function setFluid($fluid) {
27 $this->fluid
= $fluid;
31 public function setToc($toc) {
36 public function setFoot($foot) {
41 public function setCurtain(PHUICurtainView
$curtain) {
42 $this->curtain
= $curtain;
46 public function getCurtain() {
47 return $this->curtain
;
50 public function setBanner($banner) {
51 $this->banner
= $banner;
55 public function getBanner() {
59 protected function getTagAttributes() {
62 $classes[] = 'phui-document-container';
64 $classes[] = 'phui-document-fluid';
67 $classes[] = 'document-has-foot';
71 'class' => implode(' ', $classes),
75 protected function getTagContent() {
76 require_celerity_resource('phui-document-view-css');
77 require_celerity_resource('phui-document-view-pro-css');
78 Javelin
::initBehavior('phabricator-reveal-content');
81 $classes[] = 'phui-document-view';
82 $classes[] = 'phui-document-view-pro';
85 $classes[] = 'has-curtain';
87 $classes[] = 'has-no-curtain';
91 $action_list = $this->curtain
->getActionList();
92 $this->header
->setActionListID($action_list->getID());
96 if ($this->bookname
) {
97 $book = pht('%s (%s)', $this->bookname
, $this->bookdescription
);
100 $main_content = $this->renderChildren();
103 $this->header
->setSubheader($book);
106 $table_of_contents = null;
109 $toc_id = celerity_generate_unique_node_id();
110 $toc[] = id(new PHUIButtonView())
112 ->setIcon('fa-align-left')
113 ->setButtonType(PHUIButtonView
::BUTTONTYPE_SIMPLE
)
114 ->addClass('phui-document-toc')
115 ->addSigil('jx-toggle-class')
118 $toc_id => 'phui-document-toc-open',
125 'class' => 'phui-list-sidenav phui-document-toc-list',
129 $table_of_contents = phutil_tag(
132 'class' => 'phui-document-toc-container',
138 $foot_content = null;
140 $foot_content = phutil_tag(
143 'class' => 'phui-document-foot-content',
149 if ($this->curtain
) {
150 $curtain = phutil_tag(
153 'class' => 'phui-document-curtain',
158 $main_content = phutil_tag(
161 'class' => 'phui-document-content-view',
165 $content_inner = phutil_tag(
168 'class' => 'phui-document-inner',
177 'class' => 'phui-document-content-outer',
182 'class' => 'phui-document-content-inner',
191 $content = phutil_tag(
194 'class' => 'phui-document-content',
201 'class' => implode(' ', $classes),