Path: blob/master/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php
12242 views
<?php12final class PhabricatorStandardCustomFieldRemarkup3extends PhabricatorStandardCustomField {45public function getFieldType() {6return 'remarkup';7}89public function renderEditControl(array $handles) {10return id(new PhabricatorRemarkupControl())11->setUser($this->getViewer())12->setLabel($this->getFieldName())13->setName($this->getFieldKey())14->setCaption($this->getCaption())15->setValue($this->getFieldValue());16}1718public function getStyleForPropertyView() {19return 'block';20}2122public function getApplicationTransactionRemarkupBlocks(23PhabricatorApplicationTransaction $xaction) {24return array(25$xaction->getNewValue(),26);27}2829public function renderPropertyViewValue(array $handles) {30$value = $this->getFieldValue();3132if ($value === null || !strlen($value)) {33return null;34}3536// TODO: Once this stabilizes, it would be nice to let fields batch this.37// For now, an extra query here and there on object detail pages isn't the38// end of the world.3940$viewer = $this->getViewer();41return new PHUIRemarkupView($viewer, $value);42}4344public function getApplicationTransactionTitle(45PhabricatorApplicationTransaction $xaction) {46$author_phid = $xaction->getAuthorPHID();47return pht(48'%s edited %s.',49$xaction->renderHandleLink($author_phid),50$this->getFieldName());51}5253public function getApplicationTransactionTitleForFeed(54PhabricatorApplicationTransaction $xaction) {55$author_phid = $xaction->getAuthorPHID();56$object_phid = $xaction->getObjectPHID();57return pht(58'%s edited %s on %s.',59$xaction->renderHandleLink($author_phid),60$this->getFieldName(),61$xaction->renderHandleLink($object_phid));62}6364public function getApplicationTransactionHasChangeDetails(65PhabricatorApplicationTransaction $xaction) {66return true;67}6869public function getApplicationTransactionChangeDetails(70PhabricatorApplicationTransaction $xaction,71PhabricatorUser $viewer) {72return $xaction->renderTextCorpusChangeDetails(73$viewer,74$xaction->getOldValue(),75$xaction->getNewValue());76}7778public function shouldAppearInHerald() {79return true;80}8182public function getHeraldFieldConditions() {83return array(84HeraldAdapter::CONDITION_CONTAINS,85HeraldAdapter::CONDITION_NOT_CONTAINS,86HeraldAdapter::CONDITION_IS,87HeraldAdapter::CONDITION_IS_NOT,88HeraldAdapter::CONDITION_REGEXP,89HeraldAdapter::CONDITION_NOT_REGEXP,90);91}9293public function getHeraldFieldStandardType() {94return HeraldField::STANDARD_TEXT;95}9697protected function getHTTPParameterType() {98return new AphrontStringHTTPParameterType();99}100101public function shouldAppearInApplicationSearch() {102return false;103}104105public function getConduitEditParameterType() {106return new ConduitStringParameterType();107}108109protected function newExportFieldType() {110return new PhabricatorStringExportField();111}112113}114115116