2012-12-31 00:36:06 +01:00
|
|
|
<?php
|
|
|
|
|
2013-01-01 23:09:17 +01:00
|
|
|
final class PhabricatorConfigOption
|
|
|
|
extends Phobject
|
|
|
|
implements PhabricatorMarkupInterface{
|
2012-12-31 00:36:06 +01:00
|
|
|
|
|
|
|
private $key;
|
|
|
|
private $default;
|
|
|
|
private $summary;
|
|
|
|
private $description;
|
|
|
|
private $type;
|
|
|
|
private $options;
|
|
|
|
private $group;
|
2013-01-01 23:09:17 +01:00
|
|
|
private $examples;
|
2012-12-31 00:36:06 +01:00
|
|
|
|
2013-01-01 23:09:17 +01:00
|
|
|
public function addExample($value, $description) {
|
|
|
|
$this->examples[] = array($value, $description);
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getExamples() {
|
|
|
|
return $this->examples;
|
|
|
|
}
|
2012-12-31 00:36:06 +01:00
|
|
|
|
|
|
|
public function setGroup(PhabricatorApplicationConfigOptions $group) {
|
|
|
|
$this->group = $group;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getGroup() {
|
|
|
|
return $this->group;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setOptions(array $options) {
|
|
|
|
$this->options = $options;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getOptions() {
|
|
|
|
return $this->options;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setKey($key) {
|
|
|
|
$this->key = $key;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getKey() {
|
|
|
|
return $this->key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setDefault($default) {
|
|
|
|
$this->default = $default;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDefault() {
|
|
|
|
return $this->default;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setSummary($summary) {
|
|
|
|
$this->summary = $summary;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSummary() {
|
2013-01-01 23:09:29 +01:00
|
|
|
if (empty($this->summary)) {
|
|
|
|
return $this->getDescription();
|
|
|
|
}
|
2012-12-31 00:36:06 +01:00
|
|
|
return $this->summary;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setDescription($description) {
|
|
|
|
$this->description = $description;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDescription() {
|
|
|
|
return $this->description;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setType($type) {
|
|
|
|
$this->type = $type;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getType() {
|
|
|
|
return $this->type;
|
|
|
|
}
|
|
|
|
|
2013-01-01 23:09:17 +01:00
|
|
|
/* -( PhabricatorMarkupInterface )----------------------------------------- */
|
|
|
|
|
|
|
|
public function getMarkupFieldKey($field) {
|
|
|
|
return $this->getKey().':'.$field;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function newMarkupEngine($field) {
|
|
|
|
return PhabricatorMarkupEngine::newMarkupEngine(array());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMarkupText($field) {
|
|
|
|
return $this->getDescription();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function didMarkupText($field, $output, PhutilMarkupEngine $engine) {
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function shouldUseMarkupCache($field) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-12-31 00:36:06 +01:00
|
|
|
}
|