Files
phabricator/src/view/form/control/AphrontFormHandlesControl.php
epriestley d53187e10a Make "Create Subtask" work properly in EditEngine
Summary: Ref T9908. This fixes "Create Subtask" so it works with the new stuff. Mostly straightforward.

Test Plan: Created some subtasks.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9908

Differential Revision: https://secure.phabricator.com/D14706
2015-12-08 14:29:58 -08:00

37 lines
783 B
PHP

<?php
final class AphrontFormHandlesControl extends AphrontFormControl {
protected function getCustomControlClass() {
return 'aphront-form-control-handles';
}
protected function shouldRender() {
return (bool)$this->getValue();
}
protected function renderInput() {
$value = $this->getValue();
$viewer = $this->getUser();
$list = $viewer->renderHandleList($value);
$list = id(new PHUIBoxView())
->addPadding(PHUI::PADDING_SMALL_TOP)
->appendChild($list);
$inputs = array();
foreach ($value as $phid) {
$inputs[] = phutil_tag(
'input',
array(
'type' => 'hidden',
'name' => $this->getName().'[]',
'value' => $phid,
));
}
return array($list, $inputs);
}
}