1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 03:02:43 +01:00
phorge-phorge/src/applications/transactions/editfield/PhabricatorTextEditField.php
epriestley 09e71a4082 Define bulk edits in terms of EditEngine, not hard-coded ad-hoc definitions
Summary:
Depends on D18862. See PHI173. Ref T13025. Fixes T10005. This redefines bulk edits in terms of EditEngine fields, rather than hard-coding the whole thing.

Only text fields -- and, specifically, only the "Title" field -- are supported after this change. Followup changes will add more bulk edit parameter types and broader field support.

However, the title field now works without any Maniphest-specific code, outside of the small amount of binding code in the `ManiphestBulkEditor` subclass.

Test Plan: Used the bulk edit workflow to change the titles of tasks.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13025, T10005

Differential Revision: https://secure.phabricator.com/D18863
2018-01-19 12:43:47 -08:00

36 lines
718 B
PHP

<?php
final class PhabricatorTextEditField
extends PhabricatorEditField {
private $placeholder;
public function setPlaceholder($placeholder) {
$this->placeholder = $placeholder;
return $this;
}
public function getPlaceholder() {
return $this->placeholder;
}
protected function newControl() {
$control = new AphrontFormTextControl();
$placeholder = $this->getPlaceholder();
if (strlen($placeholder)) {
$control->setPlaceholder($placeholder);
}
return $control;
}
protected function newConduitParameterType() {
return new ConduitStringParameterType();
}
protected function newBulkParameterType() {
return new BulkStringParameterType();
}
}