Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/PhabricatorStandardPageView.php
<?php | <?php | ||||
/** | /** | ||||
* This is a standard Phabricator page with menus, Javelin, DarkConsole, and | * This is a standard Phabricator page with menus, Javelin, DarkConsole, and | ||||
* basic styles. | * basic styles. | ||||
*/ | */ | ||||
final class PhabricatorStandardPageView extends PhabricatorBarePageView | final class PhabricatorStandardPageView extends PhabricatorBarePageView | ||||
implements AphrontResponseProducerInterface { | implements AphrontResponseProducerInterface { | ||||
private $baseURI; | private $baseURI; | ||||
private $applicationName; | private $applicationName; | ||||
private $glyph; | private $glyph; | ||||
private $menuContent; | private $menuContent; | ||||
private $showChrome = true; | private $showChrome = true; | ||||
private $classes = array(); | private $classes = array(); | ||||
private $frameClasses = array(); | |||||
private $disableConsole; | private $disableConsole; | ||||
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 $crumbs; | private $crumbs; | ||||
private $navigation; | private $navigation; | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | public function getShowChrome() { | ||||
return $this->showChrome; | return $this->showChrome; | ||||
} | } | ||||
public function addClass($class) { | public function addClass($class) { | ||||
$this->classes[] = $class; | $this->classes[] = $class; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function addFrameClass($class) { | |||||
$this->frameClasses[] = $class; | |||||
return $this; | |||||
} | |||||
public function setPageObjectPHIDs(array $phids) { | public function setPageObjectPHIDs(array $phids) { | ||||
$this->pageObjects = $phids; | $this->pageObjects = $phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setShowDurableColumn($show) { | public function setShowDurableColumn($show) { | ||||
$this->showDurableColumn = $show; | $this->showDurableColumn = $show; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 432 Lines • ▼ Show 20 Lines | private function renderPageBodyContent() { | ||||
$nav = $this->getNavigation(); | $nav = $this->getNavigation(); | ||||
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($footer); | ||||
$content = $nav; | $content = phutil_implode_html('', array($nav->render())); | ||||
} else { | } else { | ||||
$content = array(); | $content = array(); | ||||
$crumbs = $this->getCrumbs(); | $crumbs = $this->getCrumbs(); | ||||
if ($crumbs) { | if ($crumbs) { | ||||
$content[] = $crumbs; | $content[] = $crumbs; | ||||
} | } | ||||
$content[] = $body; | $content[] = $body; | ||||
$content[] = $footer; | $content[] = $footer; | ||||
} | |||||
$frame_classes = $this->frameClasses; | |||||
$frame_classes[] = 'main-page-background'; | |||||
$content = phutil_tag( | $content = phutil_implode_html('', $content); | ||||
'div', | } | ||||
array( | |||||
'class' => implode(' ', $frame_classes), | |||||
), | |||||
$content); | |||||
return array( | return array( | ||||
($console ? hsprintf('<darkconsole />') : null), | ($console ? hsprintf('<darkconsole />') : null), | ||||
$content, | $content, | ||||
); | ); | ||||
} | } | ||||
protected function getTail() { | protected function getTail() { | ||||
▲ Show 20 Lines • Show All 339 Lines • Show Last 20 Lines |