Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/herald/value/HeraldFieldValue.php
12256 views
1
<?php
2
3
abstract class HeraldFieldValue extends Phobject {
4
5
private $viewer;
6
7
const CONTROL_NONE = 'herald.control.none';
8
const CONTROL_TEXT = 'herald.control.text';
9
const CONTROL_SELECT = 'herald.control.select';
10
const CONTROL_TOKENIZER = 'herald.control.tokenizer';
11
const CONTROL_REMARKUP = 'herald.control.remarkup';
12
13
abstract public function getFieldValueKey();
14
abstract public function getControlType();
15
abstract public function renderFieldValue($value);
16
abstract public function renderEditorValue($value);
17
18
public function setViewer(PhabricatorUser $viewer) {
19
$this->viewer = $viewer;
20
return $this;
21
}
22
23
public function getViewer() {
24
return $this->viewer;
25
}
26
27
final public function getControlSpecificationDictionary() {
28
return array(
29
'key' => $this->getFieldValueKey(),
30
'control' => $this->getControlType(),
31
'template' => $this->getControlTemplate(),
32
);
33
}
34
35
protected function getControlTemplate() {
36
return array();
37
}
38
39
public function renderTranscriptValue($value) {
40
return $this->renderFieldValue($value);
41
}
42
43
}
44
45