Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | abstract class PhabricatorObjectRemarkupRule extends PhutilRemarkupRule { | ||||
protected function renderObjectRef( | protected function renderObjectRef( | ||||
$object, | $object, | ||||
PhabricatorObjectHandle $handle, | PhabricatorObjectHandle $handle, | ||||
$anchor, | $anchor, | ||||
$id) { | $id) { | ||||
$href = $this->getObjectHref($object, $handle, $id); | $href = $this->getObjectHref($object, $handle, $id); | ||||
$text = $this->getObjectNamePrefix().$id; | $text = $this->getObjectNamePrefix().$id; | ||||
$status_closed = PhabricatorObjectHandleStatus::STATUS_CLOSED; | $status_closed = PhabricatorObjectHandle::STATUS_CLOSED; | ||||
if ($anchor) { | if ($anchor) { | ||||
$href = $href.'#'.$anchor; | $href = $href.'#'.$anchor; | ||||
$text = $text.'#'.$anchor; | $text = $text.'#'.$anchor; | ||||
} | } | ||||
$attr = array( | $attr = array( | ||||
'phid' => $handle->getPHID(), | 'phid' => $handle->getPHID(), | ||||
Show All 23 Lines | abstract class PhabricatorObjectRemarkupRule extends PhutilRemarkupRule { | ||||
protected function renderObjectEmbed( | protected function renderObjectEmbed( | ||||
$object, | $object, | ||||
PhabricatorObjectHandle $handle, | PhabricatorObjectHandle $handle, | ||||
$options) { | $options) { | ||||
$name = $handle->getFullName(); | $name = $handle->getFullName(); | ||||
$href = $handle->getURI(); | $href = $handle->getURI(); | ||||
$status_closed = PhabricatorObjectHandleStatus::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), | ||||
); | ); | ||||
return $this->renderHovertag($name, $href, $attr); | return $this->renderHovertag($name, $href, $attr); | ||||
} | } | ||||
protected function renderObjectTagForMail( | protected function renderObjectTagForMail( | ||||
$text, | $text, | ||||
$href, | $href, | ||||
PhabricatorObjectHandle $handle) { | PhabricatorObjectHandle $handle) { | ||||
$status_closed = PhabricatorObjectHandleStatus::STATUS_CLOSED; | $status_closed = PhabricatorObjectHandle::STATUS_CLOSED; | ||||
$strikethrough = $handle->getStatus() == $status_closed ? | $strikethrough = $handle->getStatus() == $status_closed ? | ||||
'text-decoration: line-through;' : | 'text-decoration: line-through;' : | ||||
'text-decoration: none;'; | 'text-decoration: none;'; | ||||
return phutil_tag( | return phutil_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => $href, | 'href' => $href, | ||||
▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines |