1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 17:54:44 +02:00

Add support for an Inputfield 'detail' property, similar to existing 'notes' property, but appears below it and in muted text.

This commit is contained in:
Ryan Cramer
2019-09-03 11:44:26 -04:00
parent e2529912da
commit 51f554176d
4 changed files with 59 additions and 19 deletions

View File

@@ -1047,5 +1047,29 @@ class Fields extends WireSaveableItems {
*/
public function ___changeTypeReady(Saveable $item, Fieldtype $fromType, Fieldtype $toType) { }
/**
* Get Fieldtypes compatible (for type change) with given Field
*
* #pw-internal
*
* @param Field $field
* @return array Array of Fieldtype objects indexed by class name
* @since 3.0.140
*
*/
public function getCompatibleFieldtypes(Field $field) {
$fieldtype = $field->type;
if($fieldtype) {
// ask fieldtype what is compatible
$fieldtypes = $fieldtype->getCompatibleFieldtypes($field);
// ensure original is present
$fieldtypes->prepend($fieldtype);
} else {
// allow all
$fieldtypes = $this->wire('fieldtypes');
}
return $fieldtypes;
}
}