Summary: it's ugly. but it works. basically. See T2399 for a roughly prioritized list of what still needs to happen.
Test Plan:
- created a conpherence with myself from my profile
- created a conpherence with myself from "new conpherence"
- created a conphernece with another from "new conpherence"
- created a conpherence with several others
- created a conpherence with files in the initial post
- verified files via comment text ("{F232} is awesome!") and via traditional attach
- edited a conpherence image
- verified it showed up in the header and in the conpherence menu on the left
- edited a conpherence title
- verified it showed up in the header and in the conpherence menu on the right
- verified each widget showed up when clicked and displayed the proper data
- calendar being an exception since it sucks so hard right now.
Reviewers: epriestley, chad
Reviewed By: epriestley
CC: aran, epriestley, chad, codeblock, Korvin
Maniphest Tasks: T2301
Differential Revision: https://secure.phabricator.com/D4620
79 lines
1.8 KiB
PHP
79 lines
1.8 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @concrete-extensible
|
|
*/
|
|
class AphrontFormTextAreaControl extends AphrontFormControl {
|
|
|
|
const HEIGHT_VERY_SHORT = 'very-short';
|
|
const HEIGHT_SHORT = 'short';
|
|
const HEIGHT_VERY_TALL = 'very-tall';
|
|
|
|
private $height;
|
|
private $readOnly;
|
|
private $customClass;
|
|
private $placeHolder;
|
|
|
|
public function setPlaceHolder($place_holder) {
|
|
$this->placeHolder = $place_holder;
|
|
return $this;
|
|
}
|
|
private function getPlaceHolder() {
|
|
return $this->placeHolder;
|
|
}
|
|
|
|
public function setHeight($height) {
|
|
$this->height = $height;
|
|
return $this;
|
|
}
|
|
|
|
public function setReadOnly($read_only) {
|
|
$this->readOnly = $read_only;
|
|
return $this;
|
|
}
|
|
|
|
protected function getReadOnly() {
|
|
return $this->readOnly;
|
|
}
|
|
|
|
protected function getCustomControlClass() {
|
|
return 'aphront-form-control-textarea';
|
|
}
|
|
|
|
public function setCustomClass($custom_class) {
|
|
$this->customClass = $custom_class;
|
|
return $this;
|
|
}
|
|
|
|
protected function renderInput() {
|
|
|
|
$height_class = null;
|
|
switch ($this->height) {
|
|
case self::HEIGHT_VERY_SHORT:
|
|
case self::HEIGHT_SHORT:
|
|
case self::HEIGHT_VERY_TALL:
|
|
$height_class = 'aphront-textarea-'.$this->height;
|
|
break;
|
|
}
|
|
|
|
$classes = array();
|
|
$classes[] = $height_class;
|
|
$classes[] = $this->customClass;
|
|
$classes = trim(implode(' ', $classes));
|
|
|
|
return phutil_render_tag(
|
|
'textarea',
|
|
array(
|
|
'name' => $this->getName(),
|
|
'disabled' => $this->getDisabled() ? 'disabled' : null,
|
|
'readonly' => $this->getReadonly() ? 'readonly' : null,
|
|
'class' => $classes,
|
|
'style' => $this->getControlStyle(),
|
|
'id' => $this->getID(),
|
|
'placeholder' => $this->getPlaceHolder(),
|
|
),
|
|
phutil_escape_html($this->getValue()));
|
|
}
|
|
|
|
}
|