Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | protected function renderObjectEmbedForAnyMedia( | ||||
if ($this->getEngine()->isTextMode()) { | if ($this->getEngine()->isTextMode()) { | ||||
return $name.' <'.PhabricatorEnv::getProductionURI($href).'>'; | return $name.' <'.PhabricatorEnv::getProductionURI($href).'>'; | ||||
} else if ($this->getEngine()->isHTMLMailMode()) { | } else if ($this->getEngine()->isHTMLMailMode()) { | ||||
$href = PhabricatorEnv::getProductionURI($href); | $href = PhabricatorEnv::getProductionURI($href); | ||||
return $this->renderObjectTagForMail($name, $href, $handle); | return $this->renderObjectTagForMail($name, $href, $handle); | ||||
} | } | ||||
// See T13678. If we're already rendering embedded content, render a | |||||
// default reference instead to avoid cycles. | |||||
if (PhabricatorMarkupEngine::isRenderingEmbeddedContent()) { | |||||
return $this->renderDefaultObjectEmbed($object, $handle); | |||||
} | |||||
return $this->renderObjectEmbed($object, $handle, $options); | return $this->renderObjectEmbed($object, $handle, $options); | ||||
} | } | ||||
protected function renderObjectEmbed( | protected function renderObjectEmbed( | ||||
$object, | $object, | ||||
PhabricatorObjectHandle $handle, | PhabricatorObjectHandle $handle, | ||||
$options) { | $options) { | ||||
return $this->renderDefaultObjectEmbed($object, $handle); | |||||
} | |||||
final protected function renderDefaultObjectEmbed( | |||||
$object, | |||||
PhabricatorObjectHandle $handle) { | |||||
$name = $handle->getFullName(); | $name = $handle->getFullName(); | ||||
$href = $handle->getURI(); | $href = $handle->getURI(); | ||||
$status_closed = PhabricatorObjectHandle::STATUS_CLOSED; | $status_closed = PhabricatorObjectHandle::STATUS_CLOSED; | ||||
$attr = array( | $attr = array( | ||||
'phid' => $handle->getPHID(), | 'phid' => $handle->getPHID(), | ||||
'closed' => ($handle->getStatus() == $status_closed), | 'closed' => ($handle->getStatus() == $status_closed), | ||||
); | ); | ||||
▲ Show 20 Lines • Show All 275 Lines • Show Last 20 Lines |