Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/PhabricatorStandardPageView.php
| Show All 16 Lines | final class PhabricatorStandardPageView extends PhabricatorBarePageView | ||||
| private $pageObjects = array(); | private $pageObjects = array(); | ||||
| private $applicationMenu; | private $applicationMenu; | ||||
| private $showFooter = true; | private $showFooter = true; | ||||
| private $showDurableColumn = true; | private $showDurableColumn = true; | ||||
| private $quicksandConfig = array(); | private $quicksandConfig = array(); | ||||
| private $tabs; | private $tabs; | ||||
| private $crumbs; | private $crumbs; | ||||
| private $navigation; | private $navigation; | ||||
| private $footer; | |||||
| public function setShowFooter($show_footer) { | public function setShowFooter($show_footer) { | ||||
| $this->showFooter = $show_footer; | $this->showFooter = $show_footer; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getShowFooter() { | public function getShowFooter() { | ||||
| return $this->showFooter; | return $this->showFooter; | ||||
| ▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | if (strlen($prefix)) { | ||||
| $title = $prefix.' '.$title; | $title = $prefix.' '.$title; | ||||
| } | } | ||||
| return $title; | return $title; | ||||
| } | } | ||||
| protected function willRenderPage() { | protected function willRenderPage() { | ||||
| $footer = $this->renderFooter(); | |||||
| // NOTE: A cleaner solution would be to let body layout elements implement | |||||
| // some kind of "LayoutInterface" so content can be embedded inside frames, | |||||
| // but there's only really one use case for this for now. | |||||
| $children = $this->renderChildren(); | |||||
| if ($children) { | |||||
| $layout = head($children); | |||||
| if ($layout instanceof PHUIFormationView) { | |||||
| $layout->setFooter($footer); | |||||
| $footer = null; | |||||
| } | |||||
| } | |||||
| $this->footer = $footer; | |||||
| parent::willRenderPage(); | parent::willRenderPage(); | ||||
| if (!$this->getRequest()) { | if (!$this->getRequest()) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'You must set the %s to render a %s.', | 'You must set the %s to render a %s.', | ||||
| 'Request', | 'Request', | ||||
| __CLASS__)); | __CLASS__)); | ||||
| ▲ Show 20 Lines • Show All 289 Lines • ▼ Show 20 Lines | return phutil_tag( | ||||
| )); | )); | ||||
| } | } | ||||
| private function renderPageBodyContent() { | private function renderPageBodyContent() { | ||||
| $console = $this->getConsole(); | $console = $this->getConsole(); | ||||
| $body = parent::getBody(); | $body = parent::getBody(); | ||||
| $footer = $this->renderFooter(); | |||||
| $nav = $this->getNavigation(); | $nav = $this->getNavigation(); | ||||
| $tabs = $this->getTabs(); | $tabs = $this->getTabs(); | ||||
| if ($nav) { | if ($nav) { | ||||
| $crumbs = $this->getCrumbs(); | $crumbs = $this->getCrumbs(); | ||||
| if ($crumbs) { | if ($crumbs) { | ||||
| $nav->setCrumbs($crumbs); | $nav->setCrumbs($crumbs); | ||||
| } | } | ||||
| $nav->appendChild($body); | $nav->appendChild($body); | ||||
| $nav->appendFooter($footer); | $nav->appendFooter($this->footer); | ||||
| $content = phutil_implode_html('', array($nav->render())); | $content = phutil_implode_html('', array($nav->render())); | ||||
| } else { | } else { | ||||
| $content = array(); | $content = array(); | ||||
| $crumbs = $this->getCrumbs(); | $crumbs = $this->getCrumbs(); | ||||
| if ($crumbs) { | if ($crumbs) { | ||||
| if ($this->getTabs()) { | if ($this->getTabs()) { | ||||
| $crumbs->setBorder(true); | $crumbs->setBorder(true); | ||||
| } | } | ||||
| $content[] = $crumbs; | $content[] = $crumbs; | ||||
| } | } | ||||
| $tabs = $this->getTabs(); | $tabs = $this->getTabs(); | ||||
| if ($tabs) { | if ($tabs) { | ||||
| $content[] = $tabs; | $content[] = $tabs; | ||||
| } | } | ||||
| $content[] = $body; | $content[] = $body; | ||||
| $content[] = $footer; | $content[] = $this->footer; | ||||
| $content = phutil_implode_html('', $content); | $content = phutil_implode_html('', $content); | ||||
| } | } | ||||
| return array( | return array( | ||||
| ($console ? hsprintf('<darkconsole />') : null), | ($console ? hsprintf('<darkconsole />') : null), | ||||
| $content, | $content, | ||||
| ); | ); | ||||
| ▲ Show 20 Lines • Show All 358 Lines • Show Last 20 Lines | |||||