mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 01:32:42 +01:00
54409e7716
Summary: Fixes T10952. Fixes T10930. I didn't implement this method correctly when I expanded this field for repositories. Test Plan: Edited a paste without warnings. Reviewers: avivey, chad Reviewed By: chad Maniphest Tasks: T10930, T10952 Differential Revision: https://secure.phabricator.com/D15892
77 lines
1.6 KiB
PHP
77 lines
1.6 KiB
PHP
<?php
|
|
|
|
final class PhabricatorTextAreaEditField
|
|
extends PhabricatorEditField {
|
|
|
|
private $monospaced;
|
|
private $height;
|
|
private $isStringList;
|
|
|
|
public function setMonospaced($monospaced) {
|
|
$this->monospaced = $monospaced;
|
|
return $this;
|
|
}
|
|
|
|
public function getMonospaced() {
|
|
return $this->monospaced;
|
|
}
|
|
|
|
public function setHeight($height) {
|
|
$this->height = $height;
|
|
return $this;
|
|
}
|
|
|
|
public function getHeight() {
|
|
return $this->height;
|
|
}
|
|
|
|
public function setIsStringList($is_string_list) {
|
|
$this->isStringList = $is_string_list;
|
|
return $this;
|
|
}
|
|
|
|
public function getIsStringList() {
|
|
return $this->isStringList;
|
|
}
|
|
|
|
protected function newControl() {
|
|
$control = new AphrontFormTextAreaControl();
|
|
|
|
if ($this->getMonospaced()) {
|
|
$control->setCustomClass('PhabricatorMonospaced');
|
|
}
|
|
|
|
$height = $this->getHeight();
|
|
if ($height) {
|
|
$control->setHeight($height);
|
|
}
|
|
|
|
return $control;
|
|
}
|
|
|
|
protected function getValueForControl() {
|
|
$value = $this->getValue();
|
|
if ($this->getIsStringList()) {
|
|
return implode("\n", $value);
|
|
} else {
|
|
return $value;
|
|
}
|
|
}
|
|
|
|
protected function newConduitParameterType() {
|
|
if ($this->getIsStringList()) {
|
|
return new ConduitStringListParameterType();
|
|
} else {
|
|
return new ConduitStringParameterType();
|
|
}
|
|
}
|
|
|
|
protected function newHTTPParameterType() {
|
|
if ($this->getIsStringList()) {
|
|
return new AphrontStringListHTTPParameterType();
|
|
} else {
|
|
return new AphrontStringHTTPParameterType();
|
|
}
|
|
}
|
|
|
|
}
|