2013-09-16 16:04:18 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorStandardCustomFieldRemarkup
|
|
|
|
extends PhabricatorStandardCustomField {
|
|
|
|
|
|
|
|
public function getFieldType() {
|
|
|
|
return 'remarkup';
|
|
|
|
}
|
|
|
|
|
2014-02-21 11:53:37 -08:00
|
|
|
public function renderEditControl(array $handles) {
|
2013-09-16 16:04:18 -07:00
|
|
|
return id(new PhabricatorRemarkupControl())
|
|
|
|
->setLabel($this->getFieldName())
|
|
|
|
->setName($this->getFieldKey())
|
2013-09-18 10:12:24 -07:00
|
|
|
->setCaption($this->getCaption())
|
2013-09-16 16:04:18 -07:00
|
|
|
->setValue($this->getFieldValue());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getStyleForPropertyView() {
|
|
|
|
return 'block';
|
|
|
|
}
|
|
|
|
|
2014-02-26 14:46:18 -08:00
|
|
|
public function renderPropertyViewValue(array $handles) {
|
2013-09-16 16:04:18 -07:00
|
|
|
$value = $this->getFieldValue();
|
|
|
|
|
|
|
|
if (!strlen($value)) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Once this stabilizes, it would be nice to let fields batch this.
|
|
|
|
// For now, an extra query here and there on object detail pages isn't the
|
|
|
|
// end of the world.
|
|
|
|
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
return PhabricatorMarkupEngine::renderOneObject(
|
|
|
|
id(new PhabricatorMarkupOneOff())->setContent($value),
|
|
|
|
'default',
|
|
|
|
$viewer);
|
|
|
|
}
|
|
|
|
|
2013-09-21 16:23:17 -07:00
|
|
|
public function getApplicationTransactionTitle(
|
|
|
|
PhabricatorApplicationTransaction $xaction) {
|
|
|
|
$author_phid = $xaction->getAuthorPHID();
|
|
|
|
|
|
|
|
// TODO: Expose fancy transactions.
|
|
|
|
|
|
|
|
return pht(
|
|
|
|
'%s edited %s.',
|
|
|
|
$xaction->renderHandleLink($author_phid),
|
|
|
|
$this->getFieldName());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-16 16:04:18 -07:00
|
|
|
}
|