Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/PhabricatorStandardPageView.php
Show First 20 Lines • Show All 420 Lines • ▼ Show 20 Lines | if (!empty($monospaced)) { | ||||
'.PhabricatorMonospaced, '. | '.PhabricatorMonospaced, '. | ||||
'.phabricator-remarkup .remarkup-code-block '. | '.phabricator-remarkup .remarkup-code-block '. | ||||
'.remarkup-code { font: %s !important; } '. | '.remarkup-code { font: %s !important; } '. | ||||
'</style>', | '</style>', | ||||
$monospaced); | $monospaced); | ||||
} | } | ||||
return hsprintf( | return hsprintf( | ||||
'%s%s%s%s', | '%s%s%s', | ||||
parent::getHead(), | parent::getHead(), | ||||
$font_css, | $font_css, | ||||
$response->renderSingleResource('javelin-magical-init', 'phabricator'), | $response->renderSingleResource('javelin-magical-init', 'phabricator')); | ||||
$this->newOpenGraphTags()); | |||||
} | } | ||||
public function setGlyph($glyph) { | public function setGlyph($glyph) { | ||||
$this->glyph = $glyph; | $this->glyph = $glyph; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getGlyph() { | public function getGlyph() { | ||||
▲ Show 20 Lines • Show All 465 Lines • ▼ Show 20 Lines | if ($this->getRequest()->isQuicksand()) { | ||||
$response = id(new AphrontWebpageResponse()) | $response = id(new AphrontWebpageResponse()) | ||||
->setContent($content) | ->setContent($content) | ||||
->setFrameable($this->getFrameable()); | ->setFrameable($this->getFrameable()); | ||||
} | } | ||||
return $response; | return $response; | ||||
} | } | ||||
private function newOpenGraphTags() { | |||||
// If we don't allow public access, there's no point in emitting OpenGraph | |||||
// tags because external systems can't fetch pages. | |||||
if (!PhabricatorEnv::getEnvConfig('policy.allow-public')) { | |||||
return array(); | |||||
} | |||||
$viewer = $this->getViewer(); | |||||
$properties = array( | |||||
array( | |||||
'og:title', | |||||
$this->getTitle(), | |||||
), | |||||
array( | |||||
'og:type', | |||||
'website', | |||||
), | |||||
array( | |||||
'og:url', | |||||
PhabricatorEnv::getProductionURI($this->getRequest()->getRequestURI()), | |||||
), | |||||
array( | |||||
'og:image', | |||||
celerity_get_resource_uri('rsrc/favicons/opengraph-144x144.png'), | |||||
), | |||||
); | |||||
$tags = array(); | |||||
foreach ($properties as $property) { | |||||
$tags[] = phutil_tag( | |||||
'meta', | |||||
array( | |||||
'property' => $property[0], | |||||
'content' => $property[1], | |||||
)); | |||||
} | |||||
return $tags; | |||||
} | |||||
} | } |