Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13993169
D8606.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8606.id.diff
View Options
diff --git a/src/docs/user/configuration/custom_fields.diviner b/src/docs/user/configuration/custom_fields.diviner
--- a/src/docs/user/configuration/custom_fields.diviner
+++ b/src/docs/user/configuration/custom_fields.diviner
@@ -101,6 +101,8 @@
- **default**: Default field value.
- **strings**: Allows you to override specific strings based on the field
type. See below.
+ - **instructions**: Optional block of remarkup text which will appear
+ above the control when rendered on the edit view.
The `strings` value supports different strings per control type. They are:
diff --git a/src/infrastructure/customfield/field/PhabricatorCustomField.php b/src/infrastructure/customfield/field/PhabricatorCustomField.php
--- a/src/infrastructure/customfield/field/PhabricatorCustomField.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php
@@ -1063,6 +1063,17 @@
/**
* @task edit
*/
+ public function getInstructionsForEdit() {
+ if ($this->proxy) {
+ return $this->proxy->getInstructionsForEdit();
+ }
+ return null;
+ }
+
+
+ /**
+ * @task edit
+ */
public function renderEditControl(array $handles) {
if ($this->proxy) {
return $this->proxy->renderEditControl($handles);
diff --git a/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php b/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php
--- a/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php
@@ -108,6 +108,12 @@
foreach ($enabled as $field_key => $field) {
$field_handles = array_select_keys($handles, $phids[$field_key]);
+
+ $instructions = $field->getInstructionsForEdit();
+ if (strlen($instructions)) {
+ $form->appendRemarkupInstructions($instructions);
+ }
+
$form->appendChild($field->renderEditControl($field_handles));
}
}
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
@@ -211,6 +211,10 @@
$this->setFieldValue($value);
}
+ public function getInstructionsForEdit() {
+ return $this->getFieldConfigValue('instructions');
+ }
+
public function renderEditControl(array $handles) {
return id(new AphrontFormTextControl())
->setName($this->getFieldKey())
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 23, 9:08 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717174
Default Alt Text
D8606.id.diff (2 KB)
Attached To
Mode
D8606: Add an "instructions" key to custom fields
Attached
Detach File
Event Timeline
Log In to Comment